Search in sources :

Example 1 with Connectives

use of org.drools.workbench.screens.guided.rule.client.editor.factPattern.Connectives in project drools-wb by kiegroup.

the class OperatorsBaseTest method setUp.

@Before
public void setUp() throws Exception {
    ApplicationPreferences.setUp(new HashMap() {

        {
            put(ApplicationPreferences.DATE_FORMAT, "dd/MM/YYYY");
        }
    });
    serviceCaller = new CallerMock<>(service);
    oracle = new AsyncPackageDataModelOracleImpl(serviceCaller, null);
    final ModelField[] modelFields = new ModelField[] { modelField("street", DataType.TYPE_STRING), modelField("number", DataType.TYPE_NUMERIC_INTEGER) };
    Map<String, ModelField[]> fields = new HashMap<>();
    fields.put("org.Address", modelFields);
    oracle.addModelFields(fields);
    connectives = spy(new Connectives(modeller, eventBus, pattern, false));
    doReturn(oracle).when(connectives).getDataModelOracle();
    doReturn(oracle).when(modeller).getDataModelOracle();
    doReturn(Stream.of(connectiveConstraint).toArray(ConnectiveConstraint[]::new)).when(singleFieldConstraint).getConnectives();
}
Also used : Connectives(org.drools.workbench.screens.guided.rule.client.editor.factPattern.Connectives) AsyncPackageDataModelOracleImpl(org.kie.workbench.common.widgets.client.datamodel.AsyncPackageDataModelOracleImpl) ModelField(org.kie.soup.project.datamodel.oracle.ModelField) HashMap(java.util.HashMap) ConnectiveConstraint(org.drools.workbench.models.datamodel.rule.ConnectiveConstraint) Before(org.junit.Before)

Aggregations

HashMap (java.util.HashMap)1 ConnectiveConstraint (org.drools.workbench.models.datamodel.rule.ConnectiveConstraint)1 Connectives (org.drools.workbench.screens.guided.rule.client.editor.factPattern.Connectives)1 Before (org.junit.Before)1 ModelField (org.kie.soup.project.datamodel.oracle.ModelField)1 AsyncPackageDataModelOracleImpl (org.kie.workbench.common.widgets.client.datamodel.AsyncPackageDataModelOracleImpl)1