@Test public void createTitleBlockForDocumentIterationTest() throws Exception { DocumentTitleBlockData documentTitleData = new DocumentTitleBlockData(documentIteration, new Locale("en")); byte[] titleBlock = new TitleBlockWriter(documentTitleData).createTitleBlock(); PDDocument loadedDocument = PDDocument.load(titleBlock); Assert.assertNotNull(loadedDocument); String text = new PDFTextStripper().getText(loadedDocument); loadedDocument.close(); Assert.assertFalse(text.isEmpty()); Assert.assertTrue(text.contains(user.getLogin())); Assert.assertTrue(text.contains(documentIteration.getId())); Assert.assertTrue(text.contains(documentIteration.getDocumentRevision().getDescription())); }
public byte[] createTitleBlock() throws IOException { writeEntityInfo(); writeAttributes(); writeLifeCycleState(); return documentToByteArray(document); }
TitleBlockWriter { public byte[] createTitleBlock() throws IOException { writeEntityInfo(); writeAttributes(); writeLifeCycleState(); return documentToByteArray(document); } }
TitleBlockWriter { public byte[] createTitleBlock() throws IOException { writeEntityInfo(); writeAttributes(); writeLifeCycleState(); return documentToByteArray(document); } TitleBlockWriter();  TitleBlockWriter(TitleBlockData pData); }
TitleBlockWriter { public byte[] createTitleBlock() throws IOException { writeEntityInfo(); writeAttributes(); writeLifeCycleState(); return documentToByteArray(document); } TitleBlockWriter();  TitleBlockWriter(TitleBlockData pData); byte[] createTitleBlock(); }
TitleBlockWriter { public byte[] createTitleBlock() throws IOException { writeEntityInfo(); writeAttributes(); writeLifeCycleState(); return documentToByteArray(document); } TitleBlockWriter();  TitleBlockWriter(TitleBlockData pData); byte[] createTitleBlock();  }