@Test public void testDuplicatedBusinessProcess() { final String name = "d1"; final String defSetId = "id1"; final String projName = "project-name"; final Package projPackage = new Package(); final Optional<String> projectType = Optional.of("type"); ProjectDiagramService projectDiagramService = mock(ProjectDiagramService.class); doThrow(new FileAlreadyExistsException(path.toString())).when(projectDiagramService).create(path, name, defSetId, projName, projPackage, projectType); exception.expect(FileAlreadyExistsException.class); projectDiagramService.create(path, name, defSetId, projName, projPackage, projectType); }
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);  }