@Test public void testSetupAccordionWidgets() { final VerticalPanel verticalPanel = mock(VerticalPanel.class); doReturn(verticalPanel).when(presenter).makeDefaultPanel(); presenter.setupAccordionWidgets(); verify(presenter).setupAccordionWidget(eq(ATTRIBUTE), any()); verify(presenter).setupAccordionWidget(eq(METADATA), any()); verify(presenter).setupAccordionWidget(eq(CONDITION), any()); verify(presenter).setupAccordionWidget(eq(ACTION), any()); assertEquals(verticalPanel, presenter.getAttributeWidget()); assertEquals(verticalPanel, presenter.getMetaDataWidget()); assertEquals(verticalPanel, presenter.getConditionsWidget()); assertEquals(verticalPanel, presenter.getActionsWidget()); }
void setupAccordionWidgets() { setupAccordionWidget(ATTRIBUTE, this::setAttributeWidget); setupAccordionWidget(METADATA, this::setMetaDataWidget); setupAccordionWidget(CONDITION, this::setConditionsWidget); setupAccordionWidget(ACTION, this::setActionsWidget); }
ColumnsPagePresenter { void setupAccordionWidgets() { setupAccordionWidget(ATTRIBUTE, this::setAttributeWidget); setupAccordionWidget(METADATA, this::setMetaDataWidget); setupAccordionWidget(CONDITION, this::setConditionsWidget); setupAccordionWidget(ACTION, this::setActionsWidget); } }
ColumnsPagePresenter { void setupAccordionWidgets() { setupAccordionWidget(ATTRIBUTE, this::setAttributeWidget); setupAccordionWidget(METADATA, this::setMetaDataWidget); setupAccordionWidget(CONDITION, this::setConditionsWidget); setupAccordionWidget(ACTION, this::setActionsWidget); } @Inject  ColumnsPagePresenter(final View view,
                                final GuidedDecisionTableAccordion accordion,
                                final ManagedInstance<NewGuidedDecisionTableColumnWizard> wizardManagedInstance,
                                final TranslationService translationService,
                                final ManagedInstance<DeleteColumnManagementAnchorWidget> deleteColumnManagementAnchorWidgets,
                                final ManagedInstance<AttributeColumnConfigRow> attributeColumnConfigRow,
                                final ColumnManagementView conditionsPanel,
                                final ColumnManagementView actionsPanel,
                                final ShowRuleNameOptionPresenter showRuleNameOptionPresenter); }
ColumnsPagePresenter { void setupAccordionWidgets() { setupAccordionWidget(ATTRIBUTE, this::setAttributeWidget); setupAccordionWidget(METADATA, this::setMetaDataWidget); setupAccordionWidget(CONDITION, this::setConditionsWidget); setupAccordionWidget(ACTION, this::setActionsWidget); } @Inject  ColumnsPagePresenter(final View view,
                                final GuidedDecisionTableAccordion accordion,
                                final ManagedInstance<NewGuidedDecisionTableColumnWizard> wizardManagedInstance,
                                final TranslationService translationService,
                                final ManagedInstance<DeleteColumnManagementAnchorWidget> deleteColumnManagementAnchorWidgets,
                                final ManagedInstance<AttributeColumnConfigRow> attributeColumnConfigRow,
                                final ColumnManagementView conditionsPanel,
                                final ColumnManagementView actionsPanel,
                                final ShowRuleNameOptionPresenter showRuleNameOptionPresenter); @PostConstruct void setup(); View getView(); void init(final GuidedDecisionTableModellerView.Presenter modeller); void onUpdatedLockStatusEvent(final @Observes UpdatedLockStatusEvent event); void onRefreshAttributesPanelEvent(final @Observes RefreshAttributesPanelEvent event); void onRefreshMetaDataPanelEvent(final @Observes RefreshMetaDataPanelEvent event); void onRefreshConditionsPanelEvent(final @Observes RefreshConditionsPanelEvent event); void onRefreshActionsPanelEvent(final @Observes RefreshActionsPanelEvent event); GuidedDecisionTableAccordion getAccordion(); void onDecisionTableSelected(final @Observes DecisionTableSelectedEvent event); void refresh(); }
ColumnsPagePresenter { void setupAccordionWidgets() { setupAccordionWidget(ATTRIBUTE, this::setAttributeWidget); setupAccordionWidget(METADATA, this::setMetaDataWidget); setupAccordionWidget(CONDITION, this::setConditionsWidget); setupAccordionWidget(ACTION, this::setActionsWidget); } @Inject  ColumnsPagePresenter(final View view,
                                final GuidedDecisionTableAccordion accordion,
                                final ManagedInstance<NewGuidedDecisionTableColumnWizard> wizardManagedInstance,
                                final TranslationService translationService,
                                final ManagedInstance<DeleteColumnManagementAnchorWidget> deleteColumnManagementAnchorWidgets,
                                final ManagedInstance<AttributeColumnConfigRow> attributeColumnConfigRow,
                                final ColumnManagementView conditionsPanel,
                                final ColumnManagementView actionsPanel,
                                final ShowRuleNameOptionPresenter showRuleNameOptionPresenter); @PostConstruct void setup(); View getView(); void init(final GuidedDecisionTableModellerView.Presenter modeller); void onUpdatedLockStatusEvent(final @Observes UpdatedLockStatusEvent event); void onRefreshAttributesPanelEvent(final @Observes RefreshAttributesPanelEvent event); void onRefreshMetaDataPanelEvent(final @Observes RefreshMetaDataPanelEvent event); void onRefreshConditionsPanelEvent(final @Observes RefreshConditionsPanelEvent event); void onRefreshActionsPanelEvent(final @Observes RefreshActionsPanelEvent event); GuidedDecisionTableAccordion getAccordion(); void onDecisionTableSelected(final @Observes DecisionTableSelectedEvent event); void refresh();  }