public class ConfigurationWhen extends Object
Configuration#when(PathsParam, ApplicableForPath...)| Modifier and Type | Class and Description |
|---|---|
static interface |
ConfigurationWhen.ApplicableForPath |
static class |
ConfigurationWhen.PathsParam |
| Modifier and Type | Method and Description |
|---|---|
static ConfigurationWhen.PathsParam |
path(String path)
Adds path conditions.
|
static ConfigurationWhen.PathsParam |
paths(String... paths) |
static ConfigurationWhen.PathsParam |
rootPath() |
static ConfigurationWhen.ApplicableForPath |
then(Option first,
Option... next)
Applies specified options to the object.
|
static ConfigurationWhen.ApplicableForPath |
thenIgnore()
Marks that the object should be ignored.
|
static ConfigurationWhen.ApplicableForPath |
thenNot(Option first,
Option... next)
Explicitly remove options from the objects.
|
public static ConfigurationWhen.PathsParam path(String path)
when(path("[*].a"), then(IGNORING_ARRAY_ORDER))`when(paths("[*].b", "[*].c"), thenIgnore())`when(IGNORING_ARRAY_ORDER).when(path("[*].b"), thenNot(IGNORING_ARRAY_ORDER))public static ConfigurationWhen.PathsParam paths(String... paths)
public static ConfigurationWhen.PathsParam rootPath()
public static ConfigurationWhen.ApplicableForPath then(Option first, Option... next)
thenNot(net.javacrumbs.jsonunit.core.Option, net.javacrumbs.jsonunit.core.Option...) to explicitly remove options from the path.
Option.TREATING_NULL_AS_ABSENT and Option.IGNORING_VALUES expect
paths to the field which supposed to be treated as absent or value-ignored.
Example: when(path("a.b"), then(TREATING_NULL_AS_ABSENT)) for JSON of {"a": 1, "b": null}.
when(path("a.array"), then(IGNORING_ARRAY_ORDER)) for {"a": {"array": [1, 2, 3]}}public static ConfigurationWhen.ApplicableForPath thenNot(Option first, Option... next)
public static ConfigurationWhen.ApplicableForPath thenIgnore()
Copyright © 2020. All rights reserved.