Skip to content

Commit

Permalink
Addressing PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
avimanyum committed Mar 10, 2022
1 parent b91477f commit 9ea7bc8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ protected Optional<List<PagedSearchIterable<GHContent>>> getSearchResultsExcludi
Optional<List<PagedSearchIterable<GHContent>>> contentsForOrgWithMaximumHits;
contentsForOrgWithMaximumHits = findFilesWithImage(image, orgsToInclude, gitApiSearchLimit);

final Map<String, Boolean> orgsToExcludeFromSearch = new HashMap(orgsToExclude);
final Map<String, Boolean> orgsToExcludeFromSearch = new HashMap<>(orgsToExclude);
orgsToExcludeFromSearch.put(orgWithMaximumHits, false);
log.info("Running search by excluding the orgs {}.", orgsToExcludeFromSearch.keySet());
Optional<List<PagedSearchIterable<GHContent>>> contentsExcludingOrgWithMaximumHits;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ public void getSearchResultsExcludingOrgWithMostHits() throws Exception {
Map<String, Boolean> orgsToIncludeOrExclude = new HashMap<>();

assertEquals((dockerfileGitHubUtil.getSearchResultsExcludingOrgWithMostHits("image", contentsWithImage, orgsToIncludeOrExclude, 1000)).get().size(), 2);
//This check ensures that the parameter passed to the method is not modified. Instead, the method creates a local copy of the map and modifies that.
assertEquals(orgsToIncludeOrExclude.size(), 0);
}

Expand Down

0 comments on commit 9ea7bc8

Please sign in to comment.