BuiltInEncryptor implements Encryptor { @Override public void encrypt(String key, File decryptedFile, File encryptedFile) { initCiphers(key); try { CipherInputStream cis = new CipherInputStream(new FileInputStream(decryptedFile), encryptCipher); write(cis, new FileOutputStream(encryptedFile)); } catch (Exception e) { e.printStackTrace(); } }  @Override void encrypt(String key, File decryptedFile, File encryptedFile); @Override void decrypt(String key, File encryptedFile, File decryptedFile);  }
@Test public void _02_When_Encrypt_Then_Original_Content_Does_Not_Match() { fileIn = getFile(FILENAME_IN, "A Dummy Content 2"); fileEncrypted = getFile(FILENAME_ENCRYPTED); encryptor.encrypt("key2", fileIn, fileEncrypted); assertNotEquals(getFileContent(fileIn), getFileContent(fileEncrypted)); }