Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-cloud-netflix
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
spring-cloud-netflix
Commits
913091a7
Commit
913091a7
authored
Aug 19, 2015
by
Spencer Gibb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added test for lists of request parameters
parent
b943a94b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
5 deletions
+22
-5
FeignClientTests.java
...framework/cloud/netflix/feign/valid/FeignClientTests.java
+22
-5
No files found.
spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/feign/valid/FeignClientTests.java
View file @
913091a7
...
...
@@ -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
<
Hello
>
getHellos
();
List
<
Hello
>
getHellos
();
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/hellostrings"
)
public
List
<
String
>
getHelloStrings
();
List
<
String
>
getHelloStrings
();
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/helloheaders"
)
public
List
<
String
>
getHelloHeaders
();
List
<
String
>
getHelloHeaders
();
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/helloparams"
)
List
<
String
>
getParams
(
@RequestParam
(
"params"
)
List
<
String
>
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
<
String
>
getParams
(
@RequestParam
(
"params"
)
List
<
String
>
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
<
String
>
list
=
Arrays
.
asList
(
"a"
,
"1"
,
"test"
);
List
<
String
>
params
=
this
.
testClient
.
getParams
(
list
);
assertNotNull
(
"params was null"
,
params
);
assertEquals
(
"params size was wrong"
,
list
.
size
(),
params
.
size
());
}
@Data
@AllArgsConstructor
@NoArgsConstructor
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment