PreferencesCentralActionsScreen { public void fireCancelEvent() { undoChangesEvent.fire(new PreferencesCentralUndoChangesEvent()); notification.fire(new NotificationEvent(view.getChangesUndoneMessage(), NotificationEvent.NotificationType.DEFAULT)); goBackToAdminPage(); } @Inject  PreferencesCentralActionsScreen(final View view,
                                           final PlaceManager placeManager,
                                           final Event<PreferencesCentralPreSaveEvent> preSaveEvent,
                                           final Event<PreferencesCentralSaveEvent> saveEvent,
                                           final Event<PreferencesCentralUndoChangesEvent> undoChangesEvent,
                                           final Event<NotificationEvent> notification); @PostConstruct void init(); void initEvent(@Observes final PreferencesCentralActionsConfigurationEvent event); void fireSaveEvent(); void fireCancelEvent(); @WorkbenchPartTitle String getTitle(); @WorkbenchPartView HierarchyStructureView getView(); @DefaultPosition CompassPosition getDefaultPosition(); static final String IDENTIFIER; }
@Test public void fireUndoEventWithoutAdminScreenToGoBackToTest() { actionsScreen.fireCancelEvent(); verify(undoChangesEvent).fire(any(PreferencesCentralUndoChangesEvent.class)); verify(notification).fire(any(NotificationEvent.class)); verify(placeManager, never()).goTo(any(PlaceRequest.class)); }