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 |
|---|---|
@NotNull 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)
);
|
@NotNull 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.
|
@NotNull org.assertj.core.api.AbstractStringAssert<?> |
asString() |
void |
isAbsent()
Asserts that given node is absent.
|
@NotNull org.assertj.core.api.ListAssert<Object> |
isArray()
Asserts that given node is present and is of type array.
|
@NotNull org.assertj.core.api.BooleanAssert |
isBoolean()
Asserts that given node is present and is of type boolean.
|
@NotNull JsonAssert |
isEqualTo(@Nullable Object expected)
Compares JSONs.
|
@NotNull JsonAssert |
isNotNull()
Asserts that given node is present and is not null.
|
void |
isNull()
Asserts that given node is present and is null.
|
@NotNull org.assertj.core.api.BigDecimalAssert |
isNumber()
Asserts that given node is present and is of type number.
|
@NotNull org.assertj.core.api.MapAssert<String,Object> |
isObject()
Asserts that given node is present and is of type object.
|
@NotNull JsonAssert |
isPresent()
Asserts that given node is present.
|
@NotNull org.assertj.core.api.StringAssert |
isString()
Asserts that given node is present and is of type string.
|
@NotNull JsonAssert |
node(@NotNull String node)
Moves comparison to given node.
|
asInstanceOf, asList, assertionError, 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, satisfies, satisfiesAnyOf, satisfiesAnyOf, setCustomRepresentation, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, usingRecursiveComparison, usingRecursiveComparison, withFailMessage, withRepresentation, withThreadDumpOnError@NotNull public @NotNull JsonAssert node(@NotNull @NotNull String node)
@NotNull public @NotNull JsonAssert and(@NotNull JsonAssertion... assertions)
assertThatJson("{\"test\":{\"a\":1, \"b\":2, \"c\":3}}").and(
a -> a.node("test").isObject(),
a -> a.node("test.b").isEqualTo(3)
);
@NotNull public @NotNull JsonAssert isEqualTo(@Nullable @Nullable Object expected)
isEqualTo in interface org.assertj.core.api.Assert<JsonAssert,Object>isEqualTo in class org.assertj.core.api.AbstractAssert<JsonAssert,Object>@NotNull public @NotNull org.assertj.core.api.MapAssert<String,Object> isObject()
@NotNull public @NotNull org.assertj.core.api.BigDecimalAssert isNumber()
@NotNull public @NotNull org.assertj.core.api.BigDecimalAssert asNumber()
@NotNull public @NotNull org.assertj.core.api.ListAssert<Object> isArray()
@NotNull public @NotNull org.assertj.core.api.BooleanAssert isBoolean()
@NotNull public @NotNull org.assertj.core.api.StringAssert isString()
@NotNull public @NotNull org.assertj.core.api.AbstractStringAssert<?> 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>@NotNull public @NotNull JsonAssert isPresent()
public void isAbsent()
@NotNull public @NotNull JsonAssert isNotNull()
isNotNull in interface org.assertj.core.api.Assert<JsonAssert,Object>isNotNull in class org.assertj.core.api.AbstractAssert<JsonAssert,Object>Copyright © 2020. All rights reserved.