Search in sources :

Example 1 with ExtractLargeWordsFn

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

the class CombinePerKeyExamplesTest method testExtractLargeWordsFn.

@Test
public void testExtractLargeWordsFn() throws Exception {
    DoFnTester<TableRow, KV<String, String>> extractLargeWordsFn = DoFnTester.of(new ExtractLargeWordsFn());
    List<KV<String, String>> results = extractLargeWordsFn.processBundle(ROWS_ARRAY);
    Assert.assertThat(results, CoreMatchers.hasItem(tuple1));
    Assert.assertThat(results, CoreMatchers.hasItem(tuple2));
    Assert.assertThat(results, CoreMatchers.hasItem(tuple3));
}
Also used : TableRow(com.google.api.services.bigquery.model.TableRow) KV(org.apache.beam.sdk.values.KV) ExtractLargeWordsFn(org.apache.beam.examples.cookbook.CombinePerKeyExamples.ExtractLargeWordsFn) Test(org.junit.Test)

Aggregations

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