public class FileChecksumMatcher extends org.hamcrest.TypeSafeMatcher<ShardedFile> implements SerializableMatcher<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(ShardedFile shardedFile,
org.hamcrest.Description description) |
void |
describeTo(org.hamcrest.Description description) |
static FileChecksumMatcher |
fileContentsHaveChecksum(java.lang.String checksum) |
boolean |
matchesSafely(ShardedFile shardedFile) |
_dont_implement_Matcher___instead_extend_BaseMatcher_, isNotNull, toStringpublic static FileChecksumMatcher fileContentsHaveChecksum(java.lang.String checksum)
public boolean matchesSafely(ShardedFile shardedFile)
matchesSafely in class org.hamcrest.TypeSafeMatcher<ShardedFile>public void describeTo(org.hamcrest.Description description)
describeTo in interface org.hamcrest.SelfDescribingpublic void describeMismatchSafely(ShardedFile shardedFile, org.hamcrest.Description description)
describeMismatchSafely in class org.hamcrest.TypeSafeMatcher<ShardedFile>