SSLUtils { public static HostnameVerifier getHostnameVerifier(ClientConfig config) { if (config.isDisableSSLValidation()) { return new NoopHostnameVerifier(); } if (config.getOverrideHostnameVerifier() == null) { return new DefaultHostnameVerifier(); } else { return config.getOverrideHostnameVerifier(); } }  static boolean isSSL(String urlString); static SSLContext getSSLContext(ClientConfig config); static HostnameVerifier getHostnameVerifier(ClientConfig config);  }
@Test public void testGetHostnameVerifier() { HostnameVerifier verifier = SSLUtils.getHostnameVerifier(config); assertTrue(verifier instanceof DefaultHostnameVerifier); config.setOverrideHostnameVerifier(new TestHostnameVerifier()); verifier = SSLUtils.getHostnameVerifier(config); assertTrue(verifier instanceof TestHostnameVerifier); config.setDisableSSLValidation(true); verifier = SSLUtils.getHostnameVerifier(config); assertTrue(verifier instanceof NoopHostnameVerifier); }