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
c15fb33f
Commit
c15fb33f
authored
Sep 14, 2015
by
Spencer Gibb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add ResponseEntity<Void> feign test
see gh-539
parent
4037f4ca
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
SpringDecoderTests.java
...ringframework/cloud/netflix/feign/SpringDecoderTests.java
+19
-0
No files found.
spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/feign/SpringDecoderTests.java
View file @
c15fb33f
...
@@ -95,6 +95,17 @@ public class SpringDecoderTests extends FeignClientFactoryBean {
...
@@ -95,6 +95,17 @@ public class SpringDecoderTests extends FeignClientFactoryBean {
assertEquals
(
"first hello didn't match"
,
"hello world 1"
,
hellos
.
get
(
0
));
assertEquals
(
"first hello didn't match"
,
"hello world 1"
,
hellos
.
get
(
0
));
}
}
@Test
public
void
testResponseEntityVoid
()
{
ResponseEntity
<
Void
>
response
=
testClient
().
getHelloVoid
();
assertNotNull
(
"response was null"
,
response
);
List
<
String
>
headerVals
=
response
.
getHeaders
().
get
(
"X-test-header"
);
assertNotNull
(
"headerVals was null"
,
headerVals
);
assertEquals
(
"headerVals size was wrong"
,
1
,
headerVals
.
size
());
String
header
=
headerVals
.
get
(
0
);
assertEquals
(
"header was wrong"
,
"myval"
,
header
);
}
@Data
@Data
@AllArgsConstructor
@AllArgsConstructor
@NoArgsConstructor
@NoArgsConstructor
...
@@ -106,6 +117,9 @@ public class SpringDecoderTests extends FeignClientFactoryBean {
...
@@ -106,6 +117,9 @@ public class SpringDecoderTests extends FeignClientFactoryBean {
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/helloresponse"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/helloresponse"
)
public
ResponseEntity
<
Hello
>
getHelloResponse
();
public
ResponseEntity
<
Hello
>
getHelloResponse
();
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/hellovoid"
)
public
ResponseEntity
<
Void
>
getHelloVoid
();
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/hello"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/hello"
)
public
Hello
getHello
();
public
Hello
getHello
();
...
@@ -127,6 +141,11 @@ public class SpringDecoderTests extends FeignClientFactoryBean {
...
@@ -127,6 +141,11 @@ public class SpringDecoderTests extends FeignClientFactoryBean {
}
}
@Override
@Override
public
ResponseEntity
<
Void
>
getHelloVoid
()
{
return
ResponseEntity
.
noContent
().
header
(
"X-test-header"
,
"myval"
).
build
();
}
@Override
public
Hello
getHello
()
{
public
Hello
getHello
()
{
return
new
Hello
(
"hello world 1"
);
return
new
Hello
(
"hello world 1"
);
}
}
...
...
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