Javadoc Javadoc

PAssert is a class included in the Beam Java SDK that is an assertion on the contents of a PCollection. You can use PAssert to verify that a PCollection contains a specific set of expected elements.


For a given PCollection, you can use PAssert to verify the contents as follows:

PCollection<String> output = ...;

// Check whether a PCollection contains some elements in any order.

Any code that uses PAssert must link in JUnit and Hamcrest. If you’re using Maven, you can link in Hamcrest by adding the following dependency to your project’s pom.xml file: