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
61e9d072
Commit
61e9d072
authored
Mar 08, 2016
by
Marcin Grzejszczak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test to prove the issue
parent
26708908
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 @
61e9d072
...
@@ -16,14 +16,6 @@
...
@@ -16,14 +16,6 @@
package
org
.
springframework
.
cloud
.
netflix
.
feign
.
valid
;
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.InvocationHandler
;
import
java.lang.reflect.Proxy
;
import
java.lang.reflect.Proxy
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -32,11 +24,6 @@ import java.util.List;
...
@@ -32,11 +24,6 @@ import java.util.List;
import
java.util.concurrent.Future
;
import
java.util.concurrent.Future
;
import
java.util.concurrent.TimeUnit
;
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.Test
;
import
org.junit.runner.RunWith
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -46,9 +33,9 @@ import org.springframework.boot.builder.SpringApplicationBuilder;
...
@@ -46,9 +33,9 @@ import org.springframework.boot.builder.SpringApplicationBuilder;
import
org.springframework.boot.test.SpringApplicationConfiguration
;
import
org.springframework.boot.test.SpringApplicationConfiguration
;
import
org.springframework.boot.test.WebIntegrationTest
;
import
org.springframework.boot.test.WebIntegrationTest
;
import
org.springframework.cloud.netflix.feign.EnableFeignClients
;
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.FeignClient
;
import
org.springframework.cloud.netflix.feign.ribbon.LoadBalancerFeignClient
;
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.RibbonClient
;
import
org.springframework.cloud.netflix.ribbon.RibbonClients
;
import
org.springframework.cloud.netflix.ribbon.RibbonClients
;
import
org.springframework.cloud.netflix.ribbon.StaticServerList
;
import
org.springframework.cloud.netflix.ribbon.StaticServerList
;
...
@@ -73,9 +60,20 @@ import feign.Client;
...
@@ -73,9 +60,20 @@ import feign.Client;
import
feign.Logger
;
import
feign.Logger
;
import
feign.RequestInterceptor
;
import
feign.RequestInterceptor
;
import
feign.RequestTemplate
;
import
feign.RequestTemplate
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
rx.Observable
;
import
rx.Observable
;
import
rx.Single
;
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 Spencer Gibb
* @author Jakub Narloch
* @author Jakub Narloch
...
@@ -143,6 +141,12 @@ public class FeignClientTests {
...
@@ -143,6 +141,12 @@ public class FeignClientTests {
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/hello"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/hello"
)
HttpEntity
<
Hello
>
getHelloEntity
();
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
{
public
static
class
TestClientConfig
{
...
@@ -292,6 +296,13 @@ public class FeignClientTests {
...
@@ -292,6 +296,13 @@ public class FeignClientTests {
return
ResponseEntity
.
status
(
HttpStatus
.
NOT_FOUND
).
body
((
String
)
null
);
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
)
{
public
static
void
main
(
String
[]
args
)
{
new
SpringApplicationBuilder
(
Application
.
class
).
properties
(
new
SpringApplicationBuilder
(
Application
.
class
).
properties
(
...
@@ -407,6 +418,13 @@ public class FeignClientTests {
...
@@ -407,6 +418,13 @@ public class FeignClientTests {
}
}
@Test
@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
()
{
public
void
testDecodeNotFound
()
{
ResponseEntity
response
=
decodingTestClient
.
notFound
();
ResponseEntity
response
=
decodingTestClient
.
notFound
();
assertNotNull
(
"response was null"
,
response
);
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