FossologyFileHandler { protected static boolean isVisible(FossologyStatus statusInFossology) { return statusInFossology != null && FossologyStatus.INACCESSIBLE.compareTo(statusInFossology) < 0; } @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 testIsVisible() throws Exception { assertThat(FossologyFileHandler.isVisible(null), is(false)); for (FossologyStatus fossologyStatus : FossologyStatus.values()) { final boolean expectedVisible; switch (fossologyStatus) { case CONNECTION_FAILED: case ERROR: case NON_EXISTENT: case NOT_SENT: case INACCESSIBLE: expectedVisible = false; break; case SENT: case SCANNING: case OPEN: case IN_PROGRESS: case CLOSED: case REJECTED: case REPORT_AVAILABLE: default: expectedVisible = true; break; } String errorMessage = "" + fossologyStatus + " should" + (expectedVisible ? "" : " not") + " be visible"; assertThat(errorMessage, FossologyFileHandler.isVisible(fossologyStatus), is(expectedVisible)); } }