Package de.skuzzle.test.snapshots
Interface StructuralAssertions
-
@API(status=STABLE) public interface StructuralAssertionsAllows to customize how structured data is compared in order to check whether a snapshot matches an actual test result.- See Also:
SnapshotSerializer,StructuredData
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidassertEquals(java.lang.String storedSnapshot, java.lang.String serializedActual)Structurally compares two serialized objects.
-
-
-
Method Detail
-
assertEquals
void assertEquals(java.lang.String storedSnapshot, java.lang.String serializedActual) throws java.lang.AssertionErrorStructurally compares two serialized objects. If comparison fails, this method should throw anAssertionErrorwith a helpful error message.Note that, if you don't throw an instance of
AssertionFailedErrorthen the framework will take care of rethrowing your assertion failure as an AssertionFailedError to make sure that the diff can be viewed in the IDE's diff viewer.- Parameters:
storedSnapshot- The persisted snapshot.serializedActual- The serialized actual test result.- Throws:
java.lang.AssertionError- If both objects are not "identical" according to this implementation.SnapshotException- If any kind of technical error occurs during comparison.- API Note:
- Implementors are advised to throw
AssertionFailedErrorinstead of plainAssertionError. This allows the user to see an IDE generated diff of the actual and expected values in most IDEs.
-
-