diff --git a/README.md b/README.md
index b35a1258c..7839232f7 100644
--- a/README.md
+++ b/README.md
@@ -137,7 +137,7 @@ To use AssertJ integration, import
net.javacrumbs.json-unit
json-unit-assertj
- 2.36.0
+ 2.36.1
test
```
@@ -170,7 +170,7 @@ To use import
net.javacrumbs.json-unit
json-unit
- 2.36.0
+ 2.36.1
test
```
@@ -215,7 +215,7 @@ To use import
net.javacrumbs.json-unit
json-unit-spring
- 2.36.0
+ 2.36.1
test
```
@@ -259,7 +259,7 @@ Import
net.javacrumbs.json-unit
json-unit-spring
- 2.36.0
+ 2.36.1
test
```
@@ -282,7 +282,7 @@ To use import
net.javacrumbs.json-unit
json-unit-spring
- 2.36.0
+ 2.36.1
test
```
@@ -319,7 +319,7 @@ For other API styles you have to first import JsonPath support module
net.javacrumbs.json-unit
json-unit-json-path
- 2.36.0
+ 2.36.1
test
```
@@ -681,6 +681,10 @@ JsonUnit is licensed under [Apache 2.0 licence](https://www.apache.org/licenses/
Release notes
=============
+## 2.36.1 (2023-01-29)
+* #595 Fix slf4j dependency
+* Dependency updates
+
## 2.36.0 (2022-10-05)
* Support for `node` method in JsonMapAssert #560
* Fixed number parsing in Jackson, so it works as [intended](https://github.com/lukas-krecan/JsonUnit#numbers) (see https://github.com/lukas-krecan/JsonUnit/issues/564 for details)
diff --git a/json-unit-assertj/pom.xml b/json-unit-assertj/pom.xml
index 4026d364f..d4408fbfa 100644
--- a/json-unit-assertj/pom.xml
+++ b/json-unit-assertj/pom.xml
@@ -13,7 +13,7 @@
net.javacrumbs.json-unit
json-unit-parent
- 2.36.1
+ 2.37.0
diff --git a/json-unit-core/pom.xml b/json-unit-core/pom.xml
index 2b2e6f3f5..a86a606f4 100644
--- a/json-unit-core/pom.xml
+++ b/json-unit-core/pom.xml
@@ -24,7 +24,7 @@
net.javacrumbs.json-unit
json-unit-parent
- 2.36.1
+ 2.37.0
diff --git a/json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/Diff.java b/json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/Diff.java
index 440430643..147ad27b6 100644
--- a/json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/Diff.java
+++ b/json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/Diff.java
@@ -69,7 +69,7 @@ public class Diff {
private static final Pattern ANY_STRING_PLACEHOLDER = Pattern.compile("[$#]\\{json-unit.any-string\\}");
private static final Pattern REGEX_PLACEHOLDER = Pattern.compile("[$#]\\{json-unit.regex\\}(.*)");
- private static final Pattern MATCHER_PLACEHOLDER_PATTERN = Pattern.compile("[$#]\\{json-unit.matches:(.+?)\\}(.*)");
+ private static final Pattern MATCHER_PLACEHOLDER_PATTERN = Pattern.compile("[$#]\\{json-unit.matches:(.+?)\\}(.*)", Pattern.DOTALL);
private static final JsonUnitLogger DEFAULT_DIFF_LOGGER = createLogger("net.javacrumbs.jsonunit.difference.diff");
private static final JsonUnitLogger DEFAULT_VALUE_LOGGER = createLogger("net.javacrumbs.jsonunit.difference.values");
diff --git a/json-unit-core/src/test/java/net/javacrumbs/jsonunit/core/internal/DifferenceTest.java b/json-unit-core/src/test/java/net/javacrumbs/jsonunit/core/internal/DifferenceTest.java
index cb850f05d..70150e10c 100644
--- a/json-unit-core/src/test/java/net/javacrumbs/jsonunit/core/internal/DifferenceTest.java
+++ b/json-unit-core/src/test/java/net/javacrumbs/jsonunit/core/internal/DifferenceTest.java
@@ -17,9 +17,12 @@
import net.javacrumbs.jsonunit.core.Configuration;
import net.javacrumbs.jsonunit.core.Option;
+import net.javacrumbs.jsonunit.core.ParametrizedMatcher;
import net.javacrumbs.jsonunit.core.listener.Difference;
import net.javacrumbs.jsonunit.core.listener.DifferenceContext;
import net.javacrumbs.jsonunit.core.listener.DifferenceListener;
+import org.hamcrest.BaseMatcher;
+import org.hamcrest.Description;
import org.junit.jupiter.api.Test;
import java.math.BigDecimal;
@@ -32,6 +35,7 @@
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.nullValue;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class DifferenceTest {
private final RecordingDifferenceListener listener = new RecordingDifferenceListener();
@@ -216,6 +220,13 @@ void shouldSeeExpectedSource() {
assertThat(listener.getExpectedSource(), equalTo(singletonMap("test", "1")));
}
+ @Test
+ void shouldMatchWithLineSeparatorCustomMatcher() {
+ Configuration cfg = commonConfig().withMatcher("equalTo", new EqualsMatcher());
+ Diff diff = Diff.create("{\"key\": \"${json-unit.matches:equalTo}separated \\n line\"}", "{\"key\": \"separated \\n line\"}", "", "", cfg);
+ assertTrue(diff.similar());
+ assertThat(listener.getDifferenceList(), hasSize(0));
+ }
private Configuration commonConfig() {
return Configuration.empty().withDifferenceListener(listener);
@@ -245,4 +256,23 @@ Object getExpectedSource() {
return expectedSource;
}
}
+
+ private static class EqualsMatcher extends BaseMatcher