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
4e40cad2
Unverified
Commit
4e40cad2
authored
Nov 28, 2017
by
Spencer Gibb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish test
parent
14c1d461
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
3 deletions
+24
-3
EagerLoadOfZuulConfigurationTests.java
...zuul/filters/route/EagerLoadOfZuulConfigurationTests.java
+14
-1
LazyLoadOfZuulConfigurationTests.java
.../zuul/filters/route/LazyLoadOfZuulConfigurationTests.java
+10
-2
No files found.
spring-cloud-netflix-zuul/src/test/java/org/springframework/cloud/netflix/zuul/filters/route/EagerLoadOfZuulConfigurationTests.java
View file @
4e40cad2
...
...
@@ -17,6 +17,9 @@
package
org
.
springframework
.
cloud
.
netflix
.
zuul
.
filters
.
route
;
import
com.netflix.zuul.context.RequestContext
;
import
org.junit.After
;
import
org.junit.Before
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
...
...
@@ -34,11 +37,21 @@ import java.util.concurrent.atomic.AtomicInteger;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
value
=
{
"zuul.routes.my
route.service-id=eager"
,
@SpringBootTest
(
properties
=
{
"zuul.routes.eager
route.service-id=eager"
,
"zuul.ribbon.eager-load.enabled=true"
})
@DirtiesContext
public
class
EagerLoadOfZuulConfigurationTests
{
@Before
public
void
setTestRequestContext
()
{
RequestContext
context
=
new
RequestContext
();
RequestContext
.
testSetCurrentContext
(
context
);
}
@After
public
void
clear
()
{
RequestContext
.
getCurrentContext
().
clear
();
}
@Test
public
void
testEagerLoading
()
{
// Child context FooConfig should have been eagerly instantiated..
...
...
spring-cloud-netflix-zuul/src/test/java/org/springframework/cloud/netflix/zuul/filters/route/LazyLoadOfZuulConfigurationTests.java
View file @
4e40cad2
...
...
@@ -19,6 +19,7 @@ package org.springframework.cloud.netflix.zuul.filters.route;
import
java.util.concurrent.atomic.AtomicInteger
;
import
org.junit.After
;
import
org.junit.Before
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
...
...
@@ -46,14 +47,21 @@ import static org.assertj.core.api.Assertions.assertThat;
import
static
org
.
springframework
.
boot
.
test
.
context
.
SpringBootTest
.
WebEnvironment
.
RANDOM_PORT
;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
RANDOM_PORT
,
value
=
{
"zuul.routes.myroute.service-id=lazy"
,
"zuul.routes.myroute.path=/lazy/**"
})
@SpringBootTest
(
webEnvironment
=
RANDOM_PORT
,
properties
=
{
"zuul.routes.lazyroute.service-id=lazy"
,
"zuul.routes.lazyroute.path=/lazy/**"
,
"zuul.ribbon.eager-load.enabled=false"
})
@DirtiesContext
public
class
LazyLoadOfZuulConfigurationTests
{
@LocalServerPort
protected
int
port
;
@Before
public
void
setTestRequestContext
()
{
RequestContext
context
=
new
RequestContext
();
RequestContext
.
testSetCurrentContext
(
context
);
}
@After
public
void
clear
()
{
RequestContext
.
getCurrentContext
().
clear
();
...
...
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