@Test
public void shouldNotEncryptCommentedProperties() throws Exception {

    // given
    String commentedLines = "# admin.password = administrator password";
    Path tempFile = Files.createTempFile("dataprep-PropertiesEncryptionTest.", ".properties");
    try (BufferedWriter bufferedWriter = Files.newBufferedWriter(tempFile, Charsets.UTF_8)) {
        bufferedWriter.write("# file.password = the file password");
        bufferedWriter.newLine();
        bufferedWriter.write("file = /tmp");
        bufferedWriter.newLine();
    }
    // when
    new PropertiesEncryption().encryptAndSave(tempFile.toString(), Sets.newHashSet("file.password"));
    // then
    try (BufferedReader reader = Files.newBufferedReader(tempFile)) {
        String line = reader.readLine();
        assertEquals("# file.password = the file password", line);
        line = reader.readLine();
        assertEquals("file = /tmp", line);
    }
}