@Test @SuppressWarnings("unchecked") public void testSaveAsXml() { final String xml = "xml"; final String comment = "comment"; final Metadata metadata = mock(Metadata.class); final ServiceCallback<String> callback = mock(ServiceCallback.class); tested.saveAsXml(path, xml, metadata, comment, callback); verify(diagramService, times(1)).saveAsXml(eq(path), eq(xml), eq(metadata), eq(comment)); verify(callback, times(1)).onSuccess(anyString()); verify(callback, times(0)).onError(any(ClientRuntimeError.class)); }
public void saveAsXml(final Path path, final String xml, final Metadata metadata, final String comment, final ServiceCallback<String> callback) { diagramServiceCaller.call(v -> callback.onSuccess(xml), (message, throwable) -> { callback.onError(new ClientRuntimeError(throwable)); return false; }).saveAsXml(path, xml, metadata, comment); }
ClientProjectDiagramService extends ClientDiagramServiceImpl<ProjectMetadata, ProjectDiagram, ProjectDiagramService> { public void saveAsXml(final Path path, final String xml, final Metadata metadata, final String comment, final ServiceCallback<String> callback) { diagramServiceCaller.call(v -> callback.onSuccess(xml), (message, throwable) -> { callback.onError(new ClientRuntimeError(throwable)); return false; }).saveAsXml(path, xml, metadata, comment); } }
ClientProjectDiagramService extends ClientDiagramServiceImpl<ProjectMetadata, ProjectDiagram, ProjectDiagramService> { public void saveAsXml(final Path path, final String xml, final Metadata metadata, final String comment, final ServiceCallback<String> callback) { diagramServiceCaller.call(v -> callback.onSuccess(xml), (message, throwable) -> { callback.onError(new ClientRuntimeError(throwable)); return false; }).saveAsXml(path, xml, metadata, comment); } protected  ClientProjectDiagramService(); @Inject  ClientProjectDiagramService(final ShapeManager shapeManager,
                                       final SessionManager sessionManager,
                                       final Caller<ProjectDiagramService> diagramServiceCaller,
                                       final Caller<DiagramLookupService> diagramLookupServiceCaller,
                                       final Event<SessionDiagramSavedEvent> saveEvent); }
ClientProjectDiagramService extends ClientDiagramServiceImpl<ProjectMetadata, ProjectDiagram, ProjectDiagramService> { public void saveAsXml(final Path path, final String xml, final Metadata metadata, final String comment, final ServiceCallback<String> callback) { diagramServiceCaller.call(v -> callback.onSuccess(xml), (message, throwable) -> { callback.onError(new ClientRuntimeError(throwable)); return false; }).saveAsXml(path, xml, metadata, comment); } protected  ClientProjectDiagramService(); @Inject  ClientProjectDiagramService(final ShapeManager shapeManager,
                                       final SessionManager sessionManager,
                                       final Caller<ProjectDiagramService> diagramServiceCaller,
                                       final Caller<DiagramLookupService> diagramLookupServiceCaller,
                                       final Event<SessionDiagramSavedEvent> saveEvent); void create(final Path path,
                       final String name,
                       final String defSetId,
                       final String projectName,
                       final Package projectPkg,
                       final Optional<String> projectType,
                       final ServiceCallback<Path> callback); void saveOrUpdate(final Path path,
                             final ProjectDiagram diagram,
                             final Metadata metadata,
                             final String comment,
                             final ServiceCallback<ProjectDiagram> callback); void saveAsXml(final Path path,
                          final String xml,
                          final Metadata metadata,
                          final String comment,
                          final ServiceCallback<String> callback); }
ClientProjectDiagramService extends ClientDiagramServiceImpl<ProjectMetadata, ProjectDiagram, ProjectDiagramService> { public void saveAsXml(final Path path, final String xml, final Metadata metadata, final String comment, final ServiceCallback<String> callback) { diagramServiceCaller.call(v -> callback.onSuccess(xml), (message, throwable) -> { callback.onError(new ClientRuntimeError(throwable)); return false; }).saveAsXml(path, xml, metadata, comment); } protected  ClientProjectDiagramService(); @Inject  ClientProjectDiagramService(final ShapeManager shapeManager,
                                       final SessionManager sessionManager,
                                       final Caller<ProjectDiagramService> diagramServiceCaller,
                                       final Caller<DiagramLookupService> diagramLookupServiceCaller,
                                       final Event<SessionDiagramSavedEvent> saveEvent); void create(final Path path,
                       final String name,
                       final String defSetId,
                       final String projectName,
                       final Package projectPkg,
                       final Optional<String> projectType,
                       final ServiceCallback<Path> callback); void saveOrUpdate(final Path path,
                             final ProjectDiagram diagram,
                             final Metadata metadata,
                             final String comment,
                             final ServiceCallback<ProjectDiagram> callback); void saveAsXml(final Path path,
                          final String xml,
                          final Metadata metadata,
                          final String comment,
                          final ServiceCallback<String> callback);  }