use of uk.gov.gchq.gaffer.operation.impl.get.GetAllElements in project Gaffer by gchq.
the class CountGroupsIT method shouldCountGroupsOfElements.
@Test
public void shouldCountGroupsOfElements() throws OperationException, InterruptedException {
// Given
final User user = new User();
final Entity entity = new Entity(TestGroups.ENTITY_2, VERTEX);
entity.putProperty(TestPropertyNames.INT, 100);
// When
final GroupCounts counts = graph.execute(new Builder().first(new GetAllElements<>()).then(new CountGroups()).build(), user);
// Then
assertEquals(1, counts.getEntityGroups().size());
assertEquals(getEntities().size(), (int) counts.getEntityGroups().get(TestGroups.ENTITY));
assertEquals(1, counts.getEdgeGroups().size());
assertEquals(getEdges().size(), (int) counts.getEdgeGroups().get(TestGroups.EDGE));
assertFalse(counts.isLimitHit());
}
Aggregations