use of org.kie.soup.project.datamodel.commons.util.RawMVELEvaluator in project drools-wb by kiegroup.
the class RuleModellerConditionSelectorPopupTest method testLoadDslConditionsDslEnabledButNotPresent.
@Test
public void testLoadDslConditionsDslEnabledButNotPresent() throws Exception {
// DSL sentences enabled
doReturn(true).when(ruleModeller).isDSLEnabled();
// DSL Conditions not present
dataModel = PackageDataModelOracleBuilder.newPackageOracleBuilder(new RawMVELEvaluator()).build();
dataModelPayload = new PackageDataModelOracleBaselinePayload();
dataModelPayload.setAllPackageElements(dataModel.getAllExtensions());
asyncPackageDataModelOracleFactory.makeAsyncPackageDataModelOracle(resourcePath, dataModelPayload);
new RuleModellerConditionSelectorPopup(model, ruleModeller, 0, oracle);
verify(choices, atLeastOnce()).addItem(keyCaptor.capture(), valueCaptor.capture());
Assertions.assertThat(keyCaptor.getAllValues()).doesNotContain(DSL_SENTENCE_CHOICE_KEY);
Assertions.assertThat(valueCaptor.getAllValues()).doesNotContain(DSL_SENTENCE_CHOICE_VALUE);
}
use of org.kie.soup.project.datamodel.commons.util.RawMVELEvaluator in project drools-wb by kiegroup.
the class RuleModellerConditionSelectorPopupTest method testLoadDslConditionsDslEnabledAndPresent.
@Test
public void testLoadDslConditionsDslEnabledAndPresent() throws Exception {
// DSL sentences enabled
doReturn(true).when(ruleModeller).isDSLEnabled();
// DSL Conditions present
dataModel = PackageDataModelOracleBuilder.newPackageOracleBuilder(new RawMVELEvaluator()).addExtension(DSLConditionSentence.INSTANCE, Collections.singletonList(dslSentence)).build();
dataModelPayload = new PackageDataModelOracleBaselinePayload();
dataModelPayload.setAllPackageElements(dataModel.getAllExtensions());
asyncPackageDataModelOracleFactory.makeAsyncPackageDataModelOracle(resourcePath, dataModelPayload);
new RuleModellerConditionSelectorPopup(model, ruleModeller, 0, oracle);
verify(choices, atLeastOnce()).addItem(keyCaptor.capture(), valueCaptor.capture());
verify(choices).setMultipleSelect(true);
Assertions.assertThat(keyCaptor.getAllValues()).contains(DSL_SENTENCE_CHOICE_KEY);
Assertions.assertThat(valueCaptor.getAllValues()).contains(DSL_SENTENCE_CHOICE_VALUE);
}
Aggregations