Package net.javacrumbs.jsonunit.assertj
Class JsonAssertions
java.lang.Object
net.javacrumbs.jsonunit.assertj.JsonAssertions
public final class JsonAssertions extends Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceJsonAssertions.JsonAssertionCallback -
Method Summary
Modifier and Type Method Description static @NotNull JsonAssert.ConfigurableJsonAssertassertThatJson(@NotNull Object actual, @NotNull JsonAssertions.JsonAssertionCallback... callbacks)Assert json properties with possibility to chain assertion callbacks like thisstatic @NotNull JsonAssert.ConfigurableJsonAssertassertThatJson(@Nullable Object actual)static @NotNull Objectjson(Object input)JSON to be used in expected part of the assertion,static @NotNull Objectvalue(Object input)Value passed here is not parsed as JSON but used as it is
-
Method Details
-
assertThatJson
@NotNull public static @NotNull JsonAssert.ConfigurableJsonAssert assertThatJson(@Nullable @Nullable Object actual) -
assertThatJson
@NotNull public static @NotNull JsonAssert.ConfigurableJsonAssert assertThatJson(@NotNull @NotNull Object actual, @NotNull @NotNull JsonAssertions.JsonAssertionCallback... callbacks)Assert json properties with possibility to chain assertion callbacks like thisassertThatJson("{\"test1\":2, \"test2\":1}", json -> json.inPath("test1").isEqualTo(2), json -> json.inPath("test2").isEqualTo(1) ); -
json
JSON to be used in expected part of the assertion,- Parameters:
input-- Returns:
- Object suitable for comparison. Implementation type may change in the future.
-
value
Value passed here is not parsed as JSON but used as it is
-