public class FileChecksumMatcher extends TypeSafeMatcher<org.apache.beam.sdk.util.ShardedFile> implements SerializableMatcher<org.apache.beam.sdk.util.ShardedFile>
ShardedFile
in E2E test.
For example:
assertThat(new NumberedShardedFile(filePath), fileContentsHaveChecksum(checksumString));
or
assertThat(new NumberedShardedFile(filePath, shardTemplate), fileContentsHaveChecksum(checksumString));
Checksum of outputs is generated based on SHA-1 algorithm. If output file is empty, SHA-1 hash of empty string (da39a3ee5e6b4b0d3255bfef95601890afd80709) is used as expected.
Modifier and Type | Method and Description |
---|---|
void |
describeMismatchSafely(org.apache.beam.sdk.util.ShardedFile shardedFile,
Description description) |
void |
describeTo(Description description) |
static FileChecksumMatcher |
fileContentsHaveChecksum(java.lang.String checksum) |
boolean |
matchesSafely(org.apache.beam.sdk.util.ShardedFile shardedFile) |
describeMismatch, matches
_dont_implement_Matcher___instead_extend_BaseMatcher_, isNotNull, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
_dont_implement_Matcher___instead_extend_BaseMatcher_, describeMismatch, matches
public static FileChecksumMatcher fileContentsHaveChecksum(java.lang.String checksum)
public boolean matchesSafely(org.apache.beam.sdk.util.ShardedFile shardedFile)
matchesSafely
in class TypeSafeMatcher<org.apache.beam.sdk.util.ShardedFile>
public void describeTo(Description description)
describeTo
in interface SelfDescribing
public void describeMismatchSafely(org.apache.beam.sdk.util.ShardedFile shardedFile, Description description)
describeMismatchSafely
in class TypeSafeMatcher<org.apache.beam.sdk.util.ShardedFile>