Search in sources :

Example 1 with InMemoryStoreTransaction

use of com.yahoo.elide.core.datastore.inmemory.InMemoryStoreTransaction in project elide by yahoo.

the class DataStoreLoadTest method testPrefixPredicateWithInMemoryFiltering.

@Test
public void testPrefixPredicateWithInMemoryFiltering() throws Exception {
    DataStoreTransaction testTransaction = searchStore.beginReadTransaction();
    testTransaction = new InMemoryStoreTransaction(testTransaction);
    // Case sensitive query against case insensitive index must lowercase
    FilterExpression filter = filterParser.parseFilterExpression("name==dru*", ClassType.of(Item.class), false);
    Iterable<Object> loaded = testTransaction.loadObjects(EntityProjection.builder().type(Item.class).filterExpression(filter).build(), mockScope);
    assertListContains(loaded, Lists.newArrayList());
    verify(wrappedTransaction, never()).loadObjects(any(), any());
}
Also used : Item(com.yahoo.elide.datastores.search.models.Item) InMemoryStoreTransaction(com.yahoo.elide.core.datastore.inmemory.InMemoryStoreTransaction) DataStoreTransaction(com.yahoo.elide.core.datastore.DataStoreTransaction) FilterExpression(com.yahoo.elide.core.filter.expression.FilterExpression) Test(org.junit.jupiter.api.Test)

Aggregations

DataStoreTransaction (com.yahoo.elide.core.datastore.DataStoreTransaction)1 InMemoryStoreTransaction (com.yahoo.elide.core.datastore.inmemory.InMemoryStoreTransaction)1 FilterExpression (com.yahoo.elide.core.filter.expression.FilterExpression)1 Item (com.yahoo.elide.datastores.search.models.Item)1 Test (org.junit.jupiter.api.Test)1