diff --git a/spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/feign/valid/FeignClientTests.java b/spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/feign/valid/FeignClientTests.java index 66d9de61..e611ac27 100644 --- a/spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/feign/valid/FeignClientTests.java +++ b/spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/feign/valid/FeignClientTests.java @@ -54,6 +54,7 @@ import org.springframework.util.ReflectionUtils; import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import com.netflix.loadbalancer.BaseLoadBalancer; @@ -92,22 +93,25 @@ public class FeignClientTests { @FeignClient("localapp") protected static interface TestClient { @RequestMapping(method = RequestMethod.GET, value = "/hello") - public Hello getHello(); + Hello getHello(); @RequestMapping(method = RequestMethod.GET, value = "/hellos") - public List getHellos(); + List getHellos(); @RequestMapping(method = RequestMethod.GET, value = "/hellostrings") - public List getHelloStrings(); + List getHelloStrings(); @RequestMapping(method = RequestMethod.GET, value = "/helloheaders") - public List getHelloHeaders(); + List getHelloHeaders(); + + @RequestMapping(method = RequestMethod.GET, value = "/helloparams") + List getParams(@RequestParam("params") List params); } @FeignClient(serviceId = "localapp") protected static interface TestClientServiceId { @RequestMapping(method = RequestMethod.GET, value = "/hello") - public Hello getHello(); + Hello getHello(); } @Configuration @@ -165,6 +169,11 @@ public class FeignClientTests { return headers; } + @RequestMapping(method = RequestMethod.GET, value = "/helloparams") + public List getParams(@RequestParam("params") List params) { + return params; + } + public static void main(String[] args) { new SpringApplicationBuilder(Application.class).properties( "spring.application.name=feignclienttest", @@ -229,6 +238,14 @@ public class FeignClientTests { assertEquals("first hello didn't match", new Hello("hello world 1"), hello); } + @Test + public void testParams() { + List list = Arrays.asList("a", "1", "test"); + List params = this.testClient.getParams(list); + assertNotNull("params was null", params); + assertEquals("params size was wrong", list.size(), params.size()); + } + @Data @AllArgsConstructor @NoArgsConstructor