PostAggregationFilterProcessor extends FilterProcessor { @Override public boolean test(final LazyElementCell elementCell) { return validator.validateAggregation(elementCell.getElement()); } PostAggregationFilterProcessor(final View view); @Override boolean test(final LazyElementCell elementCell); View getView();  }
@Test public void shouldFilterOutInvalidEntity() throws OperationException, SerialisationException { final PostAggregationFilterProcessor processor = new PostAggregationFilterProcessor(VIEW); assertFalse(processor.test(CellUtil.getLazyCell(new Entity(TestGroups.ENTITY, "invalidVertex"), serialisation))); assertFalse(processor.test(CellUtil.getLazyCell(new Entity(TestGroups.ENTITY, "validPreAggVertex"), serialisation))); assertFalse(processor.test(CellUtil.getLazyCell(new Entity(TestGroups.ENTITY, "validPostTransformVertex"), serialisation))); }
@Test public void shouldNotFilterOutValidEntity() throws OperationException, SerialisationException { final PostAggregationFilterProcessor processor = new PostAggregationFilterProcessor(VIEW); assertTrue(processor.test(CellUtil.getLazyCell(new Entity(TestGroups.ENTITY, "validPostAggVertex"), serialisation))); }
@Test public void shouldFilterOutInvalidEdge() throws OperationException, SerialisationException { final PostAggregationFilterProcessor processor = new PostAggregationFilterProcessor(VIEW); assertFalse(processor.test(CellUtil.getLazyCell( new Edge.Builder() .group(TestGroups.EDGE) .source("invalidVertex") .dest("dest") .directed(true) .build(), serialisation))); assertFalse(processor.test(CellUtil.getLazyCell( new Edge.Builder() .group(TestGroups.EDGE) .source("validPreAggVertex") .dest("dest") .directed(true) .build(), serialisation))); assertFalse(processor.test(CellUtil.getLazyCell( new Edge.Builder() .group(TestGroups.EDGE) .source("validPostTransformVertex") .dest("dest") .directed(true) .build(), serialisation))); }
@Test public void shouldNotFilterOutValidEdge() throws OperationException, SerialisationException { final PostAggregationFilterProcessor processor = new PostAggregationFilterProcessor(VIEW); assertTrue(processor.test(CellUtil.getLazyCell( new Edge.Builder() .group(TestGroups.EDGE) .source("validPostAggVertex") .dest("dest") .directed(true) .build(), serialisation))); }