Search in sources :

Example 6 with ObjectType

use of org.drools.workbench.services.verifier.api.client.index.ObjectType in project drools-wb by kiegroup.

the class QueryableIndexTest method makeSureFirstAndLastObjectTypesAreTheSame.

@Test
public void makeSureFirstAndLastObjectTypesAreTheSame() throws Exception {
    queryableIndex.getObjectTypes().where(ObjectType.type().is("Person")).select().first(objectTypeQueryCallback);
    verify(objectTypeQueryCallback).callback(objectTypeArgumentCaptor.capture());
    final ObjectType first = objectTypeArgumentCaptor.getValue();
    reset(objectTypeQueryCallback);
    queryableIndex.getObjectTypes().where(ObjectType.type().is("Person")).select().last(objectTypeQueryCallback);
    verify(objectTypeQueryCallback).callback(objectTypeArgumentCaptor.capture());
    final ObjectType last = objectTypeArgumentCaptor.getValue();
    assertEquals("Person", first.getType());
    assertEquals(first, last);
}
Also used : ObjectType(org.drools.workbench.services.verifier.api.client.index.ObjectType) Test(org.junit.Test)

Aggregations

ObjectType (org.drools.workbench.services.verifier.api.client.index.ObjectType)6 Pattern (org.drools.workbench.services.verifier.api.client.index.Pattern)3 Test (org.junit.Test)3 AnalyzerConfiguration (org.drools.workbench.services.verifier.api.client.configuration.AnalyzerConfiguration)2 Before (org.junit.Before)2 AnalyzerConfigurationMock (org.drools.workbench.services.verifier.api.client.AnalyzerConfigurationMock)1 Column (org.drools.workbench.services.verifier.api.client.index.Column)1 Columns (org.drools.workbench.services.verifier.api.client.index.Columns)1 ObjectTypes (org.drools.workbench.services.verifier.api.client.index.ObjectTypes)1 Rule (org.drools.workbench.services.verifier.api.client.index.Rule)1 Rules (org.drools.workbench.services.verifier.api.client.index.Rules)1 AnalyzerConfigurationMock (org.drools.workbench.services.verifier.core.checks.AnalyzerConfigurationMock)1