Search in sources :

Example 21 with CreateServiceInstanceBindingRequest

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

the class ServiceInstanceBindingControllerRequestTest method createServiceBindingWithInvalidServiceDefinitionIdThrowsException.

@Test
void createServiceBindingWithInvalidServiceDefinitionIdThrowsException() {
    CreateServiceInstanceBindingRequest createRequest = CreateServiceInstanceBindingRequest.builder().serviceDefinitionId("unknown-service-definition-id").build();
    ServiceInstanceBindingController controller = createControllerUnderTest();
    assertThrows(ServiceDefinitionDoesNotExistException.class, () -> controller.createServiceInstanceBinding(pathVariables, null, null, false, null, null, null, createRequest).block());
}
Also used : CreateServiceInstanceBindingRequest(org.springframework.cloud.servicebroker.model.binding.CreateServiceInstanceBindingRequest) Test(org.junit.jupiter.api.Test)

Aggregations

CreateServiceInstanceBindingRequest (org.springframework.cloud.servicebroker.model.binding.CreateServiceInstanceBindingRequest)21 Test (org.junit.jupiter.api.Test)16 AbstractServiceInstanceBindingControllerIntegrationTest (org.springframework.cloud.servicebroker.autoconfigure.web.AbstractServiceInstanceBindingControllerIntegrationTest)15 MvcResult (org.springframework.test.web.servlet.MvcResult)6 Test (org.junit.Test)2 CreateServiceInstanceBindingResponse (org.springframework.cloud.servicebroker.model.binding.CreateServiceInstanceBindingResponse)2 Theory (org.junit.experimental.theories.Theory)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1