use of org.springframework.cloud.servicebroker.model.error.ErrorMessage 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");
}
use of org.springframework.cloud.servicebroker.model.error.ErrorMessage in project spring-cloud-open-service-broker by spring-cloud.
the class ServiceBrokerExceptionHandlerTest method appRequiredException.
@Test
void appRequiredException() {
ErrorMessage errorMessage = exceptionHandler.handleException(new ServiceBrokerBindingRequiresAppException("app GUID is required"));
assertThat(errorMessage.getError()).isEqualTo(APP_REQUIRED_ERROR);
assertThat(errorMessage.getMessage()).contains("app GUID is required");
}
use of org.springframework.cloud.servicebroker.model.error.ErrorMessage in project spring-cloud-open-service-broker by spring-cloud.
the class ServiceBrokerExceptionHandlerTest method serviceBrokerInvalidOriginatingIdentityException.
@Test
void serviceBrokerInvalidOriginatingIdentityException() {
ServiceBrokerInvalidOriginatingIdentityException exception = new ServiceBrokerInvalidOriginatingIdentityException("test message");
ErrorMessage errorMessage = exceptionHandler.handleException(exception);
assertThat(errorMessage.getError()).isNull();
assertThat(errorMessage.getMessage()).contains("test message");
}
use of org.springframework.cloud.servicebroker.model.error.ErrorMessage in project spring-cloud-open-service-broker by spring-cloud.
the class ServiceBrokerExceptionHandlerTest method serviceBrokerException.
@Test
void serviceBrokerException() {
ServiceBrokerException exception = new ServiceBrokerException("test message");
ErrorMessage errorMessage = exceptionHandler.handleException(exception);
assertThat(errorMessage.getError()).isNull();
assertThat(errorMessage.getMessage()).contains("test message");
}
use of org.springframework.cloud.servicebroker.model.error.ErrorMessage in project spring-cloud-open-service-broker by spring-cloud.
the class ServiceBrokerExceptionHandlerTest method bindingDoesNotExistException.
@Test
void bindingDoesNotExistException() {
ErrorMessage errorMessage = exceptionHandler.handleException(new ServiceInstanceBindingDoesNotExistException("binding-id"));
assertThat(errorMessage.getError()).isNull();
assertThat(errorMessage.getMessage()).contains("id=binding-id");
}
Aggregations