diff --git a/allure-jsonunit/src/main/java/io/qameta/allure/jsonunit/AbstractJsonPatchMatcher.java b/allure-jsonunit/src/main/java/io/qameta/allure/jsonunit/AbstractJsonPatchMatcher.java index 6a940d4d..329dbc6c 100644 --- a/allure-jsonunit/src/main/java/io/qameta/allure/jsonunit/AbstractJsonPatchMatcher.java +++ b/allure-jsonunit/src/main/java/io/qameta/allure/jsonunit/AbstractJsonPatchMatcher.java @@ -20,13 +20,15 @@ import org.hamcrest.Matcher; import net.javacrumbs.jsonunit.core.Configuration; +import net.javacrumbs.jsonunit.core.ConfigurationWhen.ApplicableForPath; +import net.javacrumbs.jsonunit.core.ConfigurationWhen.PathsParam; import net.javacrumbs.jsonunit.core.Option; import net.javacrumbs.jsonunit.core.internal.Diff; import net.javacrumbs.jsonunit.core.internal.Options; import net.javacrumbs.jsonunit.core.listener.DifferenceListener; /** - * Сontains basic matcher functionality and implementation of methods for matching configuration. + * Contains basic matcher functionality and implementation of methods for matching configuration. * * @param the type */ @@ -54,6 +56,11 @@ public T when(final Option first, final Option... next) { return (T) this; } + public T when(final PathsParam pathsParam, final ApplicableForPath... applicableForPaths) { + this.configuration = this.configuration.when(pathsParam, applicableForPaths); + return (T) this; + } + public T withOptions(final Options options) { this.configuration = configuration.withOptions(options); return (T) this; diff --git a/allure-jsonunit/src/main/java/io/qameta/allure/jsonunit/AllureConfigurableJsonMatcher.java b/allure-jsonunit/src/main/java/io/qameta/allure/jsonunit/AllureConfigurableJsonMatcher.java index 07851666..3b95e334 100644 --- a/allure-jsonunit/src/main/java/io/qameta/allure/jsonunit/AllureConfigurableJsonMatcher.java +++ b/allure-jsonunit/src/main/java/io/qameta/allure/jsonunit/AllureConfigurableJsonMatcher.java @@ -25,7 +25,9 @@ /** * @param the type of matcher * @see net.javacrumbs.jsonunit.ConfigurableJsonMatcher + * @deprecated Use {@link net.javacrumbs.jsonunit.ConfigurableJsonMatcher} */ +@Deprecated public interface AllureConfigurableJsonMatcher extends Matcher { AllureConfigurableJsonMatcher withTolerance(BigDecimal tolerance); diff --git a/allure-jsonunit/src/main/java/io/qameta/allure/jsonunit/JsonPatchMatcher.java b/allure-jsonunit/src/main/java/io/qameta/allure/jsonunit/JsonPatchMatcher.java index b9f53b13..78bed71e 100644 --- a/allure-jsonunit/src/main/java/io/qameta/allure/jsonunit/JsonPatchMatcher.java +++ b/allure-jsonunit/src/main/java/io/qameta/allure/jsonunit/JsonPatchMatcher.java @@ -17,6 +17,7 @@ import io.qameta.allure.attachment.DefaultAttachmentProcessor; import io.qameta.allure.attachment.FreemarkerAttachmentRenderer; +import net.javacrumbs.jsonunit.ConfigurableJsonMatcher; import net.javacrumbs.jsonunit.core.listener.DifferenceListener; import org.hamcrest.Description; @@ -28,8 +29,8 @@ * @param the type */ @SuppressWarnings("unused") -public final class JsonPatchMatcher extends AbstractJsonPatchMatcher> - implements AllureConfigurableJsonMatcher { +public final class JsonPatchMatcher extends AbstractJsonPatchMatcher> + implements ConfigurableJsonMatcher { private final Object expected; @@ -37,7 +38,7 @@ private JsonPatchMatcher(final Object expected) { this.expected = expected; } - public static AllureConfigurableJsonMatcher jsonEquals(final Object expected) { + public static ConfigurableJsonMatcher jsonEquals(final Object expected) { return new JsonPatchMatcher(expected); }