TrustManagerProxy extends X509ExtendedTrustManager { @Override public X509Certificate[] getAcceptedIssuers() { return trustManager.getAcceptedIssuers(); } TrustManagerProxy(TrustManager[] trustManagers); void setTrustManager(final TrustManager[] trustManagers); @Override void checkClientTrusted(X509Certificate[] x509Certificates, String s); @Override void checkServerTrusted(X509Certificate[] x509Certificates, String s); @Override X509Certificate[] getAcceptedIssuers(); @Override void checkClientTrusted(X509Certificate[] chain, String authType, Socket socket); @Override void checkClientTrusted(X509Certificate[] chain, String authType, SSLEngine engine); @Override void checkServerTrusted(X509Certificate[] chain, String authType, Socket socket); @Override void checkServerTrusted(X509Certificate[] chain, String authType, SSLEngine engine);  }
@Test public void testTrustManagerProxyGetAcceptedIssuers(@Mocked X509ExtendedTrustManager mockedTrustManager) { new Expectations() {{ mockedTrustManager.getAcceptedIssuers(); times = 1; result = null; }}; TrustManagerProxy trustManagerProxy = new TrustManagerProxy(new TrustManager[]{mockedTrustManager}); assertNull(trustManagerProxy.getAcceptedIssuers()); }