Package net.javacrumbs.jsonunit.core
Class ConfigurationWhen
- java.lang.Object
-
- net.javacrumbs.jsonunit.core.ConfigurationWhen
-
public class ConfigurationWhen extends Object
Everything forConfiguration.when(PathsParam, ApplicableForPath...)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceConfigurationWhen.ApplicableForPathstatic classConfigurationWhen.PathsParam
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ConfigurationWhen.PathsParampath(String path)Adds path conditions.static ConfigurationWhen.PathsParampaths(String... paths)static ConfigurationWhen.PathsParamrootPath()static ConfigurationWhen.ApplicableForPaththen(Option first, Option... next)Applies specified options to the object.static ConfigurationWhen.ApplicableForPaththenIgnore()Marks that the object should be ignored.static ConfigurationWhen.ApplicableForPaththenNot(Option first, Option... next)Explicitly remove options from the objects.
-
-
-
Method Detail
-
path
public static ConfigurationWhen.PathsParam path(String path)
Adds path conditions. Examples:- Ignore order for [*].a:
when(path("[*].a"), then(IGNORING_ARRAY_ORDER))` - Fully ignore multiple paths:
when(paths("[*].b", "[*].c"), thenIgnore())` - Ignore array order for every path except [*].b:
when(IGNORING_ARRAY_ORDER).when(path("[*].b"), thenNot(IGNORING_ARRAY_ORDER))
- Ignore order for [*].a:
-
paths
public static ConfigurationWhen.PathsParam paths(String... paths)
-
rootPath
public static ConfigurationWhen.PathsParam rootPath()
-
then
public static ConfigurationWhen.ApplicableForPath then(Option first, Option... next)
Applies specified options to the object. UsethenNot(net.javacrumbs.jsonunit.core.Option, net.javacrumbs.jsonunit.core.Option...)to explicitly remove options from the path.
When passing a path, optionsOption.TREATING_NULL_AS_ABSENTandOption.IGNORING_VALUESexpect 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}.
For any other option specify the path to an object with ignorable child fields, or path to an array:when(path("a.array"), then(IGNORING_ARRAY_ORDER))for{"a": {"array": [1, 2, 3]}}
-
thenNot
public static ConfigurationWhen.ApplicableForPath thenNot(Option first, Option... next)
Explicitly remove options from the objects.
-
thenIgnore
public static ConfigurationWhen.ApplicableForPath thenIgnore()
Marks that the object should be ignored.
-
-