ServiceInstanceBindingEventService implements ServiceInstanceBindingService { @Override public Mono<DeleteServiceInstanceBindingResponse> deleteServiceInstanceBinding( DeleteServiceInstanceBindingRequest request) { return flows.getDeleteInstanceBindingRegistry().getInitializationFlows(request) .then(service.deleteServiceInstanceBinding(request)) .onErrorResume(e -> flows.getDeleteInstanceBindingRegistry().getErrorFlows(request, e) .then(Mono.error(e))) .flatMap(response -> flows.getDeleteInstanceBindingRegistry().getCompletionFlows(request, response) .then(Mono.just(response))); } ServiceInstanceBindingEventService(ServiceInstanceBindingService service, EventFlowRegistries flows); @Override Mono<CreateServiceInstanceBindingResponse> createServiceInstanceBinding(
			CreateServiceInstanceBindingRequest request); @Override Mono<GetServiceInstanceBindingResponse> getServiceInstanceBinding(GetServiceInstanceBindingRequest request); @Override Mono<GetLastServiceBindingOperationResponse> getLastOperation(
			GetLastServiceBindingOperationRequest request); @Override Mono<DeleteServiceInstanceBindingResponse> deleteServiceInstanceBinding(
			DeleteServiceInstanceBindingRequest request);  }
@Test void deleteServiceInstanceBindingSucceeds() { prepareBindingFlows(); StepVerifier .create(serviceInstanceBindingEventService.deleteServiceInstanceBinding( DeleteServiceInstanceBindingRequest.builder() .serviceInstanceId("service-instance-id") .bindingId("service-binding-id") .build())) .expectNext(DeleteServiceInstanceBindingResponse.builder().build()) .verifyComplete(); assertThat(this.results.getBeforeCreate()).isNullOrEmpty(); assertThat(this.results.getAfterCreate()).isNullOrEmpty(); assertThat(this.results.getErrorCreate()).isNullOrEmpty(); assertThat(this.results.getBeforeDelete()).isEqualTo("before delete service-instance-id"); assertThat(this.results.getAfterDelete()).isEqualTo("after delete service-instance-id"); assertThat(this.results.getErrorDelete()).isNullOrEmpty(); }
@Test void deleteServiceInstanceBindingFails() { prepareBindingFlows(); StepVerifier .create(serviceInstanceBindingEventService.deleteServiceInstanceBinding( DeleteServiceInstanceBindingRequest.builder() .serviceInstanceId("service-instance-id") .build())) .expectError() .verify(); assertThat(this.results.getBeforeCreate()).isNullOrEmpty(); assertThat(this.results.getAfterCreate()).isNullOrEmpty(); assertThat(this.results.getErrorCreate()).isNullOrEmpty(); assertThat(this.results.getBeforeDelete()).isEqualTo("before delete service-instance-id"); assertThat(this.results.getAfterDelete()).isNullOrEmpty(); assertThat(this.results.getErrorDelete()).isEqualTo("error delete service-instance-id"); }