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
c3eedabb
Unverified
Commit
c3eedabb
authored
May 31, 2018
by
Spencer Gibb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unignores test
fixes gh-2316
parent
e179e6f4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
16 deletions
+22
-16
RestClientRibbonCommandIntegrationTests.java
...e/restclient/RestClientRibbonCommandIntegrationTests.java
+22
-16
No files found.
spring-cloud-netflix-zuul/src/test/java/org/springframework/cloud/netflix/zuul/filters/route/restclient/RestClientRibbonCommandIntegrationTests.java
View file @
c3eedabb
...
...
@@ -17,14 +17,6 @@
package
org
.
springframework
.
cloud
.
netflix
.
zuul
.
filters
.
route
.
restclient
;
import
static
org
.
hamcrest
.
CoreMatchers
.
containsString
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertFalse
;
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.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
...
...
@@ -34,9 +26,13 @@ import java.util.UUID;
import
javax.servlet.http.HttpServletRequest
;
import
org.junit.Ignore
;
import
com.netflix.client.ClientException
;
import
com.netflix.loadbalancer.Server
;
import
com.netflix.loadbalancer.ServerList
;
import
com.netflix.niws.client.http.RestClient
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
...
...
@@ -44,21 +40,23 @@ import org.springframework.boot.test.context.SpringBootTest;
import
org.springframework.boot.test.context.SpringBootTest.WebEnvironment
;
import
org.springframework.boot.test.web.client.TestRestTemplate
;
import
org.springframework.boot.web.servlet.error.ErrorAttributes
;
import
org.springframework.boot.web.servlet.filter.ApplicationContextHeaderFilter
;
import
org.springframework.cloud.client.discovery.DiscoveryClient
;
import
org.springframework.cloud.netflix.ribbon.RibbonClient
;
import
org.springframework.cloud.netflix.ribbon.RibbonClients
;
import
org.springframework.cloud.netflix.ribbon.SpringClientFactory
;
import
org.springframework.cloud.netflix.ribbon.StaticServerList
;
import
org.springframework.cloud.netflix.ribbon.support.RibbonCommandContext
;
import
org.springframework.cloud.netflix.zuul.EnableZuulProxy
;
import
org.springframework.cloud.netflix.zuul.filters.ZuulProperties
;
import
org.springframework.cloud.netflix.zuul.filters.discovery.DiscoveryClientRouteLocator
;
import
org.springframework.cloud.netflix.zuul.filters.route.FallbackProvider
;
import
org.springframework.cloud.netflix.zuul.filters.route.RestClientRibbonCommand
;
import
org.springframework.cloud.netflix.zuul.filters.route.RestClientRibbonCommandFactory
;
import
org.springframework.cloud.netflix.ribbon.support.RibbonCommandContext
;
import
org.springframework.cloud.netflix.zuul.filters.route.RibbonCommandFactory
;
import
org.springframework.cloud.netflix.zuul.filters.route.support.NoEncodingFormHttpMessageConverter
;
import
org.springframework.cloud.netflix.zuul.filters.route.support.ZuulProxyTestBase
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.http.HttpEntity
;
...
...
@@ -83,10 +81,13 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.netflix.client.ClientException
;
import
com.netflix.loadbalancer.Server
;
import
com.netflix.loadbalancer.ServerList
;
import
com.netflix.niws.client.http.RestClient
;
import
static
org
.
hamcrest
.
CoreMatchers
.
containsString
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertFalse
;
import
static
org
.
junit
.
Assert
.
assertNotNull
;
import
static
org
.
junit
.
Assert
.
assertNull
;
import
static
org
.
junit
.
Assert
.
assertThat
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringBootTest
(
classes
=
RestClientRibbonCommandIntegrationTests
.
TestConfig
.
class
,
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
,
value
=
{
...
...
@@ -148,7 +149,6 @@ public class RestClientRibbonCommandIntegrationTests extends ZuulProxyTestBase {
}
@Test
@Ignore
//FIXME: does spring 5.0 no longer send the X-Application-Context header?
public
void
simpleHostRouteDefaultIgnoredHeader
()
{
this
.
routes
.
addRoute
(
"/self/**"
,
"http://localhost:"
+
this
.
port
+
"/"
);
this
.
endpoint
.
reset
();
...
...
@@ -158,7 +158,7 @@ public class RestClientRibbonCommandIntegrationTests extends ZuulProxyTestBase {
assertEquals
(
HttpStatus
.
OK
,
result
.
getStatusCode
());
List
<
String
>
headers
=
result
.
getHeaders
().
get
(
"X-Application-Context"
);
assertNotNull
(
"header was null"
,
headers
);
assertEquals
(
"[
testclient:0
]"
,
headers
.
toString
());
assertEquals
(
"[
application-1
]"
,
headers
.
toString
());
}
@Test
...
...
@@ -353,6 +353,12 @@ public class RestClientRibbonCommandIntegrationTests extends ZuulProxyTestBase {
return
new
MyErrorController
(
errorAttributes
);
}
@Bean
public
ApplicationContextHeaderFilter
applicationContextIdFilter
(
ApplicationContext
context
)
{
return
new
ApplicationContextHeaderFilter
(
context
);
}
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
TestConfig
.
class
,
args
);
}
...
...
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