Skip to content

2.3.0.M2 assertj version incompatible with XMLUnit #21178

Closed
@jwalter

Description

@jwalter

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: external-projectFor an external project and not something we can fixstatus: invalidAn issue that we don't feel is valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions