use of org.apache.beam.sdk.testing.PAssert.MatcherCheckerFn in project beam by apache.
the class PAssertTest method testAssertionSiteIsCaptured.
@Test
public void testAssertionSiteIsCaptured() {
// This check should return a failure.
SuccessOrFailure res = PAssert.doChecks(PAssert.PAssertionSite.capture("Captured assertion message."), 10, new MatcherCheckerFn(SerializableMatchers.contains(11)));
String stacktrace = Throwables.getStackTraceAsString(res.assertionError());
assertFalse(res.isSuccess());
assertThat(stacktrace, containsString("PAssertionSite.capture"));
}
Aggregations