DataSetDefEditorPresenter extends BaseEditor { void onCancelEvent(@Observes CancelRequestEvent cancelEvent) { checkNotNull("cancelEvent", cancelEvent); if (cancelEvent.getContext().equals(workflow)) { workflow.clear(); } }  @OnStartup void onStartup(final ObservablePath path,
                          final PlaceRequest place); @WorkbenchPartTitleDecoration IsWidget getTitle(); @WorkbenchPartTitle String getTitleText(); @WorkbenchMenu Menus getMenus(); @WorkbenchPartView Widget getWidget(); @OnMayClose boolean onMayClose(); @OnClose void onClose(); DataSetDef getDataSetDef(); int getCurrentModelHash(); void disposeWorkflow(); @Inject
    public DataSetDefScreenView view; }
@Test public void testOnCancelEvent() { CancelRequestEvent event = mock(CancelRequestEvent.class); when(event.getContext()).thenReturn(editWorkflow); presenter.onCancelEvent(event); verify(editWorkflow, times(1)).clear(); verify(editWorkflow, times(0)).clearButtons(); verify(editWorkflow, times(0)).showTestButton(); verify(editWorkflow, times(0)).showNextButton(); verify(editWorkflow, times(0)).showBackButton(); verify(editWorkflow, times(0)).edit(any(DataSetDef.class), any(List.class)); verify(errorPopupPresenter, times(0)).showMessage(anyString()); verify(view, times(0)).setWidget(any(IsWidget.class)); }