Package de.skuzzle.test.snapshots
Interface SnapshotDsl.ChooseAssertions
-
- All Known Subinterfaces:
SnapshotDsl.ChooseStructure
- Enclosing interface:
- SnapshotDsl
@API(status=STABLE) public static interface SnapshotDsl.ChooseAssertions
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description SnapshotTestResultjustUpdateSnapshot()Deprecated.This method is NOT deprecated.SnapshotTestResultmatchesAccordingTo(StructuralAssertions structuralAssertions)Asserts that the serialized actual test result structurally matches the persisted snapshot.SnapshotTestResultmatchesSnapshotText()Asserts that the serialized actual test result matches the persisted snapshot using a generic String diff algorithm.
-
-
-
Method Detail
-
justUpdateSnapshot
@Deprecated SnapshotTestResult justUpdateSnapshot()
Deprecated.This method is NOT deprecated. Deprecation serves only to mark this method in your IDE as it should only be used temporarily.This method just updates the persisted snapshot with the current actual test result. It will always make the test fail with an assertion failure. Use it only temporarily as replacement formatchesSnapshotText(),matchesAccordingTo(StructuralAssertions)orSnapshotDsl.ChooseStructure.matchesSnapshotStructure()- Returns:
- Details about the snapshot.
- Throws:
AssertionError- Always thrown by this method to indicate that a call to this method must be removed to enable snapshot assertions.
-
matchesSnapshotText
SnapshotTestResult matchesSnapshotText()
Asserts that the serialized actual test result matches the persisted snapshot using a generic String diff algorithm. As this assertions only does a String comparison it can be used regardless whichSnapshotSerializerhas been used.- Returns:
- Details about the snapshot.
- Throws:
AssertionError- If the serialized objects do not match.- See Also:
TextSnapshot
-
matchesAccordingTo
SnapshotTestResult matchesAccordingTo(StructuralAssertions structuralAssertions)
Asserts that the serialized actual test result structurally matches the persisted snapshot. This method delegates to givenStructuralAssertionsinstance.- Parameters:
structuralAssertions- TheStructuralAssertionsinstance to use.- Returns:
- Details about the snapshot.
- Throws:
AssertionError- If the serialized objects do not match according toStructuralAssertions.assertEquals(String, String).
-
-