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
7425f974
Unverified
Commit
7425f974
authored
May 25, 2017
by
Spencer Gibb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds timeout test.
see gh-1950
parent
58e62ebd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
2 deletions
+17
-2
SimpleHostRoutingFilterTests.java
...flix/zuul/filters/route/SimpleHostRoutingFilterTests.java
+17
-2
No files found.
spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/zuul/filters/route/SimpleHostRoutingFilterTests.java
View file @
7425f974
...
...
@@ -30,15 +30,19 @@ import javax.servlet.http.HttpServletResponse;
import
org.apache.http.HttpEntityEnclosingRequest
;
import
org.apache.http.HttpHost
;
import
org.apache.http.HttpRequest
;
import
org.apache.http.client.config.RequestConfig
;
import
org.apache.http.client.methods.CloseableHttpResponse
;
import
org.apache.http.client.methods.Configurable
;
import
org.apache.http.entity.InputStreamEntity
;
import
org.apache.http.impl.client.CloseableHttpClient
;
import
org.apache.http.impl.conn.PoolingHttpClientConnectionManager
;
import
org.assertj.core.api.Assertions
;
import
org.junit.After
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration
;
import
org.springframework.boot.autoconfigure.
context.
PropertyPlaceholderAutoConfiguration
;
import
org.springframework.boot.context.embedded.LocalServerPort
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.boot.test.context.SpringBootTest
;
...
...
@@ -72,7 +76,8 @@ import static org.springframework.util.StreamUtils.copyToString;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
SampleApplication
.
class
,
webEnvironment
=
RANDOM_PORT
,
properties
=
"server.contextPath: /app"
)
properties
=
{
"server.contextPath: /app"
,
"zuul.host.socket-timeout-millis=11000"
,
"zuul.host.connect-timeout-millis=2100"
})
@DirtiesContext
public
class
SimpleHostRoutingFilterTests
{
...
...
@@ -89,6 +94,16 @@ public class SimpleHostRoutingFilterTests {
}
@Test
public
void
timeoutPropertiesAreApplied
()
{
setupContext
();
CloseableHttpClient
httpClient
=
getFilter
().
newClient
();
Assertions
.
assertThat
(
httpClient
).
isInstanceOf
(
Configurable
.
class
);
RequestConfig
config
=
((
Configurable
)
httpClient
).
getConfig
();
assertEquals
(
11000
,
config
.
getSocketTimeout
());
assertEquals
(
2100
,
config
.
getConnectTimeout
());
}
@Test
public
void
connectionPropertiesAreApplied
()
{
addEnvironment
(
this
.
context
,
"zuul.host.maxTotalConnections=100"
,
"zuul.host.maxPerRouteConnections=10"
,
"zuul.host.timeToLive=5"
,
...
...
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