DataSetDefWizardScreen { @OnMayClose public boolean onMayClose() { return mayClose(); } @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); @OnMayClose boolean onMayClose(); @OnClose void onClose(); void setOriginalHash(Integer originalHash); int getCurrentModelHash(); DataSetDef getDataSetDef(); boolean mayClose(); boolean isDirty(Integer currentHash); void completeEdition(final DataSetDef dataSetDef,
                                final DataSet dataset); public DataSetDefScreenView view; }
@Test public void testOnMayClose() { presenter.init(null); when(dataSetProviderTypeWorkflow.getDataSetDef()).thenReturn(mock(SQLDataSetDef.class)); presenter.onMayClose(); verify(view).confirmClose(); assertTrue(presenter.isDirty(presenter.getCurrentModelHash())); }