use of org.springframework.cloud.servicebroker.exception.ServiceBrokerCreateOperationInProgressException in project spring-cloud-open-service-broker by spring-cloud.
the class ServiceInstanceControllerIntegrationTest method createServiceInstanceWithAsyncAndHeadersOperationInProgress.
@Test
void createServiceInstanceWithAsyncAndHeadersOperationInProgress() throws Exception {
setupCatalogService();
setupServiceInstanceService(new ServiceBrokerCreateOperationInProgressException("task_10"));
client.put().uri(buildCreateUpdateUrl(PLATFORM_INSTANCE_ID, true)).contentType(MediaType.APPLICATION_JSON).bodyValue(createRequestBody).header(API_INFO_LOCATION_HEADER, API_INFO_LOCATION).header(ORIGINATING_IDENTITY_HEADER, buildOriginatingIdentityHeader()).accept(MediaType.APPLICATION_JSON).exchange().expectStatus().isAccepted().expectBody().jsonPath("$.operation").isEqualTo("task_10");
CreateServiceInstanceRequest actualRequest = verifyCreateServiceInstance();
assertThat(actualRequest.isAsyncAccepted()).isEqualTo(true);
assertHeaderValuesSet(actualRequest);
}
use of org.springframework.cloud.servicebroker.exception.ServiceBrokerCreateOperationInProgressException in project spring-cloud-open-service-broker by spring-cloud.
the class ServiceInstanceControllerIntegrationTest method createServiceInstanceWithAsyncAndHeadersOperationInProgress.
@Test
void createServiceInstanceWithAsyncAndHeadersOperationInProgress() throws Exception {
setupCatalogService();
setupServiceInstanceService(new ServiceBrokerCreateOperationInProgressException("task_10"));
MvcResult mvcResult = mockMvc.perform(put(buildCreateUpdateUrl(PLATFORM_INSTANCE_ID, true)).content(createRequestBody).contentType(MediaType.APPLICATION_JSON).header(API_INFO_LOCATION_HEADER, API_INFO_LOCATION).header(ORIGINATING_IDENTITY_HEADER, buildOriginatingIdentityHeader()).accept(MediaType.APPLICATION_JSON)).andExpect(request().asyncStarted()).andExpect(status().isOk()).andReturn();
mockMvc.perform(asyncDispatch(mvcResult)).andExpect(status().isAccepted()).andExpect(jsonPath("$.operation", is("task_10")));
CreateServiceInstanceRequest actualRequest = verifyCreateServiceInstance();
assertThat(actualRequest.isAsyncAccepted()).isEqualTo(true);
assertHeaderValuesSet(actualRequest);
}
use of org.springframework.cloud.servicebroker.exception.ServiceBrokerCreateOperationInProgressException in project spring-cloud-open-service-broker by spring-cloud.
the class ServiceInstanceBindingControllerIntegrationTest method createBindingToAppWithAsyncAndHeadersOperationInProgress.
@Test
void createBindingToAppWithAsyncAndHeadersOperationInProgress() throws Exception {
setupCatalogService();
setupServiceInstanceBindingService(new ServiceBrokerCreateOperationInProgressException("task_10"));
MvcResult mvcResult = mockMvc.perform(put(buildCreateUrl(PLATFORM_INSTANCE_ID, true)).content(createRequestBody).header(API_INFO_LOCATION_HEADER, API_INFO_LOCATION).header(ORIGINATING_IDENTITY_HEADER, buildOriginatingIdentityHeader()).accept(MediaType.APPLICATION_JSON).contentType(MediaType.APPLICATION_JSON)).andExpect(request().asyncStarted()).andExpect(status().isOk()).andReturn();
mockMvc.perform(asyncDispatch(mvcResult)).andExpect(status().isAccepted()).andExpect(jsonPath("$.operation", is("task_10")));
verifyCreateBinding();
}
use of org.springframework.cloud.servicebroker.exception.ServiceBrokerCreateOperationInProgressException in project spring-cloud-open-service-broker by spring-cloud.
the class ServiceInstanceBindingControllerIntegrationTest method createBindingToAppWithAsyncAndHeadersOperationInProgress.
@Test
void createBindingToAppWithAsyncAndHeadersOperationInProgress() throws Exception {
setupCatalogService();
setupServiceInstanceBindingService(new ServiceBrokerCreateOperationInProgressException("task_10"));
client.put().uri(buildCreateUrl(PLATFORM_INSTANCE_ID, true)).contentType(MediaType.APPLICATION_JSON).bodyValue(createRequestBody).header(API_INFO_LOCATION_HEADER, API_INFO_LOCATION).header(ORIGINATING_IDENTITY_HEADER, buildOriginatingIdentityHeader()).accept(MediaType.APPLICATION_JSON).exchange().expectStatus().isAccepted().expectBody().jsonPath("$.operation").isEqualTo("task_10");
verifyCreateBinding();
}
Aggregations