Skip to content

Commit

Permalink
Merge pull request #212 from mmathesius/exception-format-update
Browse files Browse the repository at this point in the history
Adjust ValueAssertTest for changed format of mismatched string exception
  • Loading branch information
bodewig committed Feb 4, 2021
2 parents 5b66f10 + 87796e0 commit f7d5a28
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 f7d5a28

Please sign in to comment.