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
f79166cb
Commit
f79166cb
authored
Nov 26, 2014
by
Spencer Gibb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed test broken by change in functionality in ZuulHandlerMapping.reset
parent
c0903c5a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
11 deletions
+8
-11
ZuulHandlerMapping.java
...pringframework/cloud/netflix/zuul/ZuulHandlerMapping.java
+1
-1
SampleZuulProxyApplication.java
...mework/cloud/netflix/zuul/SampleZuulProxyApplication.java
+3
-4
SampleZuulProxyApplicationTests.java
...k/cloud/netflix/zuul/SampleZuulProxyApplicationTests.java
+4
-6
No files found.
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/zuul/ZuulHandlerMapping.java
View file @
f79166cb
...
...
@@ -46,7 +46,7 @@ public class ZuulHandlerMapping extends AbstractUrlHandlerMapping implements
registerHandlers
(
routeLocator
.
getRoutes
());
}
pr
ivate
void
registerHandlers
(
Map
<
String
,
String
>
routes
)
{
pr
otected
void
registerHandlers
(
Map
<
String
,
String
>
routes
)
{
if
(
routes
.
isEmpty
())
{
logger
.
warn
(
"Neither 'urlMap' nor 'mappings' set on SimpleUrlHandlerMapping"
);
}
...
...
spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/zuul/
sample/
ZuulProxyApplication.java
→
spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/zuul/
Sample
ZuulProxyApplication.java
View file @
f79166cb
package
org
.
springframework
.
cloud
.
netflix
.
zuul
.
sample
;
package
org
.
springframework
.
cloud
.
netflix
.
zuul
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.cloud.netflix.eureka.EnableEurekaClient
;
import
org.springframework.cloud.netflix.zuul.EnableZuulProxy
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -12,7 +11,7 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
@EnableZuulProxy
@EnableEurekaClient
public
class
ZuulProxyApplication
{
public
class
Sample
ZuulProxyApplication
{
@RequestMapping
(
"/testing123"
)
public
String
testing123
()
{
...
...
@@ -35,7 +34,7 @@ public class ZuulProxyApplication {
}
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
ZuulProxyApplication
.
class
,
args
);
SpringApplication
.
run
(
Sample
ZuulProxyApplication
.
class
,
args
);
}
}
spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/zuul/
sample/
ZuulProxyApplicationTests.java
→
spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/zuul/
Sample
ZuulProxyApplicationTests.java
View file @
f79166cb
package
org
.
springframework
.
cloud
.
netflix
.
zuul
.
sample
;
package
org
.
springframework
.
cloud
.
netflix
.
zuul
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
...
...
@@ -9,8 +9,6 @@ import org.springframework.beans.factory.annotation.Value;
import
org.springframework.boot.test.IntegrationTest
;
import
org.springframework.boot.test.SpringApplicationConfiguration
;
import
org.springframework.boot.test.TestRestTemplate
;
import
org.springframework.cloud.netflix.zuul.RouteLocator
;
import
org.springframework.cloud.netflix.zuul.ZuulHandlerMapping
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpMethod
;
import
org.springframework.http.HttpStatus
;
...
...
@@ -19,10 +17,10 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import
org.springframework.test.context.web.WebAppConfiguration
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringApplicationConfiguration
(
classes
=
ZuulProxyApplication
.
class
)
@SpringApplicationConfiguration
(
classes
=
Sample
ZuulProxyApplication
.
class
)
@WebAppConfiguration
@IntegrationTest
(
"server.port=0"
)
public
class
ZuulProxyApplicationTests
{
public
class
Sample
ZuulProxyApplicationTests
{
@Value
(
"${local.server.port}"
)
private
int
port
;
...
...
@@ -36,7 +34,7 @@ public class ZuulProxyApplicationTests {
@Test
public
void
deleteOnSelf
()
{
routes
.
getRoutes
().
put
(
"/self/**"
,
"http://localhost:"
+
port
+
"/local"
);
mapping
.
re
set
(
);
mapping
.
re
gisterHandlers
(
routes
.
getRoutes
()
);
ResponseEntity
<
String
>
result
=
new
TestRestTemplate
().
exchange
(
"http://localhost:"
+
port
+
"/self/1"
,
HttpMethod
.
DELETE
,
new
HttpEntity
<
Void
>((
Void
)
null
),
String
.
class
);
assertEquals
(
HttpStatus
.
OK
,
result
.
getStatusCode
());
...
...
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