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

java.lang.NoSuchMethodError due to changed return type in org.springframework.test.web.reactive.server.EntityExchangeResult.getStatus() #1660

Open
mle-idealo opened this issue Feb 1, 2023 · 8 comments

Comments

@mle-idealo
Copy link

We've switched to Spring Boot 3 in conjunction with Spring Framework 6.

While verifying with…

    @TestTarget
    val target = WebFluxTarget(router.manufacturer())

    @TestTemplate
    @ExtendWith(PactVerificationSpringProvider::class)
    fun pactVerificationTestTemplate(context: PactVerificationContext) {
        context.verifyInteraction()
    }

…we are now experiencing the following error…
java.lang.NoSuchMethodError: 'org.springframework.http.HttpStatus org.springframework.test.web.reactive.server.EntityExchangeResult.getStatus()'

If you compare ExchangeResult in Spring Framework 5 it still returns HttpStatus while in Spring Framework 6 it returns HttpStatusCode.

Can you adapt to this new reality?

@ludorival
Copy link

+1 for this

1 similar comment
@ludorival
Copy link

+1 for this

@rholshausen
Copy link
Contributor

rholshausen commented Feb 15, 2023

4.5.0-beta.1 has been released with the new spring6 lib

@mle-idealo
Copy link
Author

Nice one, thank you so far! Now it would be cool, to see this adaption also for the yet-Spring-5 junit5spring provider. :-)

@rholshausen
Copy link
Contributor

Sorry for the confusion, the spring6 lib is only for JUnit 5.

@jefersson-nunezml
Copy link

I have the same error using WebFluxTest

@mle-idealo
Copy link
Author

The recently released spring6 lib solved this issue for me @jefersson-nunezml. Did you already try the new lib?

@jefersson-nunezml
Copy link

I see, I tried now, and it works, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants