@Test @SuppressWarnings("unchecked") public void testExportSuccessful() { command.execute(callback); verify(clientDiagramService, times(1)).getRawContent(eq(diagram), callbackCaptor.capture()); callbackCaptor.getValue().onSuccess(FILE_RAW_CONTENT); verify(textFileExport, times(1)).export(textContentCaptor.capture(), eq(FILE_NAME)); assertEquals(FILE_RAW_CONTENT, textContentCaptor.getValue().getText()); }
@SuppressWarnings("unchecked") @Override protected void export(final String fileName) { clientDiagramService.getRawContent(getSession().getCanvasHandler().getDiagram(), new ServiceCallback<String>() { @Override public void onSuccess(String rawContent) { textFileExport.export(TextContent.create(rawContent), fileName); } @Override public void onError(ClientRuntimeError error) { errorPopupPresenter.showMessage(error.getMessage()); } }); }
ExportToRawFormatSessionCommand extends AbstractExportSessionCommand { @SuppressWarnings("unchecked") @Override protected void export(final String fileName) { clientDiagramService.getRawContent(getSession().getCanvasHandler().getDiagram(), new ServiceCallback<String>() { @Override public void onSuccess(String rawContent) { textFileExport.export(TextContent.create(rawContent), fileName); } @Override public void onError(ClientRuntimeError error) { errorPopupPresenter.showMessage(error.getMessage()); } }); } }
ExportToRawFormatSessionCommand extends AbstractExportSessionCommand { @SuppressWarnings("unchecked") @Override protected void export(final String fileName) { clientDiagramService.getRawContent(getSession().getCanvasHandler().getDiagram(), new ServiceCallback<String>() { @Override public void onSuccess(String rawContent) { textFileExport.export(TextContent.create(rawContent), fileName); } @Override public void onError(ClientRuntimeError error) { errorPopupPresenter.showMessage(error.getMessage()); } }); } protected  ExportToRawFormatSessionCommand(); @Inject  ExportToRawFormatSessionCommand(final ClientDiagramService clientDiagramService,
                                           final ErrorPopupPresenter errorPopupPresenter,
                                           final TextFileExport textFileExport); }
ExportToRawFormatSessionCommand extends AbstractExportSessionCommand { @SuppressWarnings("unchecked") @Override protected void export(final String fileName) { clientDiagramService.getRawContent(getSession().getCanvasHandler().getDiagram(), new ServiceCallback<String>() { @Override public void onSuccess(String rawContent) { textFileExport.export(TextContent.create(rawContent), fileName); } @Override public void onError(ClientRuntimeError error) { errorPopupPresenter.showMessage(error.getMessage()); } }); } protected  ExportToRawFormatSessionCommand(); @Inject  ExportToRawFormatSessionCommand(final ClientDiagramService clientDiagramService,
                                           final ErrorPopupPresenter errorPopupPresenter,
                                           final TextFileExport textFileExport);  }
ExportToRawFormatSessionCommand extends AbstractExportSessionCommand { @SuppressWarnings("unchecked") @Override protected void export(final String fileName) { clientDiagramService.getRawContent(getSession().getCanvasHandler().getDiagram(), new ServiceCallback<String>() { @Override public void onSuccess(String rawContent) { textFileExport.export(TextContent.create(rawContent), fileName); } @Override public void onError(ClientRuntimeError error) { errorPopupPresenter.showMessage(error.getMessage()); } }); } protected  ExportToRawFormatSessionCommand(); @Inject  ExportToRawFormatSessionCommand(final ClientDiagramService clientDiagramService,
                                           final ErrorPopupPresenter errorPopupPresenter,
                                           final TextFileExport textFileExport);   }