DataSetDefWizardScreen { void onSave(final DataSetDef dataSetDef, final String message) { BusyPopup.showMessage(DataSetAuthoringConstants.INSTANCE.saving()); services.call(saveSuccessCallback, errorCallback).save(dataSetDef, message); placeManager.goTo("DataSetAuthoringHome"); } @Inject  DataSetDefWizardScreen(final SyncBeanManager beanManager,
                                  final DataSetEditorWorkflowFactory workflowFactory,
                                  final Caller<DataSetDefVfsServices> services,
                                  final DataSetClientServices clientServices,
                                  final Event<NotificationEvent> notification,
                                  final PlaceManager placeManager,
                                  final ErrorPopupPresenter errorPopupPresenter,
                                  final SavePopUpPresenter savePopUpPresenter,
                                  final DataSetDefScreenView view); @WorkbenchPartTitle String getTitle(); @WorkbenchPartView IsWidget getView(); @OnStartup void init(PlaceRequest placeRequest); @OnClose void onClose(); void completeEdition(final DataSetDef dataSetDef,
                                final DataSet dataset); public DataSetDefScreenView view; }
@Test public void testOnSave() { final Path path = mock(Path.class); when(dataSetDefVfsServices.save(any(DataSetDef.class), anyString())).thenReturn(path); presenter.currentWorkflow = editWorkflow; presenter.onSave(dataSetDef, "saveMessage"); verify(placeManager, times(1)).goTo("DataSetAuthoringHome"); verify(notification, times(1)).fire(any(NotificationEvent.class)); verify(placeManager, times(1)).closePlace(any(PlaceRequest.class)); verify(editWorkflow, times(1)).clear(); verify(workflowFactory, times(0)).providerType(); verify(workflowFactory, times(0)).edit(any(DataSetProviderType.class)); verify(workflowFactory, times(0)).basicAttributes(any(DataSetProviderType.class)); assertNull("current workflow null", presenter.currentWorkflow); }