VulnerabilityUtils { public static VulnerabilityUpdateStatus getEmptyVulnerabilityUpdateStatus(RequestStatus requestStatus){ Map<UpdateType, List<String>> updateTypeToExternalID = new HashMap<>(); for(UpdateType updateType: UpdateType.values()){ updateTypeToExternalID.put(updateType, new ArrayList<>()); } return new VulnerabilityUpdateStatus() .setRequestStatus(requestStatus) .setStatusToVulnerabilityIds(updateTypeToExternalID); }  static VulnerabilityUpdateStatus getEmptyVulnerabilityUpdateStatus(RequestStatus requestStatus); static VulnerabilityUpdateStatus getEmptyVulnerabilityUpdateStatus(); static VulnerabilityUpdateStatus reduceVulnerabilityUpdateStatus(VulnerabilityUpdateStatus ... statuses); static VulnerabilityUpdateStatus getUpdateStatusFromUpdateMap(Map<UpdateType, List<Vulnerability>> statusToVulnerabilities); static List<String> successIdsFromUpdateMap(Map<UpdateType, List<Vulnerability>> updateMap);  }
@Test public void testGetEmptyVulnerabilityUpdateStatus() throws Exception { assertThat(getEmptyVulnerabilityUpdateStatus().requestStatus, is(RequestStatus.SUCCESS)); assertThat(getEmptyVulnerabilityUpdateStatus().statusToVulnerabilityIds.get(UpdateType.FAILED), is(Collections.EMPTY_LIST)); assertThat(getEmptyVulnerabilityUpdateStatus().statusToVulnerabilityIds.get(UpdateType.NEW), is(Collections.EMPTY_LIST)); assertThat(getEmptyVulnerabilityUpdateStatus().statusToVulnerabilityIds.get(UpdateType.UPDATED), is(Collections.EMPTY_LIST)); assertThat(getEmptyVulnerabilityUpdateStatus().statusToVulnerabilityIds.get(UpdateType.OLD), is(Collections.EMPTY_LIST)); }
@Test public void testGetEmptyVulnerabilityUpdateStatusWithRequestStatus() throws Exception { assertThat(getEmptyVulnerabilityUpdateStatus(RequestStatus.FAILURE).requestStatus, is(RequestStatus.FAILURE)); }