Search in sources :

Example 1 with ProjectionFn

use of org.apache.beam.examples.cookbook.FilterExamples.ProjectionFn in project beam by apache.

the class FilterExamplesTest method testProjectionFn.

@Test
public void testProjectionFn() throws Exception {
    DoFnTester<TableRow, TableRow> projectionFn = DoFnTester.of(new ProjectionFn());
    List<TableRow> results = projectionFn.processBundle(ROWS_ARRAY);
    Assert.assertThat(results, CoreMatchers.hasItem(outRow1));
    Assert.assertThat(results, CoreMatchers.hasItem(outRow2));
    Assert.assertThat(results, CoreMatchers.hasItem(outRow3));
}
Also used : ProjectionFn(org.apache.beam.examples.cookbook.FilterExamples.ProjectionFn) TableRow(com.google.api.services.bigquery.model.TableRow) Test(org.junit.Test)

Aggregations

TableRow (com.google.api.services.bigquery.model.TableRow)1 ProjectionFn (org.apache.beam.examples.cookbook.FilterExamples.ProjectionFn)1 Test (org.junit.Test)1