### Question:
DefaultBackingAppDeploymentService implements BackingAppDeploymentService { @Override public Flux<String> deploy(List<BackingApplication> backingApps, String serviceInstanceId) { return Flux.fromIterable(backingApps) .parallel() .runOn(Schedulers.parallel()) .flatMap(backingApplication -> deployerClient.deploy(backingApplication, serviceInstanceId)) .sequential() .doOnRequest(l -> { LOG.info("Deploying applications"); LOG.debug(BACKINGAPPS_LOG_TEMPLATE, backingApps); }) .doOnComplete(() -> { LOG.info("Finish deploying applications"); LOG.debug(BACKINGAPPS_LOG_TEMPLATE, backingApps); }) .doOnError(e -> { LOG.error(String.format("Error deploying applications. error=%s", e.getMessage()), e); LOG.debug(BACKINGAPPS_LOG_TEMPLATE, backingApps); }); } DefaultBackingAppDeploymentService(DeployerClient deployerClient); @Override Flux<String> deploy(List<BackingApplication> backingApps, String serviceInstanceId); @Override Flux<String> update(List<BackingApplication> backingApps, String serviceInstanceId); @Override Flux<String> undeploy(List<BackingApplication> backingApps);  }### Answer:
@Test @SuppressWarnings("UnassignedFluxMonoInstance") void shouldDeployApplications() { doReturn(Mono.just("app1")) .when(deployerClient).deploy(backingApps.get(0), "instance-id"); doReturn(Mono.just("app2")) .when(deployerClient).deploy(backingApps.get(1), "instance-id"); List<String> expectedValues = new ArrayList<>(); expectedValues.add("app1"); expectedValues.add("app2"); StepVerifier.create(backingAppDeploymentService.deploy(backingApps, "instance-id")) .expectNextMatches(expectedValues::remove) .expectNextMatches(expectedValues::remove) .verifyComplete(); }