When running an Apache Beam unit test, is there any method to skip the setup portion of a Pipeline? Or add an intercepting method, after setup is run? We are reviewing these resources below
@Test
@Category(NeedsRunner.class)
public void testGenerateAnagramsFn() {
// Create the test input
PCollection<String> words = p.apply(Create.of("friend"));
// Test a single DoFn using the test input
PCollection<String> anagrams =
words.apply("Generate anagrams", ParDo.of(new GenerateAnagramsFn()));
// Assert correct output from
PAssert.that(anagrams).containsInAnyOrder(
"finder", "friend", "redfin", "refind");
p.run();
}
public void GenerateAnagramsFn() {
@Setup
public void init() {
...
}
@ProcessElement
public void transform(ProcessContext context) {
...
}
}
https://beam.apache.org/documentation/pipelines/test-your-pipeline/
https://cloud.google.com/dataflow/docs/guides/develop-and-test-pipelines