use of org.springframework.cloud.servicebroker.model.instance.CreateServiceInstanceRequest in project spring-cloud-open-service-broker by spring-cloud.
the class ServiceInstanceControllerRequestTest method createServiceInstanceWithInvalidPlanIdThrowsException.
@Test
void createServiceInstanceWithInvalidPlanIdThrowsException() {
CreateServiceInstanceRequest createRequest = CreateServiceInstanceRequest.builder().serviceDefinitionId("service-definition-id").planId("unknown-plan-id").build();
ServiceInstanceController controller = createControllerUnderTest();
assertThrows(ServiceDefinitionPlanDoesNotExistException.class, () -> controller.createServiceInstance(pathVariables, null, false, null, null, null, createRequest).block());
}
use of org.springframework.cloud.servicebroker.model.instance.CreateServiceInstanceRequest in project spring-cloud-open-service-broker by spring-cloud.
the class ServiceInstanceControllerRequestTest method createServiceInstanceParametersAreMappedToRequest.
@Test
void createServiceInstanceParametersAreMappedToRequest() {
CreateServiceInstanceRequest parsedRequest = buildCreateRequest().build();
CreateServiceInstanceRequest expectedRequest = buildCreateRequest().asyncAccepted(true).serviceInstanceId("service-instance-id").platformInstanceId("platform-instance-id").apiInfoLocation("api-info-location").originatingIdentity(identityContext).requestIdentity("request-id").serviceDefinition(serviceDefinition).plan(plan).build();
ServiceInstanceController controller = createControllerUnderTest(expectedRequest);
controller.createServiceInstance(pathVariables, "service-instance-id", true, "api-info-location", encodeOriginatingIdentity(identityContext), "request-id", parsedRequest).block();
}
Aggregations