Class JSONMatcher<T>
java.lang.Object
org.hamcrest.BaseMatcher<T>
de.hybris.platform.cmsfacades.util.JSONMatcher<T>
- Type Parameters:
T- the type parameter of the matcher
- All Implemented Interfaces:
org.hamcrest.Matcher<T>,org.hamcrest.SelfDescribing
public class JSONMatcher<T>
extends org.hamcrest.BaseMatcher<T>
Custom
Matcher to assert that the serialization of an object matches the one stored in file.-
Constructor Summary
ConstructorsConstructorDescriptionJSONMatcher(String pathToExpected) Will return true if the JSON serialization of the actual is equal to the trimmed serialization of the JSON contained in the provided path -
Method Summary
Methods inherited from class org.hamcrest.BaseMatcher
_dont_implement_Matcher___instead_extend_BaseMatcher_, describeMismatch, isNotNull, toString
-
Constructor Details
-
JSONMatcher
Will return true if the JSON serialization of the actual is equal to the trimmed serialization of the JSON contained in the provided path- Parameters:
pathToExpected- path in the classpath to the file containing the expected JSON string, it can contain a beautified JSON- Throws:
IOException
-
-
Method Details
-
matches
-
describeTo
public void describeTo(org.hamcrest.Description description)
-