static boolean isEndpointAvailable(String url) {
        return !RestClient.create(url, 1)
                .withRequestTimeoutSeconds(1)
                .withRetries(1)
                .withHeader("Metadata", "True")
                .get()
                .getBody()
                .isEmpty();
    }
@Test
    public void isEndpointAvailable() {
        // given
        String endpoint = "/some-endpoint";
        String url = String.format("http://localhost:%d%s", wireMockRule.port(), endpoint);
        stubFor(get(urlEqualTo(endpoint)).willReturn(aResponse().withStatus(HttpURLConnection.HTTP_OK).withBody("some-body")));

        // when
        boolean isAvailable = AzureDiscoveryStrategyFactory.isEndpointAvailable(url);

        // then
        assertTrue(isAvailable);
    }