### Question:
Providers { public boolean isZosmfAvailable() { return !this.discoveryClient.getInstances(authConfigurationProperties.validatedZosmfServiceId()).isEmpty(); }  boolean isZosmfAvailable(); boolean isZosfmUsed();  }### Answer:
@Test void givenZosmfIsKnownByDiscovery_whenAvailabilityIsRequested_thenReturnTrue() { when(discovery.getInstances(ZOSMF_ID)).thenReturn( Collections.singletonList(mock(ServiceInstance.class)) ); when(authConfigurationProperties.validatedZosmfServiceId()).thenReturn(ZOSMF_ID); assertThat(underTest.isZosmfAvailable(), is(true)); }
@Test void givenZosmfIsUnknownByDiscovery_whenAvailabilityIsRequested_thenReturnFalse() { when(discovery.getInstances(ZOSMF_ID)).thenReturn(Collections.emptyList()); assertThat(underTest.isZosmfAvailable(), is(false)); }