@Test public void testLookupWithoutMasterKeyStore() { DecryptFunction decryptFunction = new DecryptFunction(); decryptFunction.initialize(Coffig.builder().build()); Assertions.assertThat(decryptFunction).isNotNull(); }
@Override public void initialize(Coffig coffig) { try { initInProgress.set(true); coffig.getOptional(CryptoConfig.KeyStoreConfig.class, "crypto.keystores.master").ifPresent(cfg -> { try { KeyStore keyStore = new KeyStoreLoader().load(CryptoConfig.MASTER_KEY_STORE_NAME, cfg); encryptionServiceFactory = new EncryptionServiceFactory(keyStore); masterKeyStoreConfig = cfg; } catch (Exception e) { storedException = e; } }); } finally { initInProgress.set(false); } }
DecryptFunction implements ConfigFunctionHolder { @Override public void initialize(Coffig coffig) { try { initInProgress.set(true); coffig.getOptional(CryptoConfig.KeyStoreConfig.class, "crypto.keystores.master").ifPresent(cfg -> { try { KeyStore keyStore = new KeyStoreLoader().load(CryptoConfig.MASTER_KEY_STORE_NAME, cfg); encryptionServiceFactory = new EncryptionServiceFactory(keyStore); masterKeyStoreConfig = cfg; } catch (Exception e) { storedException = e; } }); } finally { initInProgress.set(false); } } }
DecryptFunction implements ConfigFunctionHolder { @Override public void initialize(Coffig coffig) { try { initInProgress.set(true); coffig.getOptional(CryptoConfig.KeyStoreConfig.class, "crypto.keystores.master").ifPresent(cfg -> { try { KeyStore keyStore = new KeyStoreLoader().load(CryptoConfig.MASTER_KEY_STORE_NAME, cfg); encryptionServiceFactory = new EncryptionServiceFactory(keyStore); masterKeyStoreConfig = cfg; } catch (Exception e) { storedException = e; } }); } finally { initInProgress.set(false); } }  }
DecryptFunction implements ConfigFunctionHolder { @Override public void initialize(Coffig coffig) { try { initInProgress.set(true); coffig.getOptional(CryptoConfig.KeyStoreConfig.class, "crypto.keystores.master").ifPresent(cfg -> { try { KeyStore keyStore = new KeyStoreLoader().load(CryptoConfig.MASTER_KEY_STORE_NAME, cfg); encryptionServiceFactory = new EncryptionServiceFactory(keyStore); masterKeyStoreConfig = cfg; } catch (Exception e) { storedException = e; } }); } finally { initInProgress.set(false); } }  @Override void initialize(Coffig coffig); @Override ConfigurationComponent fork(); }
DecryptFunction implements ConfigFunctionHolder { @Override public void initialize(Coffig coffig) { try { initInProgress.set(true); coffig.getOptional(CryptoConfig.KeyStoreConfig.class, "crypto.keystores.master").ifPresent(cfg -> { try { KeyStore keyStore = new KeyStoreLoader().load(CryptoConfig.MASTER_KEY_STORE_NAME, cfg); encryptionServiceFactory = new EncryptionServiceFactory(keyStore); masterKeyStoreConfig = cfg; } catch (Exception e) { storedException = e; } }); } finally { initInProgress.set(false); } }  @Override void initialize(Coffig coffig); @Override ConfigurationComponent fork();  }