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 when trying to run with assertj 3.15.0 on the classpath:
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 currently affects all Spring Boot projects using the milestone M2, M3 or M4 builds of Spring Boot 2.3.0.
The following test:
will throw an error when trying to run with assertj 3.15.0 on the classpath:
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 currently affects all Spring Boot projects using the milestone M2, M3 or M4 builds of Spring Boot 2.3.0.