@Test public void testCreateSuccessCallback() { final ArgumentCaptor<Path> pathArgumentCaptor = ArgumentCaptor.forClass(Path.class); final NewResourcePresenter presenter = mock(NewResourcePresenter.class); final Path path = mock(Path.class); handler.getSuccessCallback(presenter).callback(path); verify(busyIndicatorView, times(1)).hideBusyIndicator(); verify(presenter, times(1)).complete(); verify(newResourceSuccessEventMock, times(1)).fire(any(NewResourceSuccessEvent.class)); verify(placeManager, times(1)).goTo(pathArgumentCaptor.capture()); assertEquals(path, pathArgumentCaptor.getValue()); }
protected RemoteCallback<Path> getSuccessCallback(final NewResourcePresenter presenter) { return new RemoteCallback<Path>() { @Override public void callback(final Path path) { busyIndicatorView.hideBusyIndicator(); presenter.complete(); notifySuccess(); newResourceSuccessEvent.fire(new NewResourceSuccessEvent(path)); placeManager.goTo(path); } }; }
DefaultNewResourceHandler implements NewResourceHandler { protected RemoteCallback<Path> getSuccessCallback(final NewResourcePresenter presenter) { return new RemoteCallback<Path>() { @Override public void callback(final Path path) { busyIndicatorView.hideBusyIndicator(); presenter.complete(); notifySuccess(); newResourceSuccessEvent.fire(new NewResourceSuccessEvent(path)); placeManager.goTo(path); } }; } }
DefaultNewResourceHandler implements NewResourceHandler { protected RemoteCallback<Path> getSuccessCallback(final NewResourcePresenter presenter) { return new RemoteCallback<Path>() { @Override public void callback(final Path path) { busyIndicatorView.hideBusyIndicator(); presenter.complete(); notifySuccess(); newResourceSuccessEvent.fire(new NewResourceSuccessEvent(path)); placeManager.goTo(path); } }; } DefaultNewResourceHandler(final WorkspaceProjectContext context,
                              final Caller<KieModuleService> moduleService,
                              final Caller<ValidationService> validationService,
                              final PlaceManager placeManager,
                              final Event<NotificationEvent> notificationEvent,
                              final BusyIndicatorView busyIndicatorView);  DefaultNewResourceHandler(); }
DefaultNewResourceHandler implements NewResourceHandler { protected RemoteCallback<Path> getSuccessCallback(final NewResourcePresenter presenter) { return new RemoteCallback<Path>() { @Override public void callback(final Path path) { busyIndicatorView.hideBusyIndicator(); presenter.complete(); notifySuccess(); newResourceSuccessEvent.fire(new NewResourceSuccessEvent(path)); placeManager.goTo(path); } }; } DefaultNewResourceHandler(final WorkspaceProjectContext context,
                              final Caller<KieModuleService> moduleService,
                              final Caller<ValidationService> validationService,
                              final PlaceManager placeManager,
                              final Event<NotificationEvent> notificationEvent,
                              final BusyIndicatorView busyIndicatorView);  DefaultNewResourceHandler(); @Override List<Pair<String, ? extends IsWidget>> getExtensions(); @Override void validate(final String baseFileName,
                         final ValidatorWithReasonCallback callback); @Override void acceptContext(final Callback<Boolean, Void> callback); @Override Command getCommand(final NewResourcePresenter newResourcePresenter); @Override boolean canCreate(); }
DefaultNewResourceHandler implements NewResourceHandler { protected RemoteCallback<Path> getSuccessCallback(final NewResourcePresenter presenter) { return new RemoteCallback<Path>() { @Override public void callback(final Path path) { busyIndicatorView.hideBusyIndicator(); presenter.complete(); notifySuccess(); newResourceSuccessEvent.fire(new NewResourceSuccessEvent(path)); placeManager.goTo(path); } }; } DefaultNewResourceHandler(final WorkspaceProjectContext context,
                              final Caller<KieModuleService> moduleService,
                              final Caller<ValidationService> validationService,
                              final PlaceManager placeManager,
                              final Event<NotificationEvent> notificationEvent,
                              final BusyIndicatorView busyIndicatorView);  DefaultNewResourceHandler(); @Override List<Pair<String, ? extends IsWidget>> getExtensions(); @Override void validate(final String baseFileName,
                         final ValidatorWithReasonCallback callback); @Override void acceptContext(final Callback<Boolean, Void> callback); @Override Command getCommand(final NewResourcePresenter newResourcePresenter); @Override boolean canCreate();  }