Search in sources :

Example 56 with DecisionTableSelectedEvent

use of org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent in project drools-wb by kiegroup.

the class ViewMenuBuilderTest method testViewAuditLog.

@Test
public void testViewAuditLog() {
    builder.onDecisionTableSelectedEvent(new DecisionTableSelectedEvent(dtPresenter));
    builder.onViewAuditLog();
    verify(dtPresenter, times(1)).showAuditLog();
}
Also used : DecisionTableSelectedEvent(org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent) Test(org.junit.Test)

Example 57 with DecisionTableSelectedEvent

use of org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent in project drools-wb by kiegroup.

the class ColumnsPagePresenterTest method testOnDecisionTableSelectedWhenEventAndActiveDecisionTableAreDifferent.

@Test
public void testOnDecisionTableSelectedWhenEventAndActiveDecisionTableAreDifferent() {
    final DecisionTableSelectedEvent event = mock(DecisionTableSelectedEvent.class);
    final GuidedDecisionTableView.Presenter presenterDecisionTable = mock(GuidedDecisionTableView.Presenter.class);
    final GuidedDecisionTableView.Presenter eventDecisionTable = mock(GuidedDecisionTableView.Presenter.class);
    final Optional<GuidedDecisionTableView.Presenter> presenterOptional = Optional.ofNullable(eventDecisionTable);
    doReturn(true).when(presenter).hasActiveDecisionTable();
    doReturn(Optional.of(presenterDecisionTable)).when(modeller).getActiveDecisionTable();
    doReturn(presenterOptional).when(event).getPresenter();
    doNothing().when(presenter).setupRuleSelector(any());
    presenter.onDecisionTableSelected(event);
    verify(presenter).setupRuleSelector(eventDecisionTable);
}
Also used : GuidedDecisionTableView(org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTableView) DecisionTableSelectedEvent(org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent) Test(org.junit.Test)

Example 58 with DecisionTableSelectedEvent

use of org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent in project drools-wb by kiegroup.

the class ColumnsPagePresenterTest method testOnDecisionTableSelectedWhenPresenterDoesNotHaveActiveDecisionTable.

@Test
public void testOnDecisionTableSelectedWhenPresenterDoesNotHaveActiveDecisionTable() {
    final DecisionTableSelectedEvent event = mock(DecisionTableSelectedEvent.class);
    doReturn(false).when(presenter).hasActiveDecisionTable();
    presenter.onDecisionTableSelected(event);
    verify(presenter, never()).setupRuleSelector(any());
}
Also used : DecisionTableSelectedEvent(org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent) Test(org.junit.Test)

Aggregations

DecisionTableSelectedEvent (org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent)58 Test (org.junit.Test)54 GuidedDecisionTableView (org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTableView)14 ObservablePath (org.uberfire.backend.vfs.ObservablePath)10 PlaceRequest (org.uberfire.mvp.PlaceRequest)10 GuidedDecisionTablePresenter (org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTablePresenter)9 GuidedDecisionTableEditorContent (org.drools.workbench.screens.guided.dtable.model.GuidedDecisionTableEditorContent)9 MetadataCol52 (org.drools.workbench.models.guided.dtable.shared.model.MetadataCol52)7 DTCellValue52 (org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52)5 GuidedDecisionTableEditorGraphContent (org.drools.workbench.screens.guided.dtable.model.GuidedDecisionTableEditorGraphContent)2 GuidedDecisionTableGraphEntry (org.drools.workbench.screens.guided.dtable.model.GuidedDecisionTableEditorGraphModel.GuidedDecisionTableGraphEntry)2 OverviewWidgetPresenter (org.kie.workbench.common.widgets.metadata.client.widget.OverviewWidgetPresenter)2 Matchers.anyBoolean (org.mockito.Matchers.anyBoolean)2 MultiPageEditor (org.uberfire.client.workbench.widgets.multipage.MultiPageEditor)2 PathPlaceRequest (org.uberfire.mvp.impl.PathPlaceRequest)2 PostConstruct (javax.annotation.PostConstruct)1 GuidedDecisionTable52 (org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52)1 Overview (org.guvnor.common.services.shared.metadata.model.Overview)1 AsyncPackageDataModelOracle (org.kie.workbench.common.widgets.client.datamodel.AsyncPackageDataModelOracle)1 ImportsWidgetPresenter (org.kie.workbench.common.widgets.configresource.client.widget.bound.ImportsWidgetPresenter)1