Search in sources :

Example 1 with IterableConcat

use of uk.gov.gchq.koryphe.impl.function.IterableConcat in project Gaffer by gchq.

the class GetWalksIT method shouldNotFilterWalksWhenNoPredicateSupplied.

@Test
public void shouldNotFilterWalksWhenNoPredicateSupplied() throws Exception {
    final Conditional conditional = new Conditional();
    conditional.setTransform(new OperationChain.Builder().first(new Map.Builder<>().first(new ExtractWalkEntities()).then(new IterableConcat()).build()).then(new ForEach.Builder<>().operation(new Map.Builder<>().first(new ExtractProperty(TestPropertyNames.PROP_1)).build()).build()).build());
    final Iterable<Walk> walks = executeGetWalksApplyingConditional(conditional);
    assertThat(getPaths(walks)).isEqualTo("AED,ABC");
}
Also used : Walk(uk.gov.gchq.gaffer.data.graph.Walk) ExtractWalkEntities(uk.gov.gchq.gaffer.data.graph.function.walk.ExtractWalkEntities) Builder(uk.gov.gchq.gaffer.operation.impl.GetWalks.Builder) Conditional(uk.gov.gchq.gaffer.operation.util.Conditional) ExtractProperty(uk.gov.gchq.gaffer.data.element.function.ExtractProperty) IterableConcat(uk.gov.gchq.koryphe.impl.function.IterableConcat) HashMap(java.util.HashMap) Map(uk.gov.gchq.gaffer.operation.impl.Map) ForEach(uk.gov.gchq.gaffer.operation.impl.ForEach) Test(org.junit.Test)

Example 2 with IterableConcat

use of uk.gov.gchq.koryphe.impl.function.IterableConcat in project Gaffer by gchq.

the class GetWalksIT method getWalksThatPassPredicateTest.

private Iterable<Walk> getWalksThatPassPredicateTest(final Predicate predicate) throws Exception {
    final Conditional conditional = new Conditional();
    conditional.setTransform(new OperationChain.Builder().first(new Map.Builder<>().first(new ExtractWalkEntities()).then(new IterableConcat()).build()).then(new ForEach.Builder<>().operation(new Map.Builder<>().first(new ExtractProperty(TestPropertyNames.PROP_1)).build()).build()).build());
    conditional.setPredicate(predicate);
    return executeGetWalksApplyingConditional(conditional);
}
Also used : ExtractWalkEntities(uk.gov.gchq.gaffer.data.graph.function.walk.ExtractWalkEntities) Builder(uk.gov.gchq.gaffer.operation.impl.GetWalks.Builder) Conditional(uk.gov.gchq.gaffer.operation.util.Conditional) ExtractProperty(uk.gov.gchq.gaffer.data.element.function.ExtractProperty) IterableConcat(uk.gov.gchq.koryphe.impl.function.IterableConcat) HashMap(java.util.HashMap) Map(uk.gov.gchq.gaffer.operation.impl.Map) ForEach(uk.gov.gchq.gaffer.operation.impl.ForEach)

Aggregations

HashMap (java.util.HashMap)2 ExtractProperty (uk.gov.gchq.gaffer.data.element.function.ExtractProperty)2 ExtractWalkEntities (uk.gov.gchq.gaffer.data.graph.function.walk.ExtractWalkEntities)2 ForEach (uk.gov.gchq.gaffer.operation.impl.ForEach)2 Builder (uk.gov.gchq.gaffer.operation.impl.GetWalks.Builder)2 Map (uk.gov.gchq.gaffer.operation.impl.Map)2 Conditional (uk.gov.gchq.gaffer.operation.util.Conditional)2 IterableConcat (uk.gov.gchq.koryphe.impl.function.IterableConcat)2 Test (org.junit.Test)1 Walk (uk.gov.gchq.gaffer.data.graph.Walk)1