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>CustomMatcherto assert that the serialization of an object matches the one stored in file.
-
-
Constructor Summary
Constructors Constructor Description JSONMatcher(java.lang.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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddescribeTo(org.hamcrest.Description description)booleanmatches(java.lang.Object actual)
-
-
-
Constructor Detail
-
JSONMatcher
public JSONMatcher(java.lang.String pathToExpected) throws java.io.IOExceptionWill 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:
java.io.IOException
-
-