Class Configuration
java.lang.Object
net.javacrumbs.jsonunit.core.Configuration
Comparison configuration. Immutable.
-
Method Summary
Modifier and TypeMethodDescriptionstatic DifferenceListenerstatic Configurationempty()Returns an empty configuration.@Nullable org.hamcrest.Matcher<?> getMatcher(String matcherName) @Nullable BigDecimalbooleanshouldIgnore(String expectedValue) final Configurationwhen(ConfigurationWhen.PathsParam object, ConfigurationWhen.ApplicableForPath... actions) Defines general comparison options.Adds comparison options.whenIgnoringPaths(String... pathsToBeIgnored) Makes JsonUnit ignore the specified paths in the actual value.whenIgnoringPaths(Collection<String> pathsToBeIgnored) withDifferenceListener(DifferenceListener differenceListener) Sets difference listenerwithIgnorePlaceholder(String ignorePlaceholder) Sets ignore placeholder.withMatcher(String matcherName, org.hamcrest.Matcher<?> matcher) Adds a matcher to be used in ${json-unit.matches:matcherName} macro.withNumberComparator(NumberComparator numberComparator) Sets Number comparatorwithOptions(Collection<Option> optionsToAdd) Adds comparison options.withOptions(Option first, Option... next) Adds comparison options.withPathOptions(List<PathOption> pathOptions) withTolerance(double tolerance) Sets numerical comparison tolerance.withTolerance(@Nullable BigDecimal tolerance) Sets numerical comparison tolerance.
-
Method Details
-
empty
Returns an empty configuration. -
withTolerance
Sets numerical comparison tolerance. -
withTolerance
Sets numerical comparison tolerance. -
when
Adds comparison options. -
withOptions
Adds comparison options. -
withOptions
Adds comparison options. -
resetOptions
-
when
public final Configuration when(ConfigurationWhen.PathsParam object, ConfigurationWhen.ApplicableForPath... actions) Defines general comparison options. SeeConfigurationWhen.path(String)for some examples.- Parameters:
object- an object to apply actions, e.g.ConfigurationWhen.path(String),ConfigurationWhen.rootPath().actions- actions to be applied on the object.- See Also:
-
withPathOptions
-
whenIgnoringPaths
-
whenIgnoringPaths
Makes JsonUnit ignore the specified paths in the actual value. If the path matches, it's completely ignored. It may be missing, null or have any value- See Also:
-
withIgnorePlaceholder
Sets ignore placeholder. -
withMatcher
Adds a matcher to be used in ${json-unit.matches:matcherName} macro. -
withDifferenceListener
Sets difference listener -
withNumberComparator
Sets Number comparator -
dummyDifferenceListener
-
getMatcher
-
getTolerance
-
getOptions
-
getIgnorePlaceholder
-
getPathOptions
-
getPathsToBeIgnored
-
getDifferenceListener
-
getNumberComparator
-
shouldIgnore
-