@Test
public void testSSLInitFailure() throws Exception {

  Configuration conf = new Configuration();
  conf.set(SSLFactory.SSL_HOSTNAME_VERIFIER_KEY, "foo");
  GenericTestUtils.LogCapturer logs =
      GenericTestUtils.LogCapturer.captureLogs(
          LoggerFactory.getLogger(URLConnectionFactory.class));
  URLConnectionFactory.newDefaultURLConnectionFactory(conf);
  Assert.assertTrue("Expected log for ssl init failure not found!",
      logs.getOutput().contains(
      "Cannot load customized ssl related configuration"));
}