ValidationRequestUtils { static FileType getValidationServiceType(UploadedFile validationRequest) throws IOException { if (isXroadAsiceContainer(validationRequest)) { return FileType.XROAD; } return null; } private  ValidationRequestUtils();   }
@Test public void givenAsiceValidationRequestWillReturnNull() throws Exception { UploadedFile request = createXroadValidationRequest( Base64.encodeBase64String("random text".getBytes()), "random.asice" ); assertThat(ValidationRequestUtils.getValidationServiceType(request)).isEqualTo(null); }
@Test public void givenXroadContainerWillReturnFileTypeXROAD() throws Exception { UploadedFile request = createXroadValidationRequest( loadBase64EncodedFile("/xroad-container.asice"), "xroad.asice" ); assertThat(ValidationRequestUtils.getValidationServiceType(request)).isEqualTo(FileType.XROAD); }