KeystoreFactory { @SneakyThrows public KeyStore createEmptyKeystore() { KeyStore keyStore = KeyStore.getInstance("JKS"); keyStore.load(null, "".toCharArray()); return keyStore; } KeystoreFactory();  KeystoreFactory(ResourceLoader resourceLoader); @SneakyThrows KeyStore loadKeystore(String certResourceLocation, String privateKeyResourceLocation, String alias, String keyPassword); @SneakyThrows void addKeyToKeystore(KeyStore keyStore, X509Certificate cert, RSAPrivateKey privateKey, String alias, String password); @SneakyThrows KeyStore createEmptyKeystore(); @SneakyThrows X509Certificate loadCert(String certLocation); @SneakyThrows RSAPrivateKey loadPrivateKey(String privateKeyLocation); void setResourceLoader(DefaultResourceLoader resourceLoader);  }
@Test public void createEmptyKeystore() throws Exception { KeystoreFactory keystoreFactory = new KeystoreFactory(new DefaultResourceLoader()); KeyStore keyStore = keystoreFactory.createEmptyKeystore(); assertThat(keyStore.size()).isEqualTo(0); }