Search in sources :

Example 6 with InvalidFileTypeException

use of gov.cms.qpp.conversion.api.exceptions.InvalidFileTypeException in project qpp-conversion-tool by CMSgov.

the class ExceptionHandlerControllerV1Test method testInvalidFileTypeExceptionStatusCode.

@Test
void testInvalidFileTypeExceptionStatusCode() {
    InvalidFileTypeException exception = new InvalidFileTypeException(CpcFileServiceImpl.FILE_NOT_FOUND);
    ResponseEntity<String> responseEntity = objectUnderTest.handleInvalidFileTypeException(exception);
    assertWithMessage("The response entity's status code must be 422.").that(responseEntity.getStatusCode()).isEquivalentAccordingToCompareTo(HttpStatus.NOT_FOUND);
}
Also used : InvalidFileTypeException(gov.cms.qpp.conversion.api.exceptions.InvalidFileTypeException) Test(org.junit.jupiter.api.Test)

Example 7 with InvalidFileTypeException

use of gov.cms.qpp.conversion.api.exceptions.InvalidFileTypeException in project qpp-conversion-tool by CMSgov.

the class ExceptionHandlerControllerV1Test method testInvalidFileTypeExceptionBody.

@Test
void testInvalidFileTypeExceptionBody() {
    InvalidFileTypeException exception = new InvalidFileTypeException(CpcFileServiceImpl.FILE_NOT_FOUND);
    ResponseEntity<String> responseEntity = objectUnderTest.handleInvalidFileTypeException(exception);
    assertThat(responseEntity.getBody()).isEqualTo(CpcFileServiceImpl.FILE_NOT_FOUND);
}
Also used : InvalidFileTypeException(gov.cms.qpp.conversion.api.exceptions.InvalidFileTypeException) Test(org.junit.jupiter.api.Test)

Aggregations

InvalidFileTypeException (gov.cms.qpp.conversion.api.exceptions.InvalidFileTypeException)7 Test (org.junit.jupiter.api.Test)5 NoFileInDatabaseException (gov.cms.qpp.conversion.api.exceptions.NoFileInDatabaseException)2 Metadata (gov.cms.qpp.conversion.api.model.Metadata)2 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)2