InsertMenuBuilder extends BaseMenu implements MenuFactory.CustomMenuBuilder { void openNewGuidedDecisionTableColumnWizard(final GuidedDecisionTableModellerView.Presenter modeller) { final NewGuidedDecisionTableColumnWizard wizard = wizardManagedInstance.get(); final Optional<GuidedDecisionTableView.Presenter> activeDecisionTable = modeller.getActiveDecisionTable(); activeDecisionTable.ifPresent(dt -> { wizard.init(dt); wizard.start(); }); } @Inject  InsertMenuBuilder(final TranslationService ts,
                             final MenuItemFactory menuItemFactory,
                             final ManagedInstance<NewGuidedDecisionTableColumnWizard> wizardManagedInstance); @PostConstruct void setup(); @Override void push(final MenuFactory.CustomMenuBuilder element); @Override MenuItem build(); @Override void onDecisionTableSelectedEvent(final @Observes DecisionTableSelectedEvent event); @Override void onDecisionTableSelectionsChangedEvent(final @Observes DecisionTableSelectionsChangedEvent event); @Override void onRefreshMenusEvent(final @Observes RefreshMenusEvent event); @Override void initialise(); void setModeller(final GuidedDecisionTableModellerView.Presenter modeller);  }
@Test public void testOpenNewGuidedDecisionTableColumnWizard() { final GuidedDecisionTableModellerView.Presenter modeller = mock(GuidedDecisionTableModellerView.Presenter.class); final GuidedDecisionTableView.Presenter activeDecisionTable = mock(GuidedDecisionTableView.Presenter.class); final NewGuidedDecisionTableColumnWizard wizard = mock(NewGuidedDecisionTableColumnWizard.class); doReturn(wizard).when(wizardManagedInstance).get(); doReturn(Optional.of(activeDecisionTable)).when(modeller).getActiveDecisionTable(); builder.openNewGuidedDecisionTableColumnWizard(modeller); verify(wizard).init(activeDecisionTable); verify(wizard).start(); }