Class JsonAssert.ConfigurableJsonAssert
java.lang.Object
org.assertj.core.api.AbstractAssert<JsonAssert, Object>
net.javacrumbs.jsonunit.assertj.JsonAssert
net.javacrumbs.jsonunit.assertj.JsonAssert.ConfigurableJsonAssert
- All Implemented Interfaces:
org.assertj.core.api.Assert<JsonAssert, Object>, org.assertj.core.api.Descriptable<JsonAssert>, org.assertj.core.api.ExtensionPoints<JsonAssert, Object>
- Enclosing class:
JsonAssert
JsonAssert that can be configured to prevent mistakes like
assertThatJson(...).isEqualsTo(...).when(...);
-
Nested Class Summary
Nested classes/interfaces inherited from class JsonAssert
JsonAssert.ConfigurableJsonAssert -
Field Summary
Fields inherited from class org.assertj.core.api.AbstractAssert
actual, info, myself, objects, throwUnsupportedExceptionOnEquals -
Method Summary
Modifier and TypeMethodDescriptionas(org.assertj.core.description.Description description) describedAs(String description, Object... args) describedAs(org.assertj.core.description.Description description) when(net.javacrumbs.jsonunit.core.ConfigurationWhen.PathsParam object, net.javacrumbs.jsonunit.core.ConfigurationWhen.ApplicableForPath... actions) Adds path specific options.when(net.javacrumbs.jsonunit.core.Option first, net.javacrumbs.jsonunit.core.Option... other) Adds comparison options.whenIgnoringPaths(String... pathsToBeIgnored) Makes JsonUnit ignore the specified paths in the actual value.withConfiguration(Function<net.javacrumbs.jsonunit.core.Configuration, net.javacrumbs.jsonunit.core.Configuration> configurationFunction) Allows to configure like thisassertThatJson(...) .withConfiguration(c -> c.withMatcher("positive", greaterThan(valueOf(0))) ....withDifferenceListener(net.javacrumbs.jsonunit.core.listener.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.withOptions(Collection<net.javacrumbs.jsonunit.core.Option> optionsToAdd) Adds comparison options.withOptions(net.javacrumbs.jsonunit.core.Option first, net.javacrumbs.jsonunit.core.Option... next) Adds comparison options.withTolerance(double tolerance) Sets numerical comparison tolerance.withTolerance(@Nullable BigDecimal tolerance) Sets numerical comparison tolerance.Methods inherited from class JsonAssert
and, asInstanceOf, asNumber, asString, isAbsent, isArray, isBoolean, isEqualTo, isIntegralNumber, isNotNull, isNull, isNumber, isObject, isPresent, isString, isStringEqualTo, isUri, nodeMethods inherited from class org.assertj.core.api.AbstractAssert
actual, areEqual, asList, assertionError, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, doesNotHaveToString, doesNotMatch, doesNotMatch, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, hasToString, inBinary, inHexadecimal, is, isElementOfCustomAssert, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotOfAnyClassIn, isNotSameAs, isOfAnyClassIn, isSameAs, matches, matches, newListAssertInstance, overridingErrorMessage, overridingErrorMessage, satisfies, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOfForProxy, satisfiesForProxy, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, usingEquals, usingEquals, usingRecursiveAssertion, usingRecursiveAssertion, usingRecursiveComparison, usingRecursiveComparison, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnErrorMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.assertj.core.api.Descriptable
as, describedAs
-
Method Details
-
when
public JsonAssert.ConfigurableJsonAssert when(net.javacrumbs.jsonunit.core.Option first, net.javacrumbs.jsonunit.core.Option... other) Adds comparison options. -
when
public final JsonAssert.ConfigurableJsonAssert when(net.javacrumbs.jsonunit.core.ConfigurationWhen.PathsParam object, net.javacrumbs.jsonunit.core.ConfigurationWhen.ApplicableForPath... actions) Adds path specific options.- See Also:
-
withOptions
public JsonAssert.ConfigurableJsonAssert withOptions(net.javacrumbs.jsonunit.core.Option first, net.javacrumbs.jsonunit.core.Option... next) Adds comparison options. -
withOptions
public JsonAssert.ConfigurableJsonAssert withOptions(Collection<net.javacrumbs.jsonunit.core.Option> optionsToAdd) Adds comparison options. -
withConfiguration
public JsonAssert.ConfigurableJsonAssert withConfiguration(Function<net.javacrumbs.jsonunit.core.Configuration, net.javacrumbs.jsonunit.core.Configuration> configurationFunction) Allows to configure like thisassertThatJson(...) .withConfiguration(c -> c.withMatcher("positive", greaterThan(valueOf(0))) .... -
withTolerance
Sets numerical comparison tolerance. -
withTolerance
Sets numerical comparison tolerance. -
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 -
withIgnorePlaceholder
Sets ignore placeholder. -
withMatcher
public JsonAssert.ConfigurableJsonAssert withMatcher(String matcherName, org.hamcrest.Matcher<?> matcher) Adds a matcher to be used in ${json-unit.matches:matcherName} macro. -
withDifferenceListener
public JsonAssert.ConfigurableJsonAssert withDifferenceListener(net.javacrumbs.jsonunit.core.listener.DifferenceListener differenceListener) Sets difference listener -
inPath
-
describedAs
public JsonAssert.ConfigurableJsonAssert describedAs(org.assertj.core.description.Description description) - Specified by:
describedAsin interfaceorg.assertj.core.api.Descriptable<JsonAssert>- Overrides:
describedAsin classorg.assertj.core.api.AbstractAssert<JsonAssert, Object>
-
describedAs
-
as
-
as
-