### Question:
AppDeploymentInstanceWorkflow { protected Mono<List<BackingApplication>> getBackingApplicationsForService(ServiceDefinition serviceDefinition, Plan plan) { return findBrokeredService(serviceDefinition, plan) .flatMap(brokeredService -> Mono.justOrEmpty(brokeredService.getApps())) .map(backingApplications -> BackingApplications.builder() .backingApplications(backingApplications) .build()); } protected  AppDeploymentInstanceWorkflow(BrokeredServices brokeredServices);   }### Answer:
@Test void getBackingAppForServiceSucceeds() { ServiceDefinition serviceDefinition = buildServiceDefinition("service1", "plan1"); StepVerifier .create(workflow .getBackingApplicationsForService(serviceDefinition, serviceDefinition.getPlans().get(0))) .assertNext(actual -> assertThat(actual) .isEqualTo(backingApps) .isNotSameAs(backingApps)) .verifyComplete(); }
@Test void getBackingAppForServiceWithUnknownServiceIdDoesNothing() { ServiceDefinition serviceDefinition = buildServiceDefinition("unknown-service", "plan1"); StepVerifier .create(workflow .getBackingApplicationsForService(serviceDefinition, serviceDefinition.getPlans().get(0))) .verifyComplete(); }
@Test void getBackingAppForServiceWithUnknownPlanIdDoesNothing() { ServiceDefinition serviceDefinition = buildServiceDefinition("service1", "unknown-plan"); StepVerifier .create(workflow .getBackingApplicationsForService(serviceDefinition, serviceDefinition.getPlans().get(0))) .verifyComplete(); }