Fix Sonar findings (#2630)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
2
.github/dependabot.yml
vendored
2
.github/dependabot.yml
vendored
@@ -16,7 +16,7 @@ updates:
|
|||||||
interval: "daily"
|
interval: "daily"
|
||||||
# Enable version updates for github actions
|
# Enable version updates for github actions
|
||||||
- package-ecosystem: "github-actions"
|
- package-ecosystem: "github-actions"
|
||||||
directory: "/.3rd-party"
|
directory: "/"
|
||||||
# Check daily
|
# Check daily
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: "daily"
|
||||||
|
|||||||
@@ -1539,10 +1539,6 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes
|
|||||||
// hashes
|
// hashes
|
||||||
final DbArtifactHash hash = artifact.getHashes();
|
final DbArtifactHash hash = artifact.getHashes();
|
||||||
assertThat(hash.getSha1()).as("Wrong sha1 hash").isEqualTo(HashGeneratorUtils.generateSHA1(random));
|
assertThat(hash.getSha1()).as("Wrong sha1 hash").isEqualTo(HashGeneratorUtils.generateSHA1(random));
|
||||||
// sha1 hashes are not used via loaded artifact
|
|
||||||
// assertThat(hash.getMd5()).as("Wrong md5 hash").isEqualTo(HashGeneratorUtils.generateMD5(random));
|
|
||||||
// assertThat(hash.getSha256()).as("Wrong sha256 hash").isEqualTo(HashGeneratorUtils.generateSHA256(random));
|
|
||||||
|
|
||||||
// metadata
|
// metadata
|
||||||
assertThat(softwareModuleManagement.find(sm.getId()).orElseThrow().getArtifacts().get(0).getFilename())
|
assertThat(softwareModuleManagement.find(sm.getId()).orElseThrow().getArtifacts().get(0).getFilename())
|
||||||
.as("wrong metadata of the filename").isEqualTo("origFilename");
|
.as("wrong metadata of the filename").isEqualTo("origFilename");
|
||||||
|
|||||||
@@ -83,10 +83,6 @@ public abstract class AbstractJpaIntegrationTest extends AbstractIntegrationTest
|
|||||||
protected static final String NOT_EXIST_ID = "12345678990";
|
protected static final String NOT_EXIST_ID = "12345678990";
|
||||||
protected static final long NOT_EXIST_IDL = Long.parseLong(NOT_EXIST_ID);
|
protected static final long NOT_EXIST_IDL = Long.parseLong(NOT_EXIST_ID);
|
||||||
|
|
||||||
private static final List<String> REPOSITORY_AND_TARGET_PERMISSIONS = List.of(SpPermission.READ_REPOSITORY, SpPermission.CREATE_REPOSITORY,
|
|
||||||
SpPermission.UPDATE_REPOSITORY, SpPermission.DELETE_REPOSITORY, SpPermission.READ_TARGET, SpPermission.CREATE_TARGET,
|
|
||||||
SpPermission.UPDATE_TARGET, SpPermission.DELETE_TARGET);
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
protected TargetRepository targetRepository;
|
protected TargetRepository targetRepository;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
@@ -246,14 +246,14 @@ class DistributionSetAccessControllerTest extends AbstractJpaIntegrationTest {
|
|||||||
UPDATE_DISTRIBUTION_SET + "/id==" + permitted.getId(),
|
UPDATE_DISTRIBUTION_SET + "/id==" + permitted.getId(),
|
||||||
// read / update target needed to update target filter query
|
// read / update target needed to update target filter query
|
||||||
READ_TARGET, UPDATE_TARGET), () -> {
|
READ_TARGET, UPDATE_TARGET), () -> {
|
||||||
// assertThat(targetFilterQueryManagement
|
assertThat(targetFilterQueryManagement
|
||||||
// .updateAutoAssignDS(new AutoAssignDistributionSetUpdate(targetFilterQuery.getId()).ds(permitted.getId())
|
.updateAutoAssignDS(new AutoAssignDistributionSetUpdate(targetFilterQuery.getId()).ds(permitted.getId())
|
||||||
// .actionType(Action.ActionType.FORCED).confirmationRequired(false))
|
.actionType(Action.ActionType.FORCED).confirmationRequired(false))
|
||||||
// .getAutoAssignDistributionSet().getId()).isEqualTo(permitted.getId());
|
.getAutoAssignDistributionSet().getId()).isEqualTo(permitted.getId());
|
||||||
// targetFilterQueryManagement
|
targetFilterQueryManagement
|
||||||
// .updateAutoAssignDS(new AutoAssignDistributionSetUpdate(targetFilterQuery.getId())
|
.updateAutoAssignDS(new AutoAssignDistributionSetUpdate(targetFilterQuery.getId())
|
||||||
// .ds(readOnly.getId()).actionType(Action.ActionType.FORCED).confirmationRequired(false))
|
.ds(readOnly.getId()).actionType(Action.ActionType.FORCED).confirmationRequired(false))
|
||||||
// .getAutoAssignDistributionSet().getId();
|
.getAutoAssignDistributionSet().getId();
|
||||||
final AutoAssignDistributionSetUpdate autoAssignDistributionSetUpdate =
|
final AutoAssignDistributionSetUpdate autoAssignDistributionSetUpdate =
|
||||||
new AutoAssignDistributionSetUpdate(targetFilterQuery.getId())
|
new AutoAssignDistributionSetUpdate(targetFilterQuery.getId())
|
||||||
.ds(hidden.getId()).actionType(Action.ActionType.FORCED).confirmationRequired(false);
|
.ds(hidden.getId()).actionType(Action.ActionType.FORCED).confirmationRequired(false);
|
||||||
|
|||||||
@@ -133,10 +133,8 @@ class ArtifactManagementTest extends AbstractJpaIntegrationTest {
|
|||||||
final DbArtifact dbArtifact = artifactManagement.loadArtifactBinary(
|
final DbArtifact dbArtifact = artifactManagement.loadArtifactBinary(
|
||||||
HashGeneratorUtils.generateSHA1(randomBytes), sm.getId(), sm.isEncrypted());
|
HashGeneratorUtils.generateSHA1(randomBytes), sm.getId(), sm.isEncrypted());
|
||||||
final DbArtifactHash hash = dbArtifact.getHashes();
|
final DbArtifactHash hash = dbArtifact.getHashes();
|
||||||
|
// md5 and sha256 are kept in local artifact db and should not be provided by "load", test only sha1
|
||||||
assertThat(hash.getSha1()).isEqualTo(HashGeneratorUtils.generateSHA1(randomBytes));
|
assertThat(hash.getSha1()).isEqualTo(HashGeneratorUtils.generateSHA1(randomBytes));
|
||||||
// md5 and sha256 are kept in local artifact db and should not be provided by "load"
|
|
||||||
// assertThat(hash.getMd5()).isEqualTo(HashGeneratorUtils.generateMD5(randomBytes));
|
|
||||||
// assertThat(hash.getSha256()).isEqualTo(HashGeneratorUtils.generateSHA256(randomBytes));
|
|
||||||
|
|
||||||
assertThat(artifactRepository.findAll()).hasSize(4);
|
assertThat(artifactRepository.findAll()).hasSize(4);
|
||||||
assertThat(softwareModuleRepository.findAll()).hasSize(3);
|
assertThat(softwareModuleRepository.findAll()).hasSize(3);
|
||||||
|
|||||||
Reference in New Issue
Block a user