@Test public void encryptAndSave_doesNotBreakLayout() throws Exception { Path tempFile = Files.createTempFile("dataprep-PropertiesEncryptionTest.", ".properties"); try (InputStream refInStream = getClass().getResourceAsStream("keep-layout-test-in.properties")) { Files.copy(refInStream, tempFile, StandardCopyOption.REPLACE_EXISTING); } new PropertiesEncryption().encryptAndSave(tempFile.toString(), Sets.newHashSet("admin.password")); assertEquals(Resources.toString(getClass().getResource("keep-layout-test-expected.properties"), Charsets.UTF_8), com.google.common.io.Files.toString(tempFile.toFile(), Charsets.UTF_8)); }
public void encryptAndSave(String input, Set<String> mustBeEncrypted) { modifyAndSave(input, mustBeEncrypted, this::encryptIfNot); }
PropertiesEncryption { public void encryptAndSave(String input, Set<String> mustBeEncrypted) { modifyAndSave(input, mustBeEncrypted, this::encryptIfNot); } }
PropertiesEncryption { public void encryptAndSave(String input, Set<String> mustBeEncrypted) { modifyAndSave(input, mustBeEncrypted, this::encryptIfNot); }  }
PropertiesEncryption { public void encryptAndSave(String input, Set<String> mustBeEncrypted) { modifyAndSave(input, mustBeEncrypted, this::encryptIfNot); }  void encryptAndSave(String input, Set<String> mustBeEncrypted); void decryptAndSave(String input, Set<String> mustBeDecrypted); }
PropertiesEncryption { public void encryptAndSave(String input, Set<String> mustBeEncrypted) { modifyAndSave(input, mustBeEncrypted, this::encryptIfNot); }  void encryptAndSave(String input, Set<String> mustBeEncrypted); void decryptAndSave(String input, Set<String> mustBeDecrypted);  }