use of org.drools.workbench.screens.guided.template.client.editor.TemplateModellerWidgetFactory in project drools-wb by kiegroup.
the class RuleModellerPageTest method testRuleModeller.
@Test
public void testRuleModeller() throws Exception {
when(brlActionPlugin.getRuleModel()).thenReturn(new RuleModel());
when(brlActionPlugin.tableFormat()).thenReturn(GuidedDecisionTable52.TableFormat.EXTENDED_ENTRY);
when(brlActionPlugin.getRuleModellerActionPlugins()).thenReturn(Collections.singletonList(ruleModellerActionPlugin));
when(brlActionPlugin.getRuleModellerConfiguration()).thenReturn(mock(RuleModellerConfiguration.class));
when(presenter.getDataModelOracle()).thenReturn(mock(AsyncPackageDataModelOracle.class));
final RuleModeller ruleModeller = brlActionPage.ruleModeller();
assertNotNull(ruleModeller);
assertEquals(brlActionPlugin.getRuleModel(), ruleModeller.getModel());
assertEquals(Collections.singletonList(ruleModellerActionPlugin), ruleModeller.getActionPlugins());
assertEquals(presenter.getDataModelOracle(), ruleModeller.getDataModelOracle());
assertTrue(ruleModeller.getWidgetFactory() instanceof TemplateModellerWidgetFactory);
assertFalse(ruleModeller.isReadOnly());
}
Aggregations