use of uk.gov.gchq.koryphe.impl.predicate.IsIn in project Gaffer by gchq.
the class GetAllElementsIT method shouldGetAllElementsWithFilterWithoutSummarisation.
@Test
@TraitRequirement(StoreTrait.PRE_AGGREGATION_FILTERING)
public void shouldGetAllElementsWithFilterWithoutSummarisation() throws Exception {
final Edge edge1 = getEdges().get(new EdgeSeed(SOURCE_1, DEST_1, false)).emptyClone();
edge1.putProperty(TestPropertyNames.INT, 100);
edge1.putProperty(TestPropertyNames.COUNT, 1L);
final Edge edge2 = edge1.emptyClone();
edge2.putProperty(TestPropertyNames.INT, 101);
edge2.putProperty(TestPropertyNames.COUNT, 1L);
graph.execute(new AddElements.Builder().input(edge1, edge2).build(), getUser());
final GetAllElements op = new GetAllElements.Builder().view(new View.Builder().edge(TestGroups.EDGE, new ViewElementDefinition.Builder().preAggregationFilter(new ElementFilter.Builder().select(TestPropertyNames.INT).execute(new IsIn(Arrays.asList((Object) 100, 101))).build()).build()).build()).build();
// When
final CloseableIterable<? extends Element> results = graph.execute(op, getUser());
// Then
final List<Element> resultList = Lists.newArrayList(results);
assertThat(resultList).hasSize(2).contains((Element) edge1, edge2);
}
Aggregations