@Test public void testExportToPNG() { final String expectedImage = "image"; doNothing().when(tested).clearSelection(any()); when(canvasExport.toImageData(any(), any())).thenReturn(expectedImage); final String actualImage = tested.exportToPng(canvasHandler); verify(tested).clearSelection(canvasHandler); assertEquals(expectedImage, actualImage); }
public String exportToPng(final AbstractCanvasHandler canvasHandler) { final CanvasURLExportSettings settings = CanvasURLExportSettings.build(CanvasExport.URLDataType.PNG); clearSelection(canvasHandler); return canvasExport.toImageData(canvasHandler, settings); }
CanvasFileExport { public String exportToPng(final AbstractCanvasHandler canvasHandler) { final CanvasURLExportSettings settings = CanvasURLExportSettings.build(CanvasExport.URLDataType.PNG); clearSelection(canvasHandler); return canvasExport.toImageData(canvasHandler, settings); } }
CanvasFileExport { public String exportToPng(final AbstractCanvasHandler canvasHandler) { final CanvasURLExportSettings settings = CanvasURLExportSettings.build(CanvasExport.URLDataType.PNG); clearSelection(canvasHandler); return canvasExport.toImageData(canvasHandler, settings); } 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); }
CanvasFileExport { public String exportToPng(final AbstractCanvasHandler canvasHandler) { final CanvasURLExportSettings settings = CanvasURLExportSettings.build(CanvasExport.URLDataType.PNG); clearSelection(canvasHandler); return canvasExport.toImageData(canvasHandler, settings); } 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); }
CanvasFileExport { public String exportToPng(final AbstractCanvasHandler canvasHandler) { final CanvasURLExportSettings settings = CanvasURLExportSettings.build(CanvasExport.URLDataType.PNG); clearSelection(canvasHandler); return canvasExport.toImageData(canvasHandler, settings); } 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);  }