ProxyCA { public void init() throws GeneralSecurityException, IOException { createCACertAndKeyPair(); initInternal(); } ProxyCA(); void init(); void init(X509Certificate caCert, PrivateKey caPrivateKey); byte[] createChildKeyStore(ApplicationId appId, String ksPassword); byte[] getChildTrustStore(String password); String generateKeyStorePassword(); SSLContext createSSLContext(ApplicationId appId); HostnameVerifier getHostnameVerifier(); @VisibleForTesting X509Certificate getCaCert(); @VisibleForTesting KeyPair getCaKeyPair();  }
@Test public void testInit() throws Exception { ProxyCA proxyCA = new ProxyCA(); Assert.assertNull(proxyCA.getCaCert()); Assert.assertNull(proxyCA.getCaKeyPair()); Assert.assertNull(proxyCA.getX509KeyManager()); Assert.assertNull(proxyCA.getHostnameVerifier()); proxyCA.init(); Assert.assertNotNull(proxyCA.getCaCert()); Assert.assertNotNull(proxyCA.getCaKeyPair()); Assert.assertNotNull(proxyCA.getX509KeyManager()); Assert.assertNotNull(proxyCA.getHostnameVerifier()); }