Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.3.0.M2 assertj version incompatible with XMLUnit #21178

Closed
jwalter opened this issue Apr 28, 2020 · 1 comment
Closed

2.3.0.M2 assertj version incompatible with XMLUnit #21178

jwalter opened this issue Apr 28, 2020 · 1 comment
Labels
for: external-project For an external project and not something we can fix status: invalid An issue that we don't feel is valid

Comments

@jwalter
Copy link

jwalter commented Apr 28, 2020

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

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 28, 2020
@wilkinsona
Copy link
Member

Thanks for letting us know. Given that the problem only affects those using AssertJ and XMLUnit, we don't want to downgrade AssertJ as that will affect everyone that uses AssertJ. Hopefully the problem will be addressed in a future version of AssertJ or XMLUnit which we'll pick up in due course as part of our dependency upgrade process.

@wilkinsona wilkinsona added for: external-project For an external project and not something we can fix status: invalid An issue that we don't feel is valid and removed status: waiting-for-triage An issue we've not yet triaged labels Apr 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: external-project For an external project and not something we can fix status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

3 participants