Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Future-proof the code that resolves HTTP methods
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)`.
- Loading branch information