Search in sources :

Example 6 with ServiceDefinition

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

the class ServiceInstanceControllerResponseCodeTest method setUp.

@BeforeEach
void setUp() {
    controller = new ServiceInstanceController(catalogService, serviceInstanceService);
    ServiceDefinition serviceDefinition = mock(ServiceDefinition.class);
    List<Plan> plans = new ArrayList<>();
    plans.add(Plan.builder().id("service-definition-plan-id").build());
    given(serviceDefinition.getPlans()).willReturn(plans);
    given(serviceDefinition.getId()).willReturn("service-definition-id");
    given(catalogService.getServiceDefinition(any())).willReturn(Mono.just(serviceDefinition));
}
Also used : ArrayList(java.util.ArrayList) Plan(org.springframework.cloud.servicebroker.model.catalog.Plan) ServiceDefinition(org.springframework.cloud.servicebroker.model.catalog.ServiceDefinition) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

ServiceDefinition (org.springframework.cloud.servicebroker.model.catalog.ServiceDefinition)6 Plan (org.springframework.cloud.servicebroker.model.catalog.Plan)3 ResponseEntity (org.springframework.http.ResponseEntity)3 ArrayList (java.util.ArrayList)2 BeforeEach (org.junit.jupiter.api.BeforeEach)2 ServiceInstanceDoesNotExistException (org.springframework.cloud.servicebroker.exception.ServiceInstanceDoesNotExistException)1 CreateServiceInstanceResponse (org.springframework.cloud.servicebroker.model.instance.CreateServiceInstanceResponse)1 DeleteServiceInstanceRequest (org.springframework.cloud.servicebroker.model.instance.DeleteServiceInstanceRequest)1 DeleteServiceInstanceResponse (org.springframework.cloud.servicebroker.model.instance.DeleteServiceInstanceResponse)1 UpdateServiceInstanceResponse (org.springframework.cloud.servicebroker.model.instance.UpdateServiceInstanceResponse)1 Bean (org.springframework.context.annotation.Bean)1 DeleteMapping (org.springframework.web.bind.annotation.DeleteMapping)1 PatchMapping (org.springframework.web.bind.annotation.PatchMapping)1 PutMapping (org.springframework.web.bind.annotation.PutMapping)1