use of io.crnk.core.engine.internal.exception.CrnkExceptionMapper in project crnk-framework by crnk-project.
the class CrnkExceptionMapperTest method internalServerError.
@Test
public void internalServerError() {
CrnkExceptionMapper mapper = new CrnkExceptionMapper();
ErrorResponse response = mapper.toErrorResponse(new InternalServerErrorException("testMessage"));
assertThat(response.getHttpStatus()).isEqualTo(HttpStatus.INTERNAL_SERVER_ERROR_500);
assertThat(mapper.accepts(response)).isTrue();
CrnkMappableException exception = mapper.fromErrorResponse(response);
assertThat(exception).isInstanceOf(InternalServerErrorException.class);
assertThat(exception.getMessage()).isEqualTo("testMessage");
}
Aggregations