FossologyFileHandler { protected Iterable<? extends String> getAllClearingTeams(Release release, String clearingTeam) { Set<String> alreadyChecked = nullToEmptyMap(release.getClearingTeamToFossologyStatus()).keySet(); return union(alreadyChecked, singleton(clearingTeam)); } @Autowired  FossologyFileHandler(AttachmentConnector attachmentConnector, FossologyUploader fossologyUploader, ThriftClients thriftClients); RequestStatus sendToFossology(String releaseId, User user, String clearingTeam); Release getStatusInFossology(String releaseId, User user, String clearingTeam);  }
@Test public void testGetAllClearingTeams() throws Exception { Release release = mock(Release.class); String clearingTeam2 = "team2"; String clearingTeam3 = "yetAnotherTeam"; when(release.getClearingTeamToFossologyStatus()) .thenReturn(ImmutableMap.of( clearingTeam, FossologyStatus.CLOSED, clearingTeam2, FossologyStatus.ERROR )); assertThat(fossologyFileHandler.getAllClearingTeams(release, clearingTeam), containsInAnyOrder(clearingTeam, clearingTeam2)); assertThat(fossologyFileHandler.getAllClearingTeams(release, clearingTeam3), containsInAnyOrder(clearingTeam, clearingTeam2, clearingTeam3)); }