use of uk.gov.gchq.gaffer.operation.impl.compare.Max in project Gaffer by gchq.
the class MaxHandlerTest method shouldReturnNullIfBothComparatorsAreNull.
@Test
public void shouldReturnNullIfBothComparatorsAreNull() throws OperationException {
// Given
final List<Entity> input = Lists.newArrayList();
final Max max = new Max.Builder().input(input).build();
final MaxHandler handler = new MaxHandler();
// When
final Element result = handler.doOperation(max, null, null);
// Then
assertNull(result);
}
use of uk.gov.gchq.gaffer.operation.impl.compare.Max in project Gaffer by gchq.
the class MaxHandlerTest method shouldReturnNullIfOperationInputIsNull.
@Test
public void shouldReturnNullIfOperationInputIsNull() throws OperationException {
// Given
final Max max = new Max.Builder().build();
final MaxHandler handler = new MaxHandler();
// When
final Element result = handler.doOperation(max, null, null);
// Then
assertNull(result);
}
use of uk.gov.gchq.gaffer.operation.impl.compare.Max in project Gaffer by gchq.
the class AbstractExamplesFactoryTest method shouldUseSchemaForMaxOperation.
@Test
public void shouldUseSchemaForMaxOperation() throws InstantiationException, IllegalAccessException {
// Given
TestExamplesFactory examplesFactory = new TestExamplesFactory(SCHEMA);
// When
Max operation = (Max) examplesFactory.generateExample(Max.class);
// Then
// Max has no equals method
assertEquals(1, operation.getComparators().size());
assertEquals(Sets.newHashSet("BasicEdge"), ((ElementPropertyComparator) operation.getComparators().get(0)).getGroups());
assertEquals("count", ((ElementPropertyComparator) operation.getComparators().get(0)).getProperty());
}
Aggregations