This is an automated email from the ASF dual-hosted git repository.
ahuber pushed a commit to branch spring6
in repository https://gitbox.apache.org/repos/asf/causeway.git
The following commit(s) were added to refs/heads/spring6 by this push:
new b189a1c900 CAUSEWAY-3684: implements
_DocumentTester.assertYamlEqualsIgnoreOrder
b189a1c900 is described below
commit b189a1c9005c0d88bf9262206af1bc2f17c4a17c
Author: andi-huber <[email protected]>
AuthorDate: Sun Jan 28 15:48:43 2024 +0100
CAUSEWAY-3684: implements _DocumentTester.assertYamlEqualsIgnoreOrder
---
.../apache/causeway/commons/internal/testing/_DocumentTester.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git
a/commons/src/main/java/org/apache/causeway/commons/internal/testing/_DocumentTester.java
b/commons/src/main/java/org/apache/causeway/commons/internal/testing/_DocumentTester.java
index 8e596f8847..7cdcc1a58f 100644
---
a/commons/src/main/java/org/apache/causeway/commons/internal/testing/_DocumentTester.java
+++
b/commons/src/main/java/org/apache/causeway/commons/internal/testing/_DocumentTester.java
@@ -19,6 +19,7 @@
package org.apache.causeway.commons.internal.testing;
import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import org.apache.causeway.commons.internal.assertions._Assert;
import org.apache.causeway.commons.internal.codec._DocumentFactories;
@@ -48,10 +49,10 @@ public class _DocumentTester {
_Assert.assertEquals(mapper.readTree(json1), mapper.readTree(json2));
}
+ @SneakyThrows
public void assertYamlEqualsIgnoreOrder(final @NonNull String yaml1, final
@NonNull String yaml2) {
- // TODO not implemented yet
- System.err.printf("WARNING: %s.assertYamlEqualsIgnoreOrder(...) not
implemened%n",
- _DocumentTester.class.getSimpleName());
+ var mapper = new ObjectMapper(new YAMLFactory());
+ _Assert.assertEquals(mapper.readTree(yaml1), mapper.readTree(yaml2));
}
}