public class JsonAssert extends org.assertj.core.api.AbstractAssert<JsonAssert,Object>
| Modifier and Type | Class and Description |
|---|---|
static class |
JsonAssert.ConfigurableJsonAssert
JsonAssert that can be configured to prevent mistakes like
assertThatJson(...).isEqualsTo(...).when(...);
|
| Modifier and Type | Method and Description |
|---|---|
JsonAssert |
and(JsonAssertion... assertions)
Allows to do multiple comparisons on a document like
assertThatJson("{\"test\":{\"a\":1, \"b\":2, \"c\":3}}").and(
a -> a.node("test").isObject(),
a -> a.node("test.b").isEqualTo(3)
);
|
org.assertj.core.api.BigDecimalAssert |
asNumber()
Asserts that given node is present and is of type number or a string that can be parsed as a number.
|
org.assertj.core.api.AbstractCharSequenceAssert<?,String> |
asString() |
void |
isAbsent()
Asserts that given node is absent.
|
org.assertj.core.api.ListAssert<Object> |
isArray()
Asserts that given node is present and is of type array.
|
org.assertj.core.api.BooleanAssert |
isBoolean()
Asserts that given node is present and is of type boolean.
|
JsonAssert |
isEqualTo(Object expected)
Compares JSONs.
|
JsonAssert |
isNotNull()
Asserts that given node is present and is not null.
|
void |
isNull()
Asserts that given node is present and is null.
|
org.assertj.core.api.BigDecimalAssert |
isNumber()
Asserts that given node is present and is of type number.
|
org.assertj.core.api.MapAssert<String,Object> |
isObject()
Asserts that given node is present and is of type object.
|
JsonAssert |
isPresent()
Asserts that given node is present.
|
org.assertj.core.api.StringAssert |
isString()
Asserts that given node is present and is of type string.
|
JsonAssert |
node(String node)
Moves comparison to given node.
|
as, as, asList, describedAs, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, equals, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, inBinary, inHexadecimal, is, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotOfAnyClassIn, isNotSameAs, isOfAnyClassIn, isSameAs, matches, matches, newListAssertInstance, overridingErrorMessage, satisfies, setCustomRepresentation, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, withFailMessage, withRepresentation, withThreadDumpOnErrorpublic JsonAssert node(String node)
public JsonAssert and(JsonAssertion... assertions)
assertThatJson("{\"test\":{\"a\":1, \"b\":2, \"c\":3}}").and(
a -> a.node("test").isObject(),
a -> a.node("test.b").isEqualTo(3)
);
public JsonAssert isEqualTo(Object expected)
isEqualTo in interface org.assertj.core.api.Assert<JsonAssert,Object>isEqualTo in class org.assertj.core.api.AbstractAssert<JsonAssert,Object>public org.assertj.core.api.MapAssert<String,Object> isObject()
public org.assertj.core.api.BigDecimalAssert isNumber()
public org.assertj.core.api.BigDecimalAssert asNumber()
public org.assertj.core.api.ListAssert<Object> isArray()
public org.assertj.core.api.BooleanAssert isBoolean()
public org.assertj.core.api.StringAssert isString()
public org.assertj.core.api.AbstractCharSequenceAssert<?,String> asString()
asString in interface org.assertj.core.api.Assert<JsonAssert,Object>asString in class org.assertj.core.api.AbstractAssert<JsonAssert,Object>public void isNull()
isNull in interface org.assertj.core.api.Assert<JsonAssert,Object>isNull in class org.assertj.core.api.AbstractAssert<JsonAssert,Object>public JsonAssert isPresent()
public void isAbsent()
public JsonAssert isNotNull()
isNotNull in interface org.assertj.core.api.Assert<JsonAssert,Object>isNotNull in class org.assertj.core.api.AbstractAssert<JsonAssert,Object>Copyright © 2019. All rights reserved.