Closed
Description
In 2.3.0.M2 the assertj version was changed from 3.14.0 to 3.15.0. This version is not fully compatible with XMLUnit 2.6.3 (or 2.6.4). The following test:
@Test
fun `assertThatXml_valueByXPath should work`() {
val xml = """
<fruit>
<color>yellow</color>
</fruit>
"""
assertThatXml(xml).valueByXPath("//color").isEqualTo("yellow")
}
will throw an error:
java.lang.NoSuchMethodError: org.xmlunit.assertj.ValueAssert.describedAs(Ljava/lang/String;[Ljava/lang/Object;)Lorg/assertj/core/api/AbstractAssert;
at org.xmlunit.assertj.ValueAssert.create(ValueAssert.java:68)
at org.xmlunit.assertj.XmlAssert.valueByXPath(XmlAssert.java:202)
The cause is that assertj 3.15.0 moved the `describedAs´method from AbstractAssert to Descriptable and due to type erasure the method return type changed on the byte code level from AbstractAssert to Object.
This issue has been created for XMLUnit: xmlunit/xmlunit#181