@Test public void testMultipleInputOneDoesntContainRange() throws IOException { setUpRotateMultipleInputNotRangesContained(); testContext.directoryOutputTo(parameters); execute(parameters); testContext.assertTaskCompleted(); testContext.assertOutputSize(2); }
@Test public void testVersionPrefixAndCreatorAreApplied() throws IOException { setUpParametersWithVersionPrefixAndCompressionSpecified(); testContext.directoryOutputTo(parameters); execute(parameters); testContext.assertTaskCompleted(); testContext.assertCreator().assertPages(4).assertVersion(PdfVersion.VERSION_1_6); }
@Test public void testRotateSpecificPages() throws IOException { setUpRotateSpecificPages(); testContext.directoryOutputTo(parameters); execute(parameters); testContext.assertTaskCompleted(); testContext.assertCreator().assertPages(4).forEachPdfOutput(d -> assertEquals(90, d.getPage(2).getRotation())); }
@Test public void testExecuteEncrypted() throws IOException { setUpParametersEncrypted(); testContext.directoryOutputTo(parameters); execute(parameters); testContext.assertTaskCompleted(); testContext.assertCreator().assertPages(4) .forEachPdfOutput(d -> d.getPages().forEach(p -> assertEquals(180, p.getRotation()))); }
@Test public void testExecute() throws IOException { setUpDefaultParameters(); testContext.directoryOutputTo(parameters); execute(parameters); testContext.assertTaskCompleted(); testContext.assertCreator().assertPages(4) .forEachPdfOutput(d -> d.getPages().forEach(p -> assertEquals(180, p.getRotation()))); }
@Test public void testDifferentRotations() throws IOException { parameters = new RotateParameters(); parameters.addPageRange(new PageRange(1, 2), Rotation.DEGREES_90); parameters.addPageRange(new PageRange(3, 4), Rotation.DEGREES_180); parameters.addSource(shortInput()); parameters.setExistingOutputPolicy(ExistingOutputPolicy.OVERWRITE); testContext.directoryOutputTo(parameters); execute(parameters); testContext.assertTaskCompleted(); testContext.assertCreator().assertPages(4).forEachPdfOutput(d -> { assertEquals(90, d.getPage(0).getRotation()); assertEquals(90, d.getPage(1).getRotation()); assertEquals(180, d.getPage(2).getRotation()); assertEquals(180, d.getPage(3).getRotation()); }); } }