Skip to content

Commit 4abc14d

Browse files
committed
chore: Fix sonarqube violations
1 parent fdb83c2 commit 4abc14d

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/main/java/com/endava/cats/report/ClusterCompute.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ private static List<CatsTestCaseSummary> filterNon2xxTestCases(List<CatsTestCase
5353
StringUtils.isNotBlank(tc.getResultReason()) &&
5454
(tc.getError() || tc.getWarning())
5555
)
56-
.collect(Collectors.toList());
56+
.toList();
5757
}
5858

5959
/**
@@ -78,7 +78,7 @@ private static List<Map<String, Object>> createClusterResultList(
7878

7979
return groupedByReason.entrySet().stream()
8080
.map(entry -> createResultMapForReason(entry.getKey(), entry.getValue()))
81-
.collect(Collectors.toList());
81+
.toList();
8282
}
8383

8484
/**
@@ -198,7 +198,7 @@ private static List<Map<String, Object>> createPathList(List<CatsTestCaseSummary
198198
pathMap.put("testCases", entry.getValue().toString());
199199
return pathMap;
200200
})
201-
.collect(Collectors.toList());
201+
.toList();
202202
}
203203

204204
/**

src/main/java/com/endava/cats/report/ErrorSimilarityDetector.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ public class ErrorSimilarityDetector {
1212
private static final double JACCARD_THRESHOLD = 0.7;
1313
private static final double PATTERN_MATCH_BONUS = 0.2;
1414

15+
private ErrorSimilarityDetector() {
16+
// Prevent instantiation
17+
}
18+
1519
/**
1620
* Compares two error messages and returns true if they are similar enough.
1721
*

src/test/java/com/endava/cats/report/ClusterComputeTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ void testCreateClustersWithWarningsCases() {
4444
List<Map<String, Object>> clusters = ClusterCompute.createClusters(testCases);
4545

4646
assertThat(clusters).hasSize(1);
47-
assertThat(clusters.getFirst().get("resultReason")).isEqualTo("Bad Request");
47+
assertThat(clusters.getFirst()).containsEntry("resultReason", "Bad Request");
4848
}
4949

5050
@Test

0 commit comments

Comments
 (0)