Class JsonAssert
- java.lang.Object
-
- dev.aherscu.qa.testing.utils.assertions.JsonAssert
-
- Direct Known Subclasses:
JsonAssertEx
,JXPathAssert
public class JsonAssert extends Object
-
-
Constructor Summary
Constructors Constructor Description JsonAssert()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CollectionMatcher
collectionWithSize(org.hamcrest.Matcher<? super Integer> sizeMatcher)
static org.hamcrest.Matcher<Collection<Object>>
emptyCollection()
static org.hamcrest.Matcher<Map<String,?>>
mapContainingKey(org.hamcrest.Matcher<String> keyMatcher)
static <V> org.hamcrest.Matcher<? super Map<?,V>>
mapContainingValue(org.hamcrest.Matcher<? super V> valueMatcher)
static JsonAsserter
with(InputStream is)
Creates a JSONAsserterstatic JsonAsserter
with(Reader reader)
Creates a JSONAsserterstatic JsonAsserter
with(String json)
Creates a JSONAsserter
-
-
-
Method Detail
-
with
public static JsonAsserter with(String json)
Creates a JSONAsserter- Parameters:
json
- the JSON document to create a JSONAsserter for- Returns:
- a JSON asserter initialized with the provided document
- Throws:
ParseException
- when the given JSON could not be parsed
-
with
public static JsonAsserter with(Reader reader) throws IOException
Creates a JSONAsserter- Parameters:
reader
- the reader of the json document- Returns:
- a JSON asserter initialized with the provided document
- Throws:
ParseException
- when the given JSON could not be parsedIOException
-
with
public static JsonAsserter with(InputStream is) throws IOException
Creates a JSONAsserter- Parameters:
is
- the input stream- Returns:
- a JSON asserter initialized with the provided document
- Throws:
ParseException
- when the given JSON could not be parsedIOException
-
collectionWithSize
public static CollectionMatcher collectionWithSize(org.hamcrest.Matcher<? super Integer> sizeMatcher)
-
mapContainingKey
public static org.hamcrest.Matcher<Map<String,?>> mapContainingKey(org.hamcrest.Matcher<String> keyMatcher)
-
mapContainingValue
public static <V> org.hamcrest.Matcher<? super Map<?,V>> mapContainingValue(org.hamcrest.Matcher<? super V> valueMatcher)
-
emptyCollection
public static org.hamcrest.Matcher<Collection<Object>> emptyCollection()
-
-