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