### Question:
HttpsFactory { public HostnameVerifier createHostnameVerifier() { if (config.isVerifySslCertificatesOfServices()) { return SSLConnectionSocketFactory.getDefaultHostnameVerifier(); } else { return new NoopHostnameVerifier(); } } HttpsFactory(HttpsConfig httpsConfig); CloseableHttpClient createSecureHttpClient(); ConnectionSocketFactory createSslSocketFactory(); SSLContext createSslContext(); void setSystemSslProperties(); HostnameVerifier createHostnameVerifier(); EurekaJerseyClientBuilder createEurekaJerseyClientBuilder(String eurekaServerUrl, String serviceId);  }### Answer:
@Test public void shouldCreateDefaultHostnameVerifier() { HttpsConfig httpsConfig = httpsConfigBuilder.build(); HttpsFactory httpsFactory = new HttpsFactory(httpsConfig); HostnameVerifier hostnameVerifier = httpsFactory.createHostnameVerifier(); assertEquals(DefaultHostnameVerifier.class, hostnameVerifier.getClass()); }
@Test public void shouldCreateNoopHostnameVerifier() { HttpsConfig httpsConfig = httpsConfigBuilder.verifySslCertificatesOfServices(false).build(); HttpsFactory httpsFactory = new HttpsFactory(httpsConfig); HostnameVerifier hostnameVerifier = httpsFactory.createHostnameVerifier(); assertEquals(NoopHostnameVerifier.class, hostnameVerifier.getClass()); }