Search in sources :

Example 6 with ServiceInstanceBindingDoesNotExistException

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

the class ServiceInstanceBindingControllerResponseCodeTest method getServiceBindingWithMissingBindingGivesExpectedStatus.

@Test
void getServiceBindingWithMissingBindingGivesExpectedStatus() {
    given(bindingService.getServiceInstanceBinding(any(GetServiceInstanceBindingRequest.class))).willThrow(new ServiceInstanceBindingDoesNotExistException("binding-id"));
    ResponseEntity<GetServiceInstanceBindingResponse> responseEntity = controller.getServiceInstanceBinding(pathVariables, null, null, null, null, null, null, null).block();
    assertThat(responseEntity).isNotNull();
    assertThat(responseEntity.getStatusCode()).isEqualTo(HttpStatus.NOT_FOUND);
}
Also used : ServiceInstanceBindingDoesNotExistException(org.springframework.cloud.servicebroker.exception.ServiceInstanceBindingDoesNotExistException) GetServiceInstanceBindingRequest(org.springframework.cloud.servicebroker.model.binding.GetServiceInstanceBindingRequest) GetServiceInstanceBindingResponse(org.springframework.cloud.servicebroker.model.binding.GetServiceInstanceBindingResponse) Test(org.junit.jupiter.api.Test)

Aggregations

ServiceInstanceBindingDoesNotExistException (org.springframework.cloud.servicebroker.exception.ServiceInstanceBindingDoesNotExistException)6 Test (org.junit.jupiter.api.Test)5 DeleteServiceInstanceBindingRequest (org.springframework.cloud.servicebroker.model.binding.DeleteServiceInstanceBindingRequest)4 AbstractServiceInstanceBindingControllerIntegrationTest (org.springframework.cloud.servicebroker.autoconfigure.web.AbstractServiceInstanceBindingControllerIntegrationTest)2 DeleteServiceInstanceBindingResponse (org.springframework.cloud.servicebroker.model.binding.DeleteServiceInstanceBindingResponse)1 GetServiceInstanceBindingRequest (org.springframework.cloud.servicebroker.model.binding.GetServiceInstanceBindingRequest)1 GetServiceInstanceBindingResponse (org.springframework.cloud.servicebroker.model.binding.GetServiceInstanceBindingResponse)1 ErrorMessage (org.springframework.cloud.servicebroker.model.error.ErrorMessage)1 ResponseEntity (org.springframework.http.ResponseEntity)1 MvcResult (org.springframework.test.web.servlet.MvcResult)1 DeleteMapping (org.springframework.web.bind.annotation.DeleteMapping)1