PdfFileExport implements FileExport<PdfDocument> { @Override public void export(final PdfDocument content, final String fileName) { export(content, fileName, createNewDocument(content)); }  @Override void export(final PdfDocument content,
                       final String fileName);  }
@Test public void saveAsTextTest() { content.addText("test", 10, 20); tested.export(content, "file1", fileExport); verify(fileExport, times(1)).text(eq("test"), eq(10), eq(20)); verify(fileExport).save(eq("file1")); }
@Test public void saveAsImageTest() { final String dataUrl = "data:image/jpeg;base64,9j/4AAQSkZJRgABAQEASABIAAD"; content.addImage(dataUrl, "jpeg", 10, 20, 100, 200); tested.export(content, "file2", fileExport); verify(fileExport, times(1)).addImage(eq(dataUrl), eq("jpeg"), eq(10), eq(20), eq(100), eq(200)); verify(fileExport).save(eq("file2")); }