@Test @SuppressWarnings("unchecked") public void testCreateWithProjectDetails() { final String name = "d1"; final String defSetId = "id1"; final String projName = "project-name"; final Package projPackage = mock(Package.class); final ServiceCallback<Path> callback = mock(ServiceCallback.class); final Optional<String> projectType = Optional.of("type"); tested.create(path, name, defSetId, projName, projPackage, projectType, callback); verify(diagramService, times(1)).create(eq(path), eq(name), eq(defSetId), eq(projName), eq(projPackage), eq(projectType)); verify(callback, times(1)).onSuccess(any(Path.class)); verify(callback, times(0)).onError(any(ClientRuntimeError.class)); }
public 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) { diagramServiceCaller.call((RemoteCallback<Path>) callback::onSuccess, (message, throwable) -> { callback.onError(createOnErrorHandler(throwable, name, projectPkg)); return false; }).create(path, name, defSetId, projectName, projectPkg, projectType); }
ClientProjectDiagramService extends ClientDiagramServiceImpl<ProjectMetadata, ProjectDiagram, ProjectDiagramService> { public 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) { diagramServiceCaller.call((RemoteCallback<Path>) callback::onSuccess, (message, throwable) -> { callback.onError(createOnErrorHandler(throwable, name, projectPkg)); return false; }).create(path, name, defSetId, projectName, projectPkg, projectType); } }
ClientProjectDiagramService extends ClientDiagramServiceImpl<ProjectMetadata, ProjectDiagram, ProjectDiagramService> { public 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) { diagramServiceCaller.call((RemoteCallback<Path>) callback::onSuccess, (message, throwable) -> { callback.onError(createOnErrorHandler(throwable, name, projectPkg)); return false; }).create(path, name, defSetId, projectName, projectPkg, projectType); } 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 create(final Path path, final String name, final String defSetId, final String projectName, final Package projectPkg, final Optional<String> projectType, final ServiceCallback<Path> callback) { diagramServiceCaller.call((RemoteCallback<Path>) callback::onSuccess, (message, throwable) -> { callback.onError(createOnErrorHandler(throwable, name, projectPkg)); return false; }).create(path, name, defSetId, projectName, projectPkg, projectType); } 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 create(final Path path, final String name, final String defSetId, final String projectName, final Package projectPkg, final Optional<String> projectType, final ServiceCallback<Path> callback) { diagramServiceCaller.call((RemoteCallback<Path>) callback::onSuccess, (message, throwable) -> { callback.onError(createOnErrorHandler(throwable, name, projectPkg)); return false; }).create(path, name, defSetId, projectName, projectPkg, projectType); } 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);  }