use of uk.gov.gchq.gaffer.operation.impl.compare.Sort.Builder in project Gaffer by gchq.
the class SortTest method builderShouldCreatePopulatedOperation.
@Test
@Override
public void builderShouldCreatePopulatedOperation() {
// Given
final Sort sort = new Builder().input(new Entity.Builder().group(TestGroups.ENTITY).property("property", 1).build(), new Entity.Builder().group(TestGroups.ENTITY).property("property", 2).build()).comparators(new ElementPropertyComparator() {
@Override
public int compare(final Element e1, final Element e2) {
return 0;
}
}).build();
// Then
assertThat(sort.getInput()).hasSize(2);
List properties = Streams.toStream(sort.getInput()).map(e -> e.getProperty("property")).collect(toList());
assertThat(properties).containsOnly(1, 2);
}
Aggregations