### Question:
CanvasFileExport { public void exportToJpg(final AbstractCanvasHandler canvasHandler, final String fileName) { clearSelection(canvasHandler); exportImage(canvasHandler, CanvasExport.URLDataType.JPG, fileName); } 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 testExportToJpg() { when(canvasExport.toImageData(eq(canvasHandler), any(CanvasURLExportSettings.class))).thenReturn(JPG_DATA_URI); tested.exportToJpg(canvasHandler, "file1"); final ArgumentCaptor<ImageDataUriContent> contentArgumentCaptor = ArgumentCaptor.forClass(ImageDataUriContent.class); verify(imageFileExport, times(1)).export(contentArgumentCaptor.capture(), eq("file1.jpg")); verify(pdfFileExport, never()).export(any(PdfDocument.class), anyString()); final ImageDataUriContent imageDataUriContent = contentArgumentCaptor.getValue(); assertEquals(JPG_DATA_URI, imageDataUriContent.getUri()); verify(clearSelectionEvent).fire(any(CanvasClearSelectionEvent.class)); }