use of org.springframework.cloud.servicebroker.exception.ServiceBrokerBindingRequiresAppException in project spring-cloud-open-service-broker by spring-cloud.
the class ServiceInstanceBindingControllerResponseCodeTest method appRequiredExistsGivesExpectedStatus.
@Test
public void appRequiredExistsGivesExpectedStatus() {
ResponseEntity<ErrorMessage> responseEntity = controller.handleException(new ServiceBrokerBindingRequiresAppException("app GUID is required"));
assertThat(responseEntity.getStatusCode()).isEqualTo(HttpStatus.UNPROCESSABLE_ENTITY);
assertThat(responseEntity.getBody().getError()).isEqualTo(APP_REQUIRED_ERROR);
assertThat(responseEntity.getBody().getMessage()).contains("app GUID is required");
}
use of org.springframework.cloud.servicebroker.exception.ServiceBrokerBindingRequiresAppException 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");
}
Aggregations