PropertiesLoader { public String parseValue(String value) { String encValue = unwrapEncryptedValue(value); if (encValue == null) { return value; } else { return crypto.decrypt(encValue); } } PropertiesLoader(CryptoService cryptoService);  PropertiesLoader(); Map<String, String> loadFromList(List<String> lines); Map<String, String> loadFromFile(String path); static String unwrapEncryptedValue(String encValue); String parseValue(String value); static String[] splitKeyVal(String line);  }
@Test public void parseEncryptedValueTest() throws Exception { String decPwd = fakeLoader.parseValue(wrapEncryptedValue(ENCRYPTED_PASSWORD)); assertEquals(DB_PASSWORD, decPwd); }
@Test public void parseNonEncryptedValueTest() throws Exception { String decPwd = fakeLoader.parseValue(DB_PASSWORD); assertEquals(DB_PASSWORD, decPwd); }