DataflowAssert (Google Cloud Dataflow SDK 1.9.1 API)

Google Cloud Dataflow SDK for Java, version 1.9.1

com.google.cloud.dataflow.sdk.testing

Class DataflowAssert



  • public class DataflowAssert
    extends Object
    An assertion on the contents of a PCollection incorporated into the pipeline. Such an assertion can be checked no matter what kind of PipelineRunner is used.

    Note that the DataflowAssert call must precede the call to Pipeline.run().

    Examples of use:

    
     Pipeline p = TestPipeline.create();
     ...
     PCollection<String> output =
          input
          .apply(ParDo.of(new TestDoFn()));
     DataflowAssert.that(output)
         .containsInAnyOrder("out1", "out2", "out3");
     ...
     PCollection<Integer> ints = ...
     PCollection<Integer> sum =
         ints
         .apply(Combine.globally(new SumInts()));
     DataflowAssert.that(sum)
         .is(42);
     ...
     p.run();
     

    JUnit and Hamcrest must be linked in by any code that uses DataflowAssert.


이 페이지가 도움이 되었나요? 평가를 부탁드립니다.

다음에 대한 의견 보내기...

도움이 필요하시나요? 지원 페이지를 방문하세요.