@Test public void decryptTest() throws SecretDecryptionException { String secretConfig = "encrypted:s3!paramName:paramValue"; when(secretEngine.decrypt(any())).thenReturn("test".getBytes()); assertEquals("test", secretManager.decrypt(secretConfig)); }
public String decrypt(String configValue) { if (EncryptedSecret.isEncryptedSecret(configValue)) { return new String(decryptAsBytes(configValue)); } return configValue; }
SecretManager { public String decrypt(String configValue) { if (EncryptedSecret.isEncryptedSecret(configValue)) { return new String(decryptAsBytes(configValue)); } return configValue; } }
SecretManager { public String decrypt(String configValue) { if (EncryptedSecret.isEncryptedSecret(configValue)) { return new String(decryptAsBytes(configValue)); } return configValue; } @Autowired  SecretManager(SecretEngineRegistry secretEngineRegistry); }
SecretManager { public String decrypt(String configValue) { if (EncryptedSecret.isEncryptedSecret(configValue)) { return new String(decryptAsBytes(configValue)); } return configValue; } @Autowired  SecretManager(SecretEngineRegistry secretEngineRegistry); String decrypt(String configValue); Path decryptAsFile(String filePathOrEncrypted); byte[] decryptAsBytes(String encryptedString); }
SecretManager { public String decrypt(String configValue) { if (EncryptedSecret.isEncryptedSecret(configValue)) { return new String(decryptAsBytes(configValue)); } return configValue; } @Autowired  SecretManager(SecretEngineRegistry secretEngineRegistry); String decrypt(String configValue); Path decryptAsFile(String filePathOrEncrypted); byte[] decryptAsBytes(String encryptedString);  }