PreferencesCentralActionsScreen { public void fireSaveEvent() { preSaveEvent.fire(new PreferencesCentralPreSaveEvent()); saveEvent.fire(new PreferencesCentralSaveEvent()); 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 fireSaveEventTest() { actionsScreen.initEvent(new PreferencesCentralActionsConfigurationEvent("screen", null)); actionsScreen.fireSaveEvent(); verify(preSaveEvent).fire(any(PreferencesCentralPreSaveEvent.class)); verify(saveEvent).fire(any(PreferencesCentralSaveEvent.class)); verify(placeManager).goTo(eq(new DefaultPlaceRequest(AdminPagePerspective.IDENTIFIER, params))); }
@Test public void fireSaveEventWithoutAdminScreenToGoBackToTest() { actionsScreen.fireSaveEvent(); verify(preSaveEvent).fire(any(PreferencesCentralPreSaveEvent.class)); verify(saveEvent).fire(any(PreferencesCentralSaveEvent.class)); verify(placeManager, never()).goTo(any(PlaceRequest.class)); }