@Test public void testCreate_WithoutWizard() { final String fileName = "fileName"; final Package pkg = mock(Package.class); final Path resourcesPath = PathFactory.newPath("resources", "default: when(pkg.getPackageMainResourcesPath()).thenReturn(resourcesPath); when(options.isUsingWizard()).thenReturn(false); handler.create(pkg, fileName, newResourcePresenter); verify(busyIndicatorView, times(1)).hideBusyIndicator(); verify(newResourcePresenter, times(1)).complete(); verify(mockNotificationEvent, times(1)).fire(any(NotificationEvent.class)); verify(newResourceSuccessEventMock, times(1)).fire(any(NewResourceSuccessEvent.class)); verify(placeManager, times(1)).goTo(pathCaptor.capture()); assertEquals("default: pathCaptor.getValue().toURI()); verify(service, times(1)).create(eq(resourcesPath), eq(fileName + "." + resourceType.getSuffix()), any(GuidedDecisionTable52.class), any(String.class)); }
@Override public void create(final Package pkg, final String baseFileName, final NewResourcePresenter presenter) { this.newResourcePresenter = presenter; if (!options.isUsingWizard()) { createEmptyDecisionTable(pkg.getPackageMainResourcesPath(), baseFileName); } else { createDecisionTableWithWizard(pkg.getPackageMainResourcesPath(), baseFileName); } }
NewGuidedDecisionTableHandler extends DefaultNewResourceHandler { @Override public void create(final Package pkg, final String baseFileName, final NewResourcePresenter presenter) { this.newResourcePresenter = presenter; if (!options.isUsingWizard()) { createEmptyDecisionTable(pkg.getPackageMainResourcesPath(), baseFileName); } else { createDecisionTableWithWizard(pkg.getPackageMainResourcesPath(), baseFileName); } } }
NewGuidedDecisionTableHandler extends DefaultNewResourceHandler { @Override public void create(final Package pkg, final String baseFileName, final NewResourcePresenter presenter) { this.newResourcePresenter = presenter; if (!options.isUsingWizard()) { createEmptyDecisionTable(pkg.getPackageMainResourcesPath(), baseFileName); } else { createDecisionTableWithWizard(pkg.getPackageMainResourcesPath(), baseFileName); } } NewGuidedDecisionTableHandler(); @Inject  NewGuidedDecisionTableHandler(final PlaceManager placeManager,
                                         final Caller<GuidedDecisionTableEditorService> service,
                                         final GuidedDTableResourceType resourceType,
                                         final GuidedDecisionTableOptions options,
                                         final BusyIndicatorView busyIndicatorView,
                                         final NewGuidedDecisionTableWizardHelper helper); }
NewGuidedDecisionTableHandler extends DefaultNewResourceHandler { @Override public void create(final Package pkg, final String baseFileName, final NewResourcePresenter presenter) { this.newResourcePresenter = presenter; if (!options.isUsingWizard()) { createEmptyDecisionTable(pkg.getPackageMainResourcesPath(), baseFileName); } else { createDecisionTableWithWizard(pkg.getPackageMainResourcesPath(), baseFileName); } } NewGuidedDecisionTableHandler(); @Inject  NewGuidedDecisionTableHandler(final PlaceManager placeManager,
                                         final Caller<GuidedDecisionTableEditorService> service,
                                         final GuidedDTableResourceType resourceType,
                                         final GuidedDecisionTableOptions options,
                                         final BusyIndicatorView busyIndicatorView,
                                         final NewGuidedDecisionTableWizardHelper helper); @Override String getDescription(); @Override IsWidget getIcon(); @Override ResourceTypeDefinition getResourceType(); @Override void create(final Package pkg,
                       final String baseFileName,
                       final NewResourcePresenter presenter); @Override int order(); }
NewGuidedDecisionTableHandler extends DefaultNewResourceHandler { @Override public void create(final Package pkg, final String baseFileName, final NewResourcePresenter presenter) { this.newResourcePresenter = presenter; if (!options.isUsingWizard()) { createEmptyDecisionTable(pkg.getPackageMainResourcesPath(), baseFileName); } else { createDecisionTableWithWizard(pkg.getPackageMainResourcesPath(), baseFileName); } } NewGuidedDecisionTableHandler(); @Inject  NewGuidedDecisionTableHandler(final PlaceManager placeManager,
                                         final Caller<GuidedDecisionTableEditorService> service,
                                         final GuidedDTableResourceType resourceType,
                                         final GuidedDecisionTableOptions options,
                                         final BusyIndicatorView busyIndicatorView,
                                         final NewGuidedDecisionTableWizardHelper helper); @Override String getDescription(); @Override IsWidget getIcon(); @Override ResourceTypeDefinition getResourceType(); @Override void create(final Package pkg,
                       final String baseFileName,
                       final NewResourcePresenter presenter); @Override int order();  }