private CacheQuery createProjectionQuery(String... projection) {
QueryBuilder queryBuilder = searchManager.buildQueryBuilderForClass(Foo.class).get();
Query query = queryBuilder.keyword().onField("bar").matching("bar1").createQuery();
CacheQuery cacheQuery = searchManager.getQuery(query);
cacheQuery.projection(projection);
return cacheQuery;
}
private void assertQueryReturns(CacheQuery cacheQuery, Object[] expected) {
assertQueryListContains(cacheQuery.list(), expected);