public final class JsonAssertions extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
JsonAssertions.JsonAssertionCallback |
| Modifier and Type | Method and Description |
|---|---|
static @NotNull JsonAssert.ConfigurableJsonAssert |
assertThatJson(@NotNull Object actual) |
static @NotNull JsonAssert.ConfigurableJsonAssert |
assertThatJson(@NotNull Object actual,
JsonAssertions.JsonAssertionCallback... callbacks)
Assert json properties with possibility to chain assertion callbacks like this
|
static @NotNull Object |
json(Object input)
JSON to be used in expected part of the assertion,
|
static @NotNull Object |
value(Object input)
Value passed here is not parsed as JSON but used as it is
|
@NotNull public static @NotNull JsonAssert.ConfigurableJsonAssert assertThatJson(@NotNull @NotNull Object actual)
@NotNull public static @NotNull JsonAssert.ConfigurableJsonAssert assertThatJson(@NotNull @NotNull Object actual, @NotNull JsonAssertions.JsonAssertionCallback... callbacks)
assertThatJson("{\"test1\":2, \"test2\":1}",
json -> json.inPath("test1").isEqualTo(2),
json -> json.inPath("test2").isEqualTo(1)
);
@NotNull public static @NotNull Object json(Object input)
input - Copyright © 2020. All rights reserved.