Skip to content

Commit

Permalink
Make ValueAssertTest less sensitive to AssertJ version
Browse files Browse the repository at this point in the history
Signed-off-by: Merlin Mathesius <mmathesi@redhat.com>
  • Loading branch information
mmathesius committed Feb 3, 2021
1 parent 5b66f10 commit 87796e0
Showing 1 changed file with 8 additions and 1 deletion.
Expand Up @@ -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;
Expand Down Expand Up @@ -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>";

Expand Down

0 comments on commit 87796e0

Please sign in to comment.