IgnoreHostsTrustManager extends X509ExtendedTrustManager { @Override public X509Certificate[] getAcceptedIssuers() { return delegate.getAcceptedIssuers(); } IgnoreHostsTrustManager(X509ExtendedTrustManager delegate, Set<String> insecureHosts); @Override void checkServerTrusted(X509Certificate[] x509Certificates, String authType, Socket socket); @Override void checkServerTrusted(X509Certificate[] x509Certificates, String authType, SSLEngine sslEngine); @Override void checkServerTrusted(X509Certificate[] x509Certificates, String authType); @Override void checkClientTrusted(X509Certificate[] x509Certificates, String authType, Socket socket); @Override void checkClientTrusted(X509Certificate[] x509Certificates, String authType, SSLEngine sslEngine); @Override void checkClientTrusted(X509Certificate[] x509Certificates, String authType); @Override X509Certificate[] getAcceptedIssuers();  }
@Test void testGetAcceptedIssuers() { final MockTrustManager delegate = new MockTrustManager(); final IgnoreHostsTrustManager tm = new IgnoreHostsTrustManager(delegate, ImmutableSet.of()); assertThat(tm.getAcceptedIssuers()).isEqualTo(delegate.certificates); }