use of org.springframework.cloud.servicebroker.model.binding.CreateServiceInstanceBindingRequest in project spring-cloud-open-service-broker by spring-cloud.
the class ServiceInstanceBindingControllerIntegrationTest method createBindingToAppWithExistingSucceeds.
@Test
void createBindingToAppWithExistingSucceeds() {
setupCatalogService();
setupServiceInstanceBindingService(CreateServiceInstanceAppBindingResponse.builder().bindingExisted(true).build());
client.put().uri(buildCreateUrl()).contentType(MediaType.APPLICATION_JSON).bodyValue(createRequestBody).accept(MediaType.APPLICATION_JSON).exchange().expectStatus().isOk();
CreateServiceInstanceBindingRequest actualRequest = verifyCreateBinding();
assertHeaderValuesNotSet(actualRequest);
}
use of org.springframework.cloud.servicebroker.model.binding.CreateServiceInstanceBindingRequest in project spring-cloud-open-service-broker by spring-cloud.
the class ServiceInstanceBindingControllerIntegrationTest method createBindingToRouteFiltersPlansSucceeds.
@Test
void createBindingToRouteFiltersPlansSucceeds() {
setupCatalogService();
setupServiceInstanceBindingService(CreateServiceInstanceRouteBindingResponse.builder().bindingExisted(false).build());
client.put().uri(buildCreateUrl()).contentType(MediaType.APPLICATION_JSON).bodyValue(createRequestBody).accept(MediaType.APPLICATION_JSON).exchange().expectStatus().isCreated();
CreateServiceInstanceBindingRequest actualRequest = verifyCreateBinding();
assertThat(actualRequest.isAsyncAccepted()).isEqualTo(false);
assertThat(actualRequest.getPlan().getId()).isEqualTo(actualRequest.getPlanId());
assertHeaderValuesNotSet(actualRequest);
}
use of org.springframework.cloud.servicebroker.model.binding.CreateServiceInstanceBindingRequest in project spring-cloud-open-service-broker by spring-cloud.
the class ServiceInstanceBindingControllerIntegrationTest method createBindingToRouteWithoutAsyncAndHeadersSucceeds.
@Test
void createBindingToRouteWithoutAsyncAndHeadersSucceeds() {
setupCatalogService();
setupServiceInstanceBindingService(CreateServiceInstanceRouteBindingResponse.builder().bindingExisted(false).build());
client.put().uri(buildCreateUrl()).contentType(MediaType.APPLICATION_JSON).bodyValue(createRequestBody).accept(MediaType.APPLICATION_JSON).exchange().expectStatus().isCreated();
CreateServiceInstanceBindingRequest actualRequest = verifyCreateBinding();
assertThat(actualRequest.isAsyncAccepted()).isEqualTo(false);
assertHeaderValuesNotSet(actualRequest);
}
use of org.springframework.cloud.servicebroker.model.binding.CreateServiceInstanceBindingRequest in project spring-cloud-open-service-broker by spring-cloud.
the class ServiceInstanceBindingControllerIntegrationTest method createBindingToRouteWithAsyncAndHeadersSucceeds.
@Test
void createBindingToRouteWithAsyncAndHeadersSucceeds() {
setupCatalogService();
setupServiceInstanceBindingService(CreateServiceInstanceRouteBindingResponse.builder().async(true).operation("working").bindingExisted(false).build());
client.put().uri(buildCreateUrl(null, true)).contentType(MediaType.APPLICATION_JSON).bodyValue(createRequestBody).accept(MediaType.APPLICATION_JSON).exchange().expectStatus().isAccepted().expectBody().jsonPath("$.operation").isEqualTo("working");
CreateServiceInstanceBindingRequest actualRequest = verifyCreateBinding();
assertThat(actualRequest.isAsyncAccepted()).isEqualTo(true);
assertHeaderValuesNotSet(actualRequest);
}
use of org.springframework.cloud.servicebroker.model.binding.CreateServiceInstanceBindingRequest in project spring-cloud-open-service-broker by spring-cloud.
the class ServiceInstanceBindingControllerRequestTest method createServiceBindingParametersAreMappedToRequest.
@Test
void createServiceBindingParametersAreMappedToRequest() {
CreateServiceInstanceBindingRequest parsedRequest = buildCreateRequest().build();
CreateServiceInstanceBindingRequest expectedRequest = buildCreateRequest().asyncAccepted(true).serviceInstanceId("service-instance-id").bindingId("binding-id").serviceDefinition(serviceDefinition).plan(plan).platformInstanceId("platform-instance-id").apiInfoLocation("api-info-location").originatingIdentity(identityContext).requestIdentity("request-id").build();
ServiceInstanceBindingController controller = createControllerUnderTest(expectedRequest);
controller.createServiceInstanceBinding(pathVariables, "service-instance-id", "binding-id", true, "api-info-location", encodeOriginatingIdentity(identityContext), "request-id", parsedRequest);
}
Aggregations