@@ -37,14 +37,24 @@ protected Response<Finding> deserializeList(String response) throws JsonProcessi
3737 }
3838
3939 public List <Finding > getUnhandledFindingsForProduct (long productId , Finding .Severity minimumSeverity ) throws URISyntaxException , JsonProcessingException {
40- return this .search (Map .of ("test__engagement__product" , Long .toString (productId ), "active" , Boolean .toString (true ))).stream ().filter ((finding -> {
41- return finding .getSeverity ().getNumericRepresentation () >= minimumSeverity .getNumericRepresentation ();
42- })).collect (Collectors .toList ());
40+ final Map <String , Object > queryParams = Map .of (
41+ "test__engagement__product" , Long .toString (productId ),
42+ "active" , Boolean .toString (true ));
43+
44+ return this .search (queryParams )
45+ .stream ()
46+ .filter ((finding -> finding .getSeverity ().getNumericRepresentation () >= minimumSeverity .getNumericRepresentation ()))
47+ .toList ();
4348 }
4449
4550 public List <Finding > getUnhandledFindingsForEngagement (long engagementId , Finding .Severity minimumSeverity ) throws URISyntaxException , JsonProcessingException {
46- return this .search (Map .of ("test__engagement" , Long .toString (engagementId ), "active" , Boolean .toString (true ))).stream ().filter ((finding -> {
47- return finding .getSeverity ().getNumericRepresentation () >= minimumSeverity .getNumericRepresentation ();
48- })).collect (Collectors .toList ());
51+ final Map <String , Object > queryParams = Map .of (
52+ "test__engagement" , Long .toString (engagementId ),
53+ "active" , Boolean .toString (true ));
54+
55+ return this .search (queryParams )
56+ .stream ()
57+ .filter ((finding -> finding .getSeverity ().getNumericRepresentation () >= minimumSeverity .getNumericRepresentation ()))
58+ .toList ();
4959 }
5060}
0 commit comments