PropertiesLoader { public static String unwrapEncryptedValue(String encValue) { if (encValue == null) { return null; } String encryptedFormPrefix = "ENC("; if (encValue.startsWith(encryptedFormPrefix)) { return encValue.substring(encryptedFormPrefix.length(), encValue.length() - 1); } else { return null; } } 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 unwrapEncryptedValueTest() { String value = "XYZ"; String wrapped = wrapEncryptedValue(value); assertEquals(value, PropertiesLoader.unwrapEncryptedValue(wrapped)); }
@Test public void unwrapNonEncryptedValueShouldGiveNull() { assertNull(PropertiesLoader.unwrapEncryptedValue("XYZ")); }