@Test public void testMigrateFromStunnerToJBPMDesignerFileAlreadyExists() { MigrateRequest request = MigrateRequest.newFromStunnerToJBPMDesigner(path, NEW_FILE_NAME, NEW_EXTENSION, COMMIT_MESSAGE); when(ioService.exists(any(org.uberfire.java.nio.file.Path.class))).thenReturn(true); MigrateResult result = service.migrateDiagram(request); verify(ioService, never()).move(any(org.uberfire.java.nio.file.Path.class), any(org.uberfire.java.nio.file.Path.class), any(CommentedOption.class)); verify(ioService, never()).startBatch(any(FileSystem.class)); verify(ioService, never()).endBatch(); assertTrue(result.hasError()); assertEquals(IntegrationService.ServiceError.JBPM_DESIGNER_PROCESS_ALREADY_EXIST, result.getError()); assertEquals(IntegrationService.ServiceError.JBPM_DESIGNER_PROCESS_ALREADY_EXIST.i18nKey(), result.getMessageKey()); assertEquals(1, result.getMessageArguments().size()); assertEquals(path.toString(), result.getMessageArguments().get(0).toString()); }
@Override public MigrateResult migrateDiagram(MigrateRequest request) { checkNotNull("request", request); if (request.getType() == MigrateRequest.Type.STUNNER_TO_JBPM_DESIGNER) { return migrateFromStunnerToJBPMDesigner(request); } else { return migrateFromJBPMDesignerToStunner(request); } }
IntegrationServiceImpl implements IntegrationService { @Override public MigrateResult migrateDiagram(MigrateRequest request) { checkNotNull("request", request); if (request.getType() == MigrateRequest.Type.STUNNER_TO_JBPM_DESIGNER) { return migrateFromStunnerToJBPMDesigner(request); } else { return migrateFromJBPMDesignerToStunner(request); } } }
IntegrationServiceImpl implements IntegrationService { @Override public MigrateResult migrateDiagram(MigrateRequest request) { checkNotNull("request", request); if (request.getType() == MigrateRequest.Type.STUNNER_TO_JBPM_DESIGNER) { return migrateFromStunnerToJBPMDesigner(request); } else { return migrateFromJBPMDesignerToStunner(request); } } IntegrationServiceImpl(); @Inject  IntegrationServiceImpl(final ProjectDiagramService diagramService,
                                  final BPMNBackendService definitionService,
                                  final FactoryManager factoryManager,
                                  final KieModuleService moduleService,
                                  final KieServiceOverviewLoader overviewLoader,
                                  final @Named("ioStrategy") IOService ioService,
                                  final CommentedOptionFactory optionFactory); }
IntegrationServiceImpl implements IntegrationService { @Override public MigrateResult migrateDiagram(MigrateRequest request) { checkNotNull("request", request); if (request.getType() == MigrateRequest.Type.STUNNER_TO_JBPM_DESIGNER) { return migrateFromStunnerToJBPMDesigner(request); } else { return migrateFromJBPMDesignerToStunner(request); } } IntegrationServiceImpl(); @Inject  IntegrationServiceImpl(final ProjectDiagramService diagramService,
                                  final BPMNBackendService definitionService,
                                  final FactoryManager factoryManager,
                                  final KieModuleService moduleService,
                                  final KieServiceOverviewLoader overviewLoader,
                                  final @Named("ioStrategy") IOService ioService,
                                  final CommentedOptionFactory optionFactory); @Override MigrateResult migrateDiagram(MigrateRequest request); @SuppressWarnings("unchecked") MarshallingResponse<ProjectDiagram> getDiagramByPath(final Path path, final MarshallingRequest.Mode mode); }
IntegrationServiceImpl implements IntegrationService { @Override public MigrateResult migrateDiagram(MigrateRequest request) { checkNotNull("request", request); if (request.getType() == MigrateRequest.Type.STUNNER_TO_JBPM_DESIGNER) { return migrateFromStunnerToJBPMDesigner(request); } else { return migrateFromJBPMDesignerToStunner(request); } } IntegrationServiceImpl(); @Inject  IntegrationServiceImpl(final ProjectDiagramService diagramService,
                                  final BPMNBackendService definitionService,
                                  final FactoryManager factoryManager,
                                  final KieModuleService moduleService,
                                  final KieServiceOverviewLoader overviewLoader,
                                  final @Named("ioStrategy") IOService ioService,
                                  final CommentedOptionFactory optionFactory); @Override MigrateResult migrateDiagram(MigrateRequest request); @SuppressWarnings("unchecked") MarshallingResponse<ProjectDiagram> getDiagramByPath(final Path path, final MarshallingRequest.Mode mode);  }