use of org.springframework.cloud.servicebroker.exception.ServiceDefinitionDoesNotExistException in project spring-cloud-open-service-broker by spring-cloud.
the class BaseControllerTest method serviceDefinitionDoesNotExistExceptionGivesExpectedStatus.
@Test
public void serviceDefinitionDoesNotExistExceptionGivesExpectedStatus() {
ServiceDefinitionDoesNotExistException exception = new ServiceDefinitionDoesNotExistException("service-definition-id");
ResponseEntity<ErrorMessage> responseEntity = controller.handleException(exception);
assertThat(responseEntity.getStatusCode()).isEqualTo(HttpStatus.UNPROCESSABLE_ENTITY);
assertThat(responseEntity.getBody().getError()).isNull();
assertThat(responseEntity.getBody().getMessage()).contains("id=service-definition-id");
}
use of org.springframework.cloud.servicebroker.exception.ServiceDefinitionDoesNotExistException in project spring-cloud-open-service-broker by spring-cloud.
the class ServiceBrokerExceptionHandlerTest method serviceDefinitionDoesNotExistException.
@Test
void serviceDefinitionDoesNotExistException() {
ServiceDefinitionDoesNotExistException exception = new ServiceDefinitionDoesNotExistException("service-definition-id");
ErrorMessage errorMessage = exceptionHandler.handleException(exception);
assertThat(errorMessage.getError()).isNull();
assertThat(errorMessage.getMessage()).contains("id=service-definition-id");
}
Aggregations