use of teetime.stage.CipherStage in project TeeTime by teetime-framework.
the class CipherTest method executeTestWithConfigurationCreatedByBuilder.
@Test
public void executeTestWithConfigurationCreatedByBuilder() throws IOException {
final Configuration configuration = ConfigurationBuilder.from(new InitialElementProducer<File>(new File(INPUT_FILE))).to(new File2ByteArray()).to(new CipherStage(PASSWORD, CipherMode.ENCRYPT)).to(new ZipByteArray(ZipMode.COMP)).to(new ZipByteArray(ZipMode.DECOMP)).to(new CipherStage(PASSWORD, CipherMode.DECRYPT)).end(new ByteArrayFileWriter(new File(OUTPUT_FILE)));
final Execution<Configuration> execution = new Execution<Configuration>(configuration);
execution.executeBlocking();
Assert.assertTrue(Files.equal(new File(INPUT_FILE), new File(OUTPUT_FILE)));
}
Aggregations