### Question:
CanvasFileExport { public void exportToPdf(final AbstractCanvasHandler canvasHandler, final String fileName) { clearSelection(canvasHandler); loadFileExportPreferences(prefs -> exportToPdf(canvasHandler, fileName, prefs.getPdfPreferences())); } protected  CanvasFileExport(); @Inject  CanvasFileExport(final CanvasExport<AbstractCanvasHandler> canvasExport,
                            final FileExport<ImageDataUriContent> imageFileExport,
                            final FileExport<PdfDocument> pdfFileExport,
                            final FileExportsPreferences preferences,
                            final SvgFileExport svgFileExport,
                            final Event<CanvasClearSelectionEvent> clearSelectionEvent); void exportToSvg(final AbstractCanvasHandler canvasHandler,
                            final String fileName); String exportToSvg(final AbstractCanvasHandler canvasHandler); String exportToPng(final AbstractCanvasHandler canvasHandler); void exportToJpg(final AbstractCanvasHandler canvasHandler,
                            final String fileName); void exportToPng(final AbstractCanvasHandler canvasHandler,
                            final String fileName); void exportToPdf(final AbstractCanvasHandler canvasHandler,
                            final String fileName);  }### Answer:
@Test public void testExportToPdf() { when(canvasExport.toImageData(eq(canvasHandler), any(CanvasURLExportSettings.class))).thenReturn(JPG_DATA_URI); verify(imageFileExport, never()).export(any(ImageDataUriContent.class), anyString()); tested.exportToPdf(canvasHandler, "file1"); verify(pdfFileExport, times(1)).export(any(PdfDocument.class), eq("file1.pdf")); verify(clearSelectionEvent).fire(any(CanvasClearSelectionEvent.class)); }