Search in sources :

Example 6 with AnonymousMethod

use of org.apache.beam.sdk.transforms.reflect.DoFnSignaturesTestUtils.AnonymousMethod in project beam by apache.

the class DoFnSignaturesProcessElementTest method testBadReturnType.

@Test
public void testBadReturnType() throws Exception {
    thrown.expect(IllegalArgumentException.class);
    thrown.expectMessage("Must return void");
    analyzeProcessElementMethod(new AnonymousMethod() {

        private int method(DoFn<Integer, String>.ProcessContext<Integer, String> context) {
            return 0;
        }
    });
}
Also used : DoFn(org.apache.beam.sdk.transforms.DoFn) AnonymousMethod(org.apache.beam.sdk.transforms.reflect.DoFnSignaturesTestUtils.AnonymousMethod) Test(org.junit.Test)

Aggregations

DoFn (org.apache.beam.sdk.transforms.DoFn)6 AnonymousMethod (org.apache.beam.sdk.transforms.reflect.DoFnSignaturesTestUtils.AnonymousMethod)6 Test (org.junit.Test)6 FakeDoFn (org.apache.beam.sdk.transforms.reflect.DoFnSignaturesTestUtils.FakeDoFn)2 BoundedWindow (org.apache.beam.sdk.transforms.windowing.BoundedWindow)1