Adjust ValueAssertTest for changed format of mismatched string exception#212
Conversation
|
Actually running The test is not related to the line you mention, it verifies the error message created by AssertJ's |
|
I think assertj/assertj@5ae16a9 is responsible for the test failure. It went into AssertJ 3.19.0. The xmlunit-assertj module explicitly wants to support AssertJ 2.x and we encourage users to use xmlunit-assertj3 if they want to use AssertJ 3.x instead. I see a couple of options:
most likely we'll end up with the last option but maybe I'm overlooking something. If we want to allow either message pattern, we should do so as strictly as possible. A test that only looked for the presense of substrings would miss bugs like #210. |
|
please take a look at https://github.com/xmlunit/xmlunit/compare/212-prototype?expand=1 - if this works for you, I'll expand it to the assertj3 module and add a compat-test for AssertJ 3.19.0 |
|
@bodewig Thanks for the feedback and improved patch! I checked your proposed patch with a Fedora build and it almost works. The |
Signed-off-by: Merlin Mathesius <mmathesi@redhat.com>
|
thanks. If you were building XMLUnit 2.8.x you'd get related issues for the xmlunit-assertj3 module, it looks as if I needed to adjust more patterns there. |
0b82673 to
87796e0
Compare
|
@bodewig I just updated this PR with the improved patch. The package in Fedora is still using 2.7.0, and this patch is sufficient for that. Thanks again! |
|
Many thanks |
This fix is required when building the
xmlunitpackage for recent versions of Fedora.It also corresponds to the exception message format that should be generated by the
xmlunitcode:xmlunit/xmlunit-assertj/src/main/java/org/xmlunit/assertj/error/ComparisonFailureErrorFactory.java
Line 31 in 5b66f10
However, running the tests directly using
mvn clean testfail with this fix because the old format exception message is returned. (Unfortunately, I don't know Java well enough to be able to explain why!)