-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Error java.lang.NoSuchMethodError for HttpMethod.resolve(). #1760
Comments
Same for me here, too. Seems the actual version of rest-assured is not fully compatible with spring 6.x. I use the concrete methods now, e.g. instead of
I use
|
d0vi
added a commit
to d0vi/rest-assured
that referenced
this issue
Jan 31, 2024
On Spring Framework 5, `HttpMethod` is an enum type that exposes a `resolve(java.lang.String)` method that matches the String value passed with the enum value while handling null values gracefully. However, in the context of `toValidHttpMethod(java.lang.String)`, there is a previous assertion that ensures `null` will not be passed moving forward. Hence, using enum's native `valueOf` directly seems like a good idea. Furthermore, Spring Framework 6.0 marked `HttpMethod#resolve(java.lang.String)` as deprecated for removal, and starting from Spring Framework 6.1 this API element no longer exists. This change is currently causing issues (rest-assured#1760) with latest Spring Framework and Spring Boot versions. This commit replaces the use of this method with the equivalent `HttpMethod#valueOf(java.lang.String)`.
felhag
added a commit
to felhag/rest-assured
that referenced
this issue
Mar 28, 2024
Any updates on this? Created a similar pull request to fix WebTestClientRequestSenderImpl: |
d0vi
added a commit
to d0vi/rest-assured
that referenced
this issue
Apr 1, 2024
On Spring Framework 5 `HttpMethod` is an enum type that exposes a `resolve(java.lang.String)` method that matches the String value passed with the enum value while handling null values gracefully. However, in the context of `toValidHttpMethod(java.lang.String)`, there is a previous assertion that ensures `null` will not be passed moving forward. Hence, using enum's native `valueOf` directly seems like a good idea. Furthermore, Spring Framework 6.0 marked `HttpMethod#resolve(java.lang.String)` as deprecated for removal, and starting from Spring Framework 6.1 this API element no longer exists. This change is currently causing issues (rest-assured#1760) with latest Spring Framework and Spring Boot versions. This commit replaces the use of this method with the equivalent `HttpMethod#valueOf(java.lang.String)`. Closes rest-assured#1760.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When upgrading my project to Spring Boot 3.2.1, I get the following error:
'org.springframework.http.HttpMethod org.springframework.http.HttpMethod.resolve(java.lang.String)' java.lang.NoSuchMethodError: 'org.springframework.http.HttpMethod org.springframework.http.HttpMethod.resolve(java.lang.String)' at io.restassured.module.mockmvc.internal.MockMvcRequestSenderImpl.toValidHttpMethod(MockMvcRequestSenderImpl.java:855) at io.restassured.module.mockmvc.internal.MockMvcRequestSenderImpl.request(MockMvcRequestSenderImpl.java:805) at io.restassured.module.mockmvc.internal.MockMvcRequestSenderImpl.request(MockMvcRequestSenderImpl.java:801) at io.restassured.module.mockmvc.internal.MockMvcRequestSenderImpl.request(MockMvcRequestSenderImpl.java:105) at io.restassured.module.mockmvc.internal.MockMvcRequestSpecificationImpl.request(MockMvcRequestSpecificationImpl.java:759) at io.restassured.module.mockmvc.internal.MockMvcRequestSpecificationImpl.request(MockMvcRequestSpecificationImpl.java:65)
HttpMethod.resolve() is used with Spring-web 6.0.15 at the latest: https://docs.spring.io/spring-framework/docs/6.0.15/javadoc-api/org/springframework/http/HttpMethod.html.
What is the recommended way?
The text was updated successfully, but these errors were encountered: