Search in sources :

Example 1 with FormatShakespeareOutputFn

use of org.apache.beam.examples.cookbook.CombinePerKeyExamples.FormatShakespeareOutputFn in project beam by apache.

the class CombinePerKeyExamplesTest method testFormatShakespeareOutputFn.

@Test
public void testFormatShakespeareOutputFn() throws Exception {
    DoFnTester<KV<String, String>, TableRow> formatShakespeareOutputFn = DoFnTester.of(new FormatShakespeareOutputFn());
    List<TableRow> results = formatShakespeareOutputFn.processBundle(COMBINED_TUPLES_ARRAY);
    Assert.assertThat(results, CoreMatchers.hasItem(resultRow1));
    Assert.assertThat(results, CoreMatchers.hasItem(resultRow2));
}
Also used : TableRow(com.google.api.services.bigquery.model.TableRow) KV(org.apache.beam.sdk.values.KV) FormatShakespeareOutputFn(org.apache.beam.examples.cookbook.CombinePerKeyExamples.FormatShakespeareOutputFn) Test(org.junit.Test)

Aggregations

TableRow (com.google.api.services.bigquery.model.TableRow)1 FormatShakespeareOutputFn (org.apache.beam.examples.cookbook.CombinePerKeyExamples.FormatShakespeareOutputFn)1 KV (org.apache.beam.sdk.values.KV)1 Test (org.junit.Test)1