To run it, you have to run it by pipeline.run()
. Add it in your test method as the following and try again please.
@Test
public void testPrintFunctionDoesNotMutateData () {
Object genericObject = new Object();
PCollection<Object> collection = pipeline
.apply(Create.of(genericObject).withCoder(AvroCoder.of(Object.class)))
.apply(ParDo.of(print("Label")));
PAssert.that(collection).empty();
PAssert.that(collection).containsInAnyOrder(genericObject);
pipeline.run();
}
CLICK HERE to find out more related problems solutions.