Skip to content

Commit 42b0bc0

Browse files
authored
Fix Sonar findings (#2630)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
1 parent 5874632 commit 42b0bc0

File tree

5 files changed

+10
-20
lines changed

5 files changed

+10
-20
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ updates:
1616
interval: "daily"
1717
# Enable version updates for github actions
1818
- package-ecosystem: "github-actions"
19-
directory: "/.3rd-party"
19+
directory: "/"
2020
# Check daily
2121
schedule:
2222
interval: "daily"

hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResourceTest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,10 +1539,6 @@ private void assertArtifact(final SoftwareModule sm, final byte[] random) throws
15391539
// hashes
15401540
final DbArtifactHash hash = artifact.getHashes();
15411541
assertThat(hash.getSha1()).as("Wrong sha1 hash").isEqualTo(HashGeneratorUtils.generateSHA1(random));
1542-
// sha1 hashes are not used via loaded artifact
1543-
// assertThat(hash.getMd5()).as("Wrong md5 hash").isEqualTo(HashGeneratorUtils.generateMD5(random));
1544-
// assertThat(hash.getSha256()).as("Wrong sha256 hash").isEqualTo(HashGeneratorUtils.generateSHA256(random));
1545-
15461542
// metadata
15471543
assertThat(softwareModuleManagement.find(sm.getId()).orElseThrow().getArtifacts().get(0).getFilename())
15481544
.as("wrong metadata of the filename").isEqualTo("origFilename");

hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/AbstractJpaIntegrationTest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,6 @@ public abstract class AbstractJpaIntegrationTest extends AbstractIntegrationTest
8383
protected static final String NOT_EXIST_ID = "12345678990";
8484
protected static final long NOT_EXIST_IDL = Long.parseLong(NOT_EXIST_ID);
8585

86-
private static final List<String> REPOSITORY_AND_TARGET_PERMISSIONS = List.of(SpPermission.READ_REPOSITORY, SpPermission.CREATE_REPOSITORY,
87-
SpPermission.UPDATE_REPOSITORY, SpPermission.DELETE_REPOSITORY, SpPermission.READ_TARGET, SpPermission.CREATE_TARGET,
88-
SpPermission.UPDATE_TARGET, SpPermission.DELETE_TARGET);
89-
9086
@Autowired
9187
protected TargetRepository targetRepository;
9288
@Autowired

hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/acm/DistributionSetAccessControllerTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -246,14 +246,14 @@ void verifyAutoAssignmentUsage() {
246246
UPDATE_DISTRIBUTION_SET + "/id==" + permitted.getId(),
247247
// read / update target needed to update target filter query
248248
READ_TARGET, UPDATE_TARGET), () -> {
249-
// assertThat(targetFilterQueryManagement
250-
// .updateAutoAssignDS(new AutoAssignDistributionSetUpdate(targetFilterQuery.getId()).ds(permitted.getId())
251-
// .actionType(Action.ActionType.FORCED).confirmationRequired(false))
252-
// .getAutoAssignDistributionSet().getId()).isEqualTo(permitted.getId());
253-
// targetFilterQueryManagement
254-
// .updateAutoAssignDS(new AutoAssignDistributionSetUpdate(targetFilterQuery.getId())
255-
// .ds(readOnly.getId()).actionType(Action.ActionType.FORCED).confirmationRequired(false))
256-
// .getAutoAssignDistributionSet().getId();
249+
assertThat(targetFilterQueryManagement
250+
.updateAutoAssignDS(new AutoAssignDistributionSetUpdate(targetFilterQuery.getId()).ds(permitted.getId())
251+
.actionType(Action.ActionType.FORCED).confirmationRequired(false))
252+
.getAutoAssignDistributionSet().getId()).isEqualTo(permitted.getId());
253+
targetFilterQueryManagement
254+
.updateAutoAssignDS(new AutoAssignDistributionSetUpdate(targetFilterQuery.getId())
255+
.ds(readOnly.getId()).actionType(Action.ActionType.FORCED).confirmationRequired(false))
256+
.getAutoAssignDistributionSet().getId();
257257
final AutoAssignDistributionSetUpdate autoAssignDistributionSetUpdate =
258258
new AutoAssignDistributionSetUpdate(targetFilterQuery.getId())
259259
.ds(hidden.getId()).actionType(Action.ActionType.FORCED).confirmationRequired(false);

hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/ArtifactManagementTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,8 @@ void createArtifact() throws IOException {
133133
final DbArtifact dbArtifact = artifactManagement.loadArtifactBinary(
134134
HashGeneratorUtils.generateSHA1(randomBytes), sm.getId(), sm.isEncrypted());
135135
final DbArtifactHash hash = dbArtifact.getHashes();
136+
// md5 and sha256 are kept in local artifact db and should not be provided by "load", test only sha1
136137
assertThat(hash.getSha1()).isEqualTo(HashGeneratorUtils.generateSHA1(randomBytes));
137-
// md5 and sha256 are kept in local artifact db and should not be provided by "load"
138-
// assertThat(hash.getMd5()).isEqualTo(HashGeneratorUtils.generateMD5(randomBytes));
139-
// assertThat(hash.getSha256()).isEqualTo(HashGeneratorUtils.generateSHA256(randomBytes));
140138

141139
assertThat(artifactRepository.findAll()).hasSize(4);
142140
assertThat(softwareModuleRepository.findAll()).hasSize(3);

0 commit comments

Comments
 (0)