use of org.springframework.cloud.servicebroker.model.error.ErrorMessage in project spring-cloud-open-service-broker by spring-cloud.
the class ServiceBrokerExceptionHandlerTest method serviceInstanceDoesNotExistException.
@Test
void serviceInstanceDoesNotExistException() {
ServiceInstanceDoesNotExistException exception = new ServiceInstanceDoesNotExistException("service-instance-id");
ErrorMessage errorMessage = exceptionHandler.handleException(exception);
assertThat(errorMessage.getError()).isNull();
assertThat(errorMessage.getMessage()).contains("id=service-instance-id");
}
use of org.springframework.cloud.servicebroker.model.error.ErrorMessage in project spring-cloud-open-service-broker by spring-cloud.
the class ServiceBrokerExceptionHandlerTest method serviceDefinitionPlanDoesNotExistException.
@Test
void serviceDefinitionPlanDoesNotExistException() {
ServiceDefinitionPlanDoesNotExistException exception = new ServiceDefinitionPlanDoesNotExistException("service-definition-plan-id");
ErrorMessage errorMessage = exceptionHandler.handleException(exception);
assertThat(errorMessage.getError()).isNull();
assertThat(errorMessage.getMessage()).contains("Service Definition Plan does not exist: " + "id=service-definition-plan-id");
}
use of org.springframework.cloud.servicebroker.model.error.ErrorMessage 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");
}
use of org.springframework.cloud.servicebroker.model.error.ErrorMessage in project spring-cloud-open-service-broker by spring-cloud.
the class ServiceBrokerExceptionHandlerTest method bindingExistsException.
@Test
void bindingExistsException() {
ErrorMessage errorMessage = exceptionHandler.handleException(new ServiceInstanceBindingExistsException("service-instance-id", "binding-id"));
assertThat(errorMessage.getError()).isNull();
assertThat(errorMessage.getMessage()).contains("serviceInstanceId=service-instance-id").contains("bindingId=binding-id");
}
use of org.springframework.cloud.servicebroker.model.error.ErrorMessage in project spring-cloud-open-service-broker by spring-cloud.
the class ServiceBrokerWebFluxExceptionHandlerTest method stringParameterIsNotPresent.
@Test
void stringParameterIsNotPresent() throws NoSuchMethodException {
Method method = this.getClass().getMethod("setUp", (Class<?>[]) null);
MethodParameter parameter = new MethodParameter(method, -1);
ServerWebInputException exception = new ServerWebInputException("reason", parameter);
ErrorMessage errorMessage = exceptionHandler.handleException(exception);
assertThat(errorMessage.getError()).isNull();
assertThat(errorMessage.getMessage()).contains("reason");
}
Aggregations