Skip to content

Commit 5649230

Browse files
authored
chore(allure-jsonunit): deprecate AllureConfigurableJsonMatcher in favor of ConfigurableJsonMatcher (via #1060)
1 parent 71ec65c commit 5649230

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

allure-jsonunit/src/main/java/io/qameta/allure/jsonunit/AbstractJsonPatchMatcher.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,15 @@
2020
import org.hamcrest.Matcher;
2121

2222
import net.javacrumbs.jsonunit.core.Configuration;
23+
import net.javacrumbs.jsonunit.core.ConfigurationWhen.ApplicableForPath;
24+
import net.javacrumbs.jsonunit.core.ConfigurationWhen.PathsParam;
2325
import net.javacrumbs.jsonunit.core.Option;
2426
import net.javacrumbs.jsonunit.core.internal.Diff;
2527
import net.javacrumbs.jsonunit.core.internal.Options;
2628
import net.javacrumbs.jsonunit.core.listener.DifferenceListener;
2729

2830
/**
29-
* Сontains basic matcher functionality and implementation of methods for matching configuration.
31+
* Contains basic matcher functionality and implementation of methods for matching configuration.
3032
*
3133
* @param <T> the type
3234
*/
@@ -54,6 +56,11 @@ public T when(final Option first, final Option... next) {
5456
return (T) this;
5557
}
5658

59+
public T when(final PathsParam pathsParam, final ApplicableForPath... applicableForPaths) {
60+
this.configuration = this.configuration.when(pathsParam, applicableForPaths);
61+
return (T) this;
62+
}
63+
5764
public T withOptions(final Options options) {
5865
this.configuration = configuration.withOptions(options);
5966
return (T) this;

allure-jsonunit/src/main/java/io/qameta/allure/jsonunit/AllureConfigurableJsonMatcher.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
/**
2626
* @param <T> the type of matcher
2727
* @see net.javacrumbs.jsonunit.ConfigurableJsonMatcher
28+
* @deprecated Use {@link net.javacrumbs.jsonunit.ConfigurableJsonMatcher}
2829
*/
30+
@Deprecated
2931
public interface AllureConfigurableJsonMatcher<T> extends Matcher<T> {
3032

3133
AllureConfigurableJsonMatcher<T> withTolerance(BigDecimal tolerance);

allure-jsonunit/src/main/java/io/qameta/allure/jsonunit/JsonPatchMatcher.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import io.qameta.allure.attachment.DefaultAttachmentProcessor;
1919
import io.qameta.allure.attachment.FreemarkerAttachmentRenderer;
20+
import net.javacrumbs.jsonunit.ConfigurableJsonMatcher;
2021
import net.javacrumbs.jsonunit.core.listener.DifferenceListener;
2122

2223
import org.hamcrest.Description;
@@ -28,16 +29,16 @@
2829
* @param <T> the type
2930
*/
3031
@SuppressWarnings("unused")
31-
public final class JsonPatchMatcher<T> extends AbstractJsonPatchMatcher<AllureConfigurableJsonMatcher<T>>
32-
implements AllureConfigurableJsonMatcher<T> {
32+
public final class JsonPatchMatcher<T> extends AbstractJsonPatchMatcher<ConfigurableJsonMatcher<T>>
33+
implements ConfigurableJsonMatcher<T> {
3334

3435
private final Object expected;
3536

3637
private JsonPatchMatcher(final Object expected) {
3738
this.expected = expected;
3839
}
3940

40-
public static <T> AllureConfigurableJsonMatcher<T> jsonEquals(final Object expected) {
41+
public static <T> ConfigurableJsonMatcher<T> jsonEquals(final Object expected) {
4142
return new JsonPatchMatcher<T>(expected);
4243
}
4344

0 commit comments

Comments
 (0)