From e1a31619cc4f03fa55cd84b8488c21cb095fbc5c Mon Sep 17 00:00:00 2001 From: Jonathan Schneider Date: Sat, 10 Jul 2021 14:50:28 -0700 Subject: [PATCH] Polish `@RequestMapping` annotations (#979) Co-authored-by: Moderne Co-authored-by: Moderne --- .../ReactorLoadBalancerExchangeFilterFunctionTests.java | 6 +++--- .../scope/refresh/RefreshEndpointIntegrationTests.java | 4 ++-- .../scope/refresh/RefreshScopeConfigurationTests.java | 8 ++++---- .../scope/refresh/RefreshScopeWebIntegrationTests.java | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/spring-cloud-commons/src/test/java/org/springframework/cloud/client/loadbalancer/reactive/ReactorLoadBalancerExchangeFilterFunctionTests.java b/spring-cloud-commons/src/test/java/org/springframework/cloud/client/loadbalancer/reactive/ReactorLoadBalancerExchangeFilterFunctionTests.java index 5ddcf7a8..963403d6 100644 --- a/spring-cloud-commons/src/test/java/org/springframework/cloud/client/loadbalancer/reactive/ReactorLoadBalancerExchangeFilterFunctionTests.java +++ b/spring-cloud-commons/src/test/java/org/springframework/cloud/client/loadbalancer/reactive/ReactorLoadBalancerExchangeFilterFunctionTests.java @@ -47,7 +47,7 @@ import org.springframework.cloud.client.loadbalancer.Response; import org.springframework.cloud.client.loadbalancer.ResponseData; import org.springframework.context.annotation.Bean; import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.reactive.function.client.ClientResponse; import org.springframework.web.reactive.function.client.WebClient; @@ -160,12 +160,12 @@ class ReactorLoadBalancerExchangeFilterFunctionTests { @RestController static class Config { - @RequestMapping("/hello") + @GetMapping("/hello") public String hello() { return "Hello World"; } - @RequestMapping("/callback") + @GetMapping("/callback") String callbackTestResult() { return "callbackTestResult"; } diff --git a/spring-cloud-context/src/test/java/org/springframework/cloud/context/scope/refresh/RefreshEndpointIntegrationTests.java b/spring-cloud-context/src/test/java/org/springframework/cloud/context/scope/refresh/RefreshEndpointIntegrationTests.java index b916bc61..1da44138 100644 --- a/spring-cloud-context/src/test/java/org/springframework/cloud/context/scope/refresh/RefreshEndpointIntegrationTests.java +++ b/spring-cloud-context/src/test/java/org/springframework/cloud/context/scope/refresh/RefreshEndpointIntegrationTests.java @@ -40,7 +40,7 @@ import org.springframework.http.HttpMethod; import org.springframework.http.MediaType; import org.springframework.http.RequestEntity; import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import static org.assertj.core.api.BDDAssertions.then; @@ -109,7 +109,7 @@ public class RefreshEndpointIntegrationTests { this.message = message; } - @RequestMapping("/") + @GetMapping("/") public String hello() { return this.message; } diff --git a/spring-cloud-context/src/test/java/org/springframework/cloud/context/scope/refresh/RefreshScopeConfigurationTests.java b/spring-cloud-context/src/test/java/org/springframework/cloud/context/scope/refresh/RefreshScopeConfigurationTests.java index 709e6c78..ddba0f64 100644 --- a/spring-cloud-context/src/test/java/org/springframework/cloud/context/scope/refresh/RefreshScopeConfigurationTests.java +++ b/spring-cloud-context/src/test/java/org/springframework/cloud/context/scope/refresh/RefreshScopeConfigurationTests.java @@ -33,7 +33,7 @@ import org.springframework.cloud.context.scope.refresh.RefreshScopeConfiguration import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import static org.assertj.core.api.BDDAssertions.then; @@ -120,7 +120,7 @@ public class RefreshScopeConfigurationTests { @Value("${message:Hello World!}") String message; - @RequestMapping("/") + @GetMapping("/") public String hello() { return this.message; } @@ -140,7 +140,7 @@ public class RefreshScopeConfigurationTests { SpringApplication.run(Application.class, args); } - @RequestMapping("/") + @GetMapping("/") public String hello() { return this.message; } @@ -168,7 +168,7 @@ public class RefreshScopeConfigurationTests { @Value("${message:Hello World!}") String message; - @RequestMapping("/") + @GetMapping("/") // Deliberately use package scope String hello() { return this.message; diff --git a/spring-cloud-context/src/test/java/org/springframework/cloud/context/scope/refresh/RefreshScopeWebIntegrationTests.java b/spring-cloud-context/src/test/java/org/springframework/cloud/context/scope/refresh/RefreshScopeWebIntegrationTests.java index ee62fd3f..8503f4cd 100644 --- a/spring-cloud-context/src/test/java/org/springframework/cloud/context/scope/refresh/RefreshScopeWebIntegrationTests.java +++ b/spring-cloud-context/src/test/java/org/springframework/cloud/context/scope/refresh/RefreshScopeWebIntegrationTests.java @@ -32,7 +32,7 @@ import org.springframework.cloud.context.scope.refresh.RefreshScopeWebIntegratio import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import static org.assertj.core.api.BDDAssertions.then; @@ -94,7 +94,7 @@ public class RefreshScopeWebIntegrationTests { @Value("${message:Hello World!}") String message; - @RequestMapping("/") + @GetMapping("/") public String hello() { return this.message; }