Search in sources :

Example 1 with ServiceDefinitionPlanDoesNotExistException

use of org.springframework.cloud.servicebroker.exception.ServiceDefinitionPlanDoesNotExistException in project spring-cloud-open-service-broker by spring-cloud.

the class ServiceBrokerExceptionHandlerTest method serviceDefinitionPlanDoesNotExistExceptionWithCustomCode.

@Test
void serviceDefinitionPlanDoesNotExistExceptionWithCustomCode() {
    final String errorCode = "error";
    ServiceDefinitionPlanDoesNotExistException exception = new ServiceDefinitionPlanDoesNotExistException(errorCode, "service-definition-plan-id");
    ErrorMessage errorMessage = exceptionHandler.handleException(exception);
    assertThat(errorMessage.getError()).isEqualTo(errorCode);
    assertThat(errorMessage.getMessage()).contains("Service Definition Plan does not exist: " + "id=service-definition-plan-id");
}
Also used : ErrorMessage(org.springframework.cloud.servicebroker.model.error.ErrorMessage) ServiceDefinitionPlanDoesNotExistException(org.springframework.cloud.servicebroker.exception.ServiceDefinitionPlanDoesNotExistException) Test(org.junit.jupiter.api.Test)

Example 2 with ServiceDefinitionPlanDoesNotExistException

use of org.springframework.cloud.servicebroker.exception.ServiceDefinitionPlanDoesNotExistException 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");
}
Also used : ErrorMessage(org.springframework.cloud.servicebroker.model.error.ErrorMessage) ServiceDefinitionPlanDoesNotExistException(org.springframework.cloud.servicebroker.exception.ServiceDefinitionPlanDoesNotExistException) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)2 ServiceDefinitionPlanDoesNotExistException (org.springframework.cloud.servicebroker.exception.ServiceDefinitionPlanDoesNotExistException)2 ErrorMessage (org.springframework.cloud.servicebroker.model.error.ErrorMessage)2