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
7f9d453a
Commit
7f9d453a
authored
Mar 08, 2016
by
Spencer Gibb
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #884 from spring-cloud/issues_feign_broken_vnd_content_type
8.15 version of Feign breaks VND content types
parents
69a70573
61e9d072
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
14 deletions
+32
-14
FeignClientTests.java
...framework/cloud/netflix/feign/valid/FeignClientTests.java
+32
-14
No files found.
spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/feign/valid/FeignClientTests.java
View file @
7f9d453a
...
...
@@ -16,14 +16,6 @@
package
org
.
springframework
.
cloud
.
netflix
.
feign
.
valid
;
import
static
org
.
hamcrest
.
Matchers
.
instanceOf
;
import
static
org
.
hamcrest
.
Matchers
.
is
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertNotNull
;
import
static
org
.
junit
.
Assert
.
assertNull
;
import
static
org
.
junit
.
Assert
.
assertThat
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
import
java.lang.reflect.InvocationHandler
;
import
java.lang.reflect.Proxy
;
import
java.util.ArrayList
;
...
...
@@ -32,11 +24,6 @@ import java.util.List;
import
java.util.concurrent.Future
;
import
java.util.concurrent.TimeUnit
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.junit.Ignore
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -46,9 +33,9 @@ import org.springframework.boot.builder.SpringApplicationBuilder;
import
org.springframework.boot.test.SpringApplicationConfiguration
;
import
org.springframework.boot.test.WebIntegrationTest
;
import
org.springframework.cloud.netflix.feign.EnableFeignClients
;
import
org.springframework.cloud.netflix.feign.support.FallbackCommand
;
import
org.springframework.cloud.netflix.feign.FeignClient
;
import
org.springframework.cloud.netflix.feign.ribbon.LoadBalancerFeignClient
;
import
org.springframework.cloud.netflix.feign.support.FallbackCommand
;
import
org.springframework.cloud.netflix.ribbon.RibbonClient
;
import
org.springframework.cloud.netflix.ribbon.RibbonClients
;
import
org.springframework.cloud.netflix.ribbon.StaticServerList
;
...
...
@@ -73,9 +60,20 @@ import feign.Client;
import
feign.Logger
;
import
feign.RequestInterceptor
;
import
feign.RequestTemplate
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
rx.Observable
;
import
rx.Single
;
import
static
org
.
hamcrest
.
Matchers
.
instanceOf
;
import
static
org
.
hamcrest
.
Matchers
.
is
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertNotNull
;
import
static
org
.
junit
.
Assert
.
assertNull
;
import
static
org
.
junit
.
Assert
.
assertThat
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
/**
* @author Spencer Gibb
* @author Jakub Narloch
...
...
@@ -143,6 +141,12 @@ public class FeignClientTests {
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/hello"
)
HttpEntity
<
Hello
>
getHelloEntity
();
@RequestMapping
(
method
=
RequestMethod
.
POST
,
consumes
=
"application/vnd.io.spring.cloud.test.v1+json"
,
produces
=
"application/vnd.io.spring.cloud.test.v1+json"
,
value
=
"/complex"
)
String
moreComplexContentType
(
String
body
);
}
public
static
class
TestClientConfig
{
...
...
@@ -292,6 +296,13 @@ public class FeignClientTests {
return
ResponseEntity
.
status
(
HttpStatus
.
NOT_FOUND
).
body
((
String
)
null
);
}
@RequestMapping
(
method
=
RequestMethod
.
POST
,
consumes
=
"application/vnd.io.spring.cloud.test.v1+json"
,
produces
=
"application/vnd.io.spring.cloud.test.v1+json"
,
value
=
"/complex"
)
String
complex
(
String
body
)
{
return
"{\"value\":\"OK\"}"
;
}
public
static
void
main
(
String
[]
args
)
{
new
SpringApplicationBuilder
(
Application
.
class
).
properties
(
...
...
@@ -407,6 +418,13 @@ public class FeignClientTests {
}
@Test
public
void
testMoreComplexHeader
()
{
String
response
=
testClient
.
moreComplexContentType
(
"{\"value\":\"OK\"}"
);
assertNotNull
(
"response was null"
,
response
);
assertEquals
(
"didn't respond with {\"value\":\"OK\"}"
,
"{\"value\":\"OK\"}"
,
response
);
}
@Test
public
void
testDecodeNotFound
()
{
ResponseEntity
response
=
decodingTestClient
.
notFound
();
assertNotNull
(
"response was null"
,
response
);
...
...
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