use of org.apache.beam.sdk.extensions.euphoria.core.client.functional.UnaryPredicate in project beam by apache.
the class SplitTest method testBuild_ImplicitName.
@Test
public void testBuild_ImplicitName() {
final PCollection<String> dataset = TestUtils.createMockDataset(TypeDescriptors.strings());
final Split.Output<String> split = Split.of(dataset).using((UnaryPredicate<String>) what -> true).output();
final Filter positive = (Filter) TestUtils.getProducer(split.positive());
assertTrue(positive.getName().isPresent());
assertEquals(Split.DEFAULT_NAME + Split.POSITIVE_FILTER_SUFFIX, positive.getName().get());
final Filter negative = (Filter) TestUtils.getProducer(split.negative());
assertTrue(negative.getName().isPresent());
assertEquals(Split.DEFAULT_NAME + Split.NEGATIVE_FILTER_SUFFIX, negative.getName().get());
}
use of org.apache.beam.sdk.extensions.euphoria.core.client.functional.UnaryPredicate in project beam by apache.
the class SplitTest method testBuild.
@Test
public void testBuild() {
final String opName = "split";
final PCollection<String> dataset = TestUtils.createMockDataset(TypeDescriptors.strings());
final Split.Output<String> split = Split.named(opName).of(dataset).using((UnaryPredicate<String>) what -> true).output();
final Filter positive = (Filter) TestUtils.getProducer(split.positive());
assertNotNull(positive.getPredicate());
final Filter negative = (Filter) TestUtils.getProducer(split.negative());
assertNotNull(negative.getPredicate());
}
Aggregations