### Question:
CloudFoundryDiscoveryClient implements DiscoveryClient { @Override public List<String> getServices() { return this.cloudFoundryOperations.applications().list().map(ApplicationSummary::getName).collectList() .blockOptional().orElse(new ArrayList<>()); } CloudFoundryDiscoveryClient(CloudFoundryOperations cloudFoundryOperations, CloudFoundryService svc,
			CloudFoundryDiscoveryProperties properties); @Override String description(); @Override List<ServiceInstance> getInstances(String serviceId); @Override List<String> getServices(); @Override int getOrder();  }### Answer:
@Test public void testServiceResolution() { Applications apps = mock(Applications.class); ApplicationSummary s = ApplicationSummary.builder().id(UUID.randomUUID().toString()).instances(2) .memoryLimit(1024).requestedState("requestedState").diskQuota(1024).name(this.hiServiceServiceId) .runningInstances(2).build(); Mockito.when(apps.list()).thenReturn(Flux.just(s)); Mockito.when(this.ops.applications()).thenReturn(apps); List<String> serviceNames = this.cloudFoundryDiscoveryClient.getServices(); assertThat(serviceNames.contains(this.hiServiceServiceId)).as("there should be one registered service.") .isTrue(); serviceNames.forEach(serviceName -> this.log.debug("\t discovered serviceName: " + serviceName)); }