41 lines
1.6 KiB
Diff
41 lines
1.6 KiB
Diff
|
From 87796e0a6460e8ef22d82ca8e83b14c89ce492e5 Mon Sep 17 00:00:00 2001
|
||
|
From: Merlin Mathesius <mmathesi@redhat.com>
|
||
|
Date: Wed, 3 Feb 2021 09:04:58 -0600
|
||
|
Subject: [PATCH] Make ValueAssertTest less sensitive to AssertJ version
|
||
|
|
||
|
Signed-off-by: Merlin Mathesius <mmathesi@redhat.com>
|
||
|
---
|
||
|
.../test/java/org/xmlunit/assertj/ValueAssertTest.java | 9 ++++++++-
|
||
|
1 file changed, 8 insertions(+), 1 deletion(-)
|
||
|
|
||
|
diff --git a/xmlunit-assertj/src/test/java/org/xmlunit/assertj/ValueAssertTest.java b/xmlunit-assertj/src/test/java/org/xmlunit/assertj/ValueAssertTest.java
|
||
|
index c3712b7..694af41 100644
|
||
|
--- a/xmlunit-assertj/src/test/java/org/xmlunit/assertj/ValueAssertTest.java
|
||
|
+++ b/xmlunit-assertj/src/test/java/org/xmlunit/assertj/ValueAssertTest.java
|
||
|
@@ -24,6 +24,7 @@
|
||
|
import java.io.ByteArrayInputStream;
|
||
|
import java.nio.charset.StandardCharsets;
|
||
|
import java.util.HashMap;
|
||
|
+import java.util.regex.Pattern;
|
||
|
|
||
|
import javax.xml.parsers.DocumentBuilder;
|
||
|
import javax.xml.parsers.DocumentBuilderFactory;
|
||
|
@@ -263,7 +264,13 @@ public void testIsEqualTo_withAttributeValueExpression_shouldPass() {
|
||
|
@Test
|
||
|
public void testIsEqualTo_withAttributeValueExpression_shouldFailed() {
|
||
|
|
||
|
- thrown.expectAssertionError("expected:<\"[something]\"> but was:<\"[abc]\">");
|
||
|
+ thrown.expectAssertionErrorPattern(".*("
|
||
|
+ // AssertJ since "forever"
|
||
|
+ + Pattern.quote("expected:<\"[something]\"> but was:<\"[abc]\">")
|
||
|
+ + "|"
|
||
|
+ // AssertJ 3.19.0+
|
||
|
+ + Pattern.quote("Expecting:\n <\"abc\">\nto be equal to:\n <\"something\">\nbut was not.")
|
||
|
+ + ")");
|
||
|
|
||
|
String xml = "<a><b attr=\"abc\"></b></a>";
|
||
|
|
||
|
--
|
||
|
2.25.1
|
||
|
|