Search in sources :

Example 1 with DeleteServiceInstanceBindingResponse

use of org.springframework.cloud.servicebroker.model.binding.DeleteServiceInstanceBindingResponse in project spring-cloud-open-service-broker by spring-cloud.

the class ServiceInstanceBindingControllerResponseCodeTest method deleteServiceBindingWithMissingBindingGivesExpectedStatus.

@Test
void deleteServiceBindingWithMissingBindingGivesExpectedStatus() {
    given(bindingService.deleteServiceInstanceBinding(any(DeleteServiceInstanceBindingRequest.class))).willThrow(new ServiceInstanceBindingDoesNotExistException("binding-id"));
    ResponseEntity<DeleteServiceInstanceBindingResponse> responseEntity = controller.deleteServiceInstanceBinding(pathVariables, null, null, "service-definition-id", "service-definition-plan-id", false, null, null, null).block();
    assertThat(responseEntity).isNotNull();
    assertThat(responseEntity.getStatusCode()).isEqualTo(HttpStatus.GONE);
}
Also used : ServiceInstanceBindingDoesNotExistException(org.springframework.cloud.servicebroker.exception.ServiceInstanceBindingDoesNotExistException) DeleteServiceInstanceBindingRequest(org.springframework.cloud.servicebroker.model.binding.DeleteServiceInstanceBindingRequest) DeleteServiceInstanceBindingResponse(org.springframework.cloud.servicebroker.model.binding.DeleteServiceInstanceBindingResponse) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)1 ServiceInstanceBindingDoesNotExistException (org.springframework.cloud.servicebroker.exception.ServiceInstanceBindingDoesNotExistException)1 DeleteServiceInstanceBindingRequest (org.springframework.cloud.servicebroker.model.binding.DeleteServiceInstanceBindingRequest)1 DeleteServiceInstanceBindingResponse (org.springframework.cloud.servicebroker.model.binding.DeleteServiceInstanceBindingResponse)1