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
4e25e2eb
Commit
4e25e2eb
authored
Jun 08, 2017
by
Ryan Baxter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Trying a plain RestTemplate in an attempt to fix intermittent test failures."
This reverts commit
f5524263
.
parent
f5524263
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
RetryableZuulProxyApplicationTests.java
...loud/netflix/zuul/RetryableZuulProxyApplicationTests.java
+4
-8
No files found.
spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/zuul/RetryableZuulProxyApplicationTests.java
View file @
4e25e2eb
...
@@ -10,7 +10,7 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
...
@@ -10,7 +10,7 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import
org.springframework.boot.context.embedded.LocalServerPort
;
import
org.springframework.boot.context.embedded.LocalServerPort
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.boot.test.context.SpringBootTest.WebEnvironment
;
import
org.springframework.boot.test.context.SpringBootTest.WebEnvironment
;
import
org.springframework.boot.
web.client.RestTemplateBuilder
;
import
org.springframework.boot.
test.web.client.TestRestTemplate
;
import
org.springframework.cloud.netflix.ribbon.RibbonClient
;
import
org.springframework.cloud.netflix.ribbon.RibbonClient
;
import
org.springframework.cloud.netflix.ribbon.StaticServerList
;
import
org.springframework.cloud.netflix.ribbon.StaticServerList
;
import
org.springframework.cloud.netflix.zuul.filters.discovery.DiscoveryClientRouteLocator
;
import
org.springframework.cloud.netflix.zuul.filters.discovery.DiscoveryClientRouteLocator
;
...
@@ -30,7 +30,6 @@ import org.springframework.web.bind.annotation.RequestBody;
...
@@ -30,7 +30,6 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.client.RestTemplate
;
import
com.netflix.loadbalancer.Server
;
import
com.netflix.loadbalancer.Server
;
import
com.netflix.loadbalancer.ServerList
;
import
com.netflix.loadbalancer.ServerList
;
...
@@ -48,7 +47,8 @@ import com.netflix.zuul.context.RequestContext;
...
@@ -48,7 +47,8 @@ import com.netflix.zuul.context.RequestContext;
@DirtiesContext
@DirtiesContext
public
class
RetryableZuulProxyApplicationTests
{
public
class
RetryableZuulProxyApplicationTests
{
private
RestTemplate
testRestTemplate
;
@Autowired
private
TestRestTemplate
testRestTemplate
;
@Autowired
@Autowired
@SuppressWarnings
(
"unused"
)
@SuppressWarnings
(
"unused"
)
...
@@ -58,14 +58,10 @@ public class RetryableZuulProxyApplicationTests {
...
@@ -58,14 +58,10 @@ public class RetryableZuulProxyApplicationTests {
@SuppressWarnings
(
"unused"
)
@SuppressWarnings
(
"unused"
)
private
RoutesEndpoint
endpoint
;
private
RoutesEndpoint
endpoint
;
@LocalServerPort
private
int
port
;
@Before
@Before
public
void
setTestRequestContext
()
{
public
void
setTestRequestContext
()
{
RequestContext
context
=
new
RequestContext
();
RequestContext
context
=
new
RequestContext
();
RequestContext
.
testSetCurrentContext
(
context
);
RequestContext
.
testSetCurrentContext
(
context
);
testRestTemplate
=
new
RestTemplateBuilder
().
build
();
}
}
@Test
@Test
...
@@ -75,7 +71,7 @@ public class RetryableZuulProxyApplicationTests {
...
@@ -75,7 +71,7 @@ public class RetryableZuulProxyApplicationTests {
HttpHeaders
headers
=
new
HttpHeaders
();
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
setContentType
(
MediaType
.
APPLICATION_FORM_URLENCODED
);
headers
.
setContentType
(
MediaType
.
APPLICATION_FORM_URLENCODED
);
ResponseEntity
<
String
>
result
=
testRestTemplate
.
exchange
(
ResponseEntity
<
String
>
result
=
testRestTemplate
.
exchange
(
"
http://localhost:"
+
port
+
"
/simple"
,
HttpMethod
.
POST
,
"/simple"
,
HttpMethod
.
POST
,
new
HttpEntity
<>(
form
,
headers
),
String
.
class
);
new
HttpEntity
<>(
form
,
headers
),
String
.
class
);
assertEquals
(
HttpStatus
.
OK
,
result
.
getStatusCode
());
assertEquals
(
HttpStatus
.
OK
,
result
.
getStatusCode
());
assertEquals
(
"Posted! {foo=[bar]}"
,
result
.
getBody
());
assertEquals
(
"Posted! {foo=[bar]}"
,
result
.
getBody
());
...
...
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