use of org.apache.beam.examples.cookbook.BigQueryTornadoes.ExtractTornadoesFn in project beam by apache.
the class BigQueryTornadoesTest method testNoTornadoes.
@Test
public void testNoTornadoes() throws Exception {
TableRow row = new TableRow().set("month", 6).set("tornado", false);
DoFnTester<TableRow, Integer> extractWordsFn = DoFnTester.of(new ExtractTornadoesFn());
Assert.assertTrue(extractWordsFn.processBundle(row).isEmpty());
}
use of org.apache.beam.examples.cookbook.BigQueryTornadoes.ExtractTornadoesFn in project beam by apache.
the class BigQueryTornadoesTest method testExtractTornadoes.
@Test
public void testExtractTornadoes() throws Exception {
TableRow row = new TableRow().set("month", "6").set("tornado", true);
DoFnTester<TableRow, Integer> extractWordsFn = DoFnTester.of(new ExtractTornadoesFn());
Assert.assertThat(extractWordsFn.processBundle(row), CoreMatchers.hasItems(6));
}
Aggregations