/** * Adds a matcher to be used in ${json-unit.matches:matcherName} macro. * * @param matcherName * @param matcher * @return */ public Configuration withMatcher(String matcherName, Matcher<?> matcher) { return new Configuration(tolerance, options, ignorePlaceholder, matchers.with(matcherName, matcher), pathsToBeIgnored, differenceListener); }
/** * Creates empty configuration and sets options. */ public static Configuration when(Option first, Option... next) { return Configuration.empty().withOptions(first, next); }
/** * Sets listener to customize diff format */ public static void setDifferenceListener(DifferenceListener listener) { configuration = configuration.withDifferenceListener(listener); }
/** * Creates empty configuration and sets numerical comparison tolerance. */ public static Configuration withTolerance(double tolerance) { return Configuration.empty().withTolerance(tolerance); }
/** * Sets DifferenceListener. */ public static Configuration withDifferenceListener(DifferenceListener differenceListener) { return Configuration.empty().withDifferenceListener(differenceListener); } }
/** * Adds a matcher to be used in ${json-unit.matches:matcherName} macro. */ public static Configuration withMatcher(String matcherName, Matcher<?> matcher) { return Configuration.empty().withMatcher(matcherName, matcher); }
/** * Sets paths to be ignored. */ public static Configuration whenIgnoringPaths(String... paths) { return Configuration.empty().whenIgnoringPaths(paths); }
/** * Sets the tolerance for floating number comparison. If set to null, requires exact match of the values. * For example, if set to 0.01, ignores all differences lower than 0.01, so 1 and 0.9999 are considered equal. */ public static void setTolerance(BigDecimal numericComparisonTolerance) { configuration = configuration.withTolerance(numericComparisonTolerance); }
/** * Adds comparison options. * * @param first * @param next * @return */ public Configuration when(Option first, Option... next) { return withOptions(first, next); }
/** * Set's string that will be ignored in comparison. Default value is "${json-unit.ignore}" */ public static void setIgnorePlaceholder(String ignorePlaceholder) { configuration = configuration.withIgnorePlaceholder(ignorePlaceholder); }
/** * Sets comparison options. * * @param options * @return */ public Configuration withOptions(Options options) { return new Configuration(tolerance, options, ignorePlaceholder, matchers, pathsToBeIgnored, differenceListener); }
/** * Creates empty configuration and sets numerical comparison tolerance. */ public static Configuration withTolerance(BigDecimal tolerance) { return Configuration.empty().withTolerance(tolerance); }
/** * Adds a matcher to be used in ${json-unit.matches:matcherName} macro. */ public static Configuration withMatcher(String matcherName, Matcher<?> matcher) { return Configuration.empty().withMatcher(matcherName, matcher); }
/** * Sets the tolerance for floating number comparison. If set to null, requires exact match of the values. * For example, if set to 0.01, ignores all differences lower than 0.01, so 1 and 0.9999 are considered equal. */ public static void setTolerance(double numberComparisonTolerance) { configuration = configuration.withTolerance(numberComparisonTolerance); }
public ConfigurableJsonMatcher<T> withDifferenceListener(DifferenceListener differenceListener) { configuration = configuration.withDifferenceListener(differenceListener); return this; } }
/** * Adds a matcher to be used in ${json-unit.matches:matcherName} macro. * * @param matcherName * @param matcher * @return */ public Configuration withMatcher(String matcherName, Matcher<?> matcher) { return new Configuration(tolerance, options, ignorePlaceholder, matchers.with(matcherName, matcher), pathsToBeIgnored, differenceListener); }
/** * Sets numerical comparison tolerance. * * @param tolerance * @return */ public Configuration withTolerance(BigDecimal tolerance) { return new Configuration(tolerance, options, ignorePlaceholder, matchers, pathsToBeIgnored, differenceListener); }
/** * Creates empty configuration and sets numerical comparison tolerance. */ public static Configuration withTolerance(double tolerance) { return Configuration.empty().withTolerance(tolerance); }
/** * Sets the tolerance for floating number comparison. If set to null, requires exact match of the values. * For example, if set to 0.01, ignores all differences lower than 0.01, so 1 and 0.9999 are considered equal. */ public static void setTolerance(double numberComparisonTolerance) { configuration = configuration.withTolerance(numberComparisonTolerance); }
/** * Creates empty configuration and sets numerical comparison tolerance. */ public static Configuration withTolerance(BigDecimal tolerance) { return Configuration.empty().withTolerance(tolerance); }