Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 <T> the type
*/
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
/**
* @param <T> the type of matcher
* @see net.javacrumbs.jsonunit.ConfigurableJsonMatcher
* @deprecated Use {@link net.javacrumbs.jsonunit.ConfigurableJsonMatcher}
*/
@Deprecated
public interface AllureConfigurableJsonMatcher<T> extends Matcher<T> {

AllureConfigurableJsonMatcher<T> withTolerance(BigDecimal tolerance);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -28,16 +29,16 @@
* @param <T> the type
*/
@SuppressWarnings("unused")
public final class JsonPatchMatcher<T> extends AbstractJsonPatchMatcher<AllureConfigurableJsonMatcher<T>>
implements AllureConfigurableJsonMatcher<T> {
public final class JsonPatchMatcher<T> extends AbstractJsonPatchMatcher<ConfigurableJsonMatcher<T>>
implements ConfigurableJsonMatcher<T> {

private final Object expected;

private JsonPatchMatcher(final Object expected) {
this.expected = expected;
}

public static <T> AllureConfigurableJsonMatcher<T> jsonEquals(final Object expected) {
public static <T> ConfigurableJsonMatcher<T> jsonEquals(final Object expected) {
return new JsonPatchMatcher<T>(expected);
}

Expand Down