public class Snapshotter.Snapshot extends Object
Modifier and Type | Method and Description |
---|---|
void |
matchesSnapshot()
Asserts that the actual value matches the snapshot using string equality.
|
void |
matchesSnapshot(BiConsumer<String,String> snapshotMatcher)
Allows to specify a custom matcher for the snapshot.
|
void |
matchesSnapshot(String snapshotId)
Asserts that the actual value matches the snapshot using string equality.
|
void |
matchesSnapshot(String snapshotId,
BiConsumer<String,String> snapshotMatcher)
Allows to specify a custom matcher for the snapshot.
|
String |
toString() |
public void matchesSnapshot()
public void matchesSnapshot(String snapshotId)
snapshotId
- the id of the snapshot to use. In case of multiple snapshots per test, this allows to distinguish them.public void matchesSnapshot(BiConsumer<String,String> snapshotMatcher)
This is useful when comparing json or similar, which have less strict equality rules.
snapshotMatcher
- a custom matcher for the snapshot, which is called with the snapshot value and the actual value.
The matcher must throw an AssertionError
if the values don't match.public void matchesSnapshot(String snapshotId, BiConsumer<String,String> snapshotMatcher)
This is useful when comparing json or similar, which have less strict equality rules.
snapshotId
- the id of the snapshot to use. In case of multiple snapshots per test, this allows to distinguish them.snapshotMatcher
- a custom matcher for the snapshot, which is called with the snapshot value and the actual value.
The matcher must throw an AssertionError
if the values don't match.