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