### Question:
CloudFoundryAppDeployer implements AppDeployer, ResourceLoaderAware { @Override public Mono<CreateServiceInstanceResponse> createServiceInstance(CreateServiceInstanceRequest request) { org.cloudfoundry.operations.services.CreateServiceInstanceRequest createServiceInstanceRequest = org.cloudfoundry.operations.services.CreateServiceInstanceRequest .builder() .serviceInstanceName(request.getServiceInstanceName()) .serviceName(request.getName()) .planName(request.getPlan()) .parameters(request.getParameters()) .completionTimeout(apiPollingTimeout(request.getProperties())) .build(); Mono<CreateServiceInstanceResponse> createServiceInstanceResponseMono = Mono.just(CreateServiceInstanceResponse.builder() .name(request.getServiceInstanceName()) .build()); if (request.getProperties().containsKey(DeploymentProperties.TARGET_PROPERTY_KEY)) { return createSpace(request.getProperties().get(DeploymentProperties.TARGET_PROPERTY_KEY)) .then( operationsUtils.getOperations(request.getProperties()) .flatMap(cfOperations -> cfOperations.services() .createInstance(createServiceInstanceRequest) .then(createServiceInstanceResponseMono))); } else { return operations .services() .createInstance(createServiceInstanceRequest) .then(createServiceInstanceResponseMono); } } CloudFoundryAppDeployer(CloudFoundryDeploymentProperties deploymentProperties,
		CloudFoundryOperations operations,
		CloudFoundryClient client,
		CloudFoundryOperationsUtils operationsUtils,
		CloudFoundryTargetProperties targetProperties,
		ResourceLoader resourceLoader); @Override void setResourceLoader(ResourceLoader resourceLoader); @Override Mono<GetApplicationResponse> get(GetApplicationRequest request); @Override Mono<DeployApplicationResponse> deploy(DeployApplicationRequest request); @Override Mono<UpdateApplicationResponse> update(UpdateApplicationRequest request); @Override Mono<UndeployApplicationResponse> undeploy(UndeployApplicationRequest request); @Override Mono<GetServiceInstanceResponse> getServiceInstance(GetServiceInstanceRequest request); @Override Mono<CreateServiceInstanceResponse> createServiceInstance(CreateServiceInstanceRequest request); @Override Mono<UpdateServiceInstanceResponse> updateServiceInstance(UpdateServiceInstanceRequest request); @Override Mono<DeleteServiceInstanceResponse> deleteServiceInstance(DeleteServiceInstanceRequest request);  }### Answer:
@Test void createServiceInstance() { given(operationsServices.createInstance( org.cloudfoundry.operations.services.CreateServiceInstanceRequest.builder() .serviceInstanceName("service-instance-name") .serviceName("db-service") .planName("standard") .completionTimeout(Duration.ofSeconds(100)) .parameters(emptyMap()) .build())) .willReturn(Mono.empty()); Map<String, String> userProvidedTimeoutForBrokeredApp = singletonMap(CloudFoundryDeploymentProperties.API_POLLING_TIMEOUT_PROPERTY_KEY, "100"); CreateServiceInstanceRequest request = CreateServiceInstanceRequest.builder() .serviceInstanceName("service-instance-name") .name("db-service") .plan("standard") .properties(userProvidedTimeoutForBrokeredApp) .parameters(emptyMap()) .build(); StepVerifier.create( appDeployer.createServiceInstance(request)) .assertNext(response -> assertThat(response.getName()).isEqualTo("service-instance-name")) .verifyComplete(); }