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
ae34b773
Unverified
Commit
ae34b773
authored
Nov 22, 2017
by
Spencer Gibb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates for boot 2.0 compatibility
parent
946a46f2
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
27 deletions
+29
-27
application.yml
spring-cloud-netflix-core/src/test/resources/application.yml
+1
-1
EurekaClientAutoConfigurationTests.java
...ud/netflix/eureka/EurekaClientAutoConfigurationTests.java
+22
-22
ApplicationContextTests.java
.../cloud/netflix/eureka/server/ApplicationContextTests.java
+1
-1
ApplicationServletPathTests.java
...ud/netflix/eureka/server/ApplicationServletPathTests.java
+1
-1
ApplicationTests.java
...amework/cloud/netflix/eureka/server/ApplicationTests.java
+1
-1
RoutesEndpointIntegrationTests.java
...rk/cloud/netflix/zuul/RoutesEndpointIntegrationTests.java
+3
-1
No files found.
spring-cloud-netflix-core/src/test/resources/application.yml
View file @
ae34b773
...
...
@@ -44,4 +44,4 @@ feignClient:
localappName
:
localapp
methodLevelRequestMappingPath
:
/hello2
myPlaceholderHeader
:
myPlaceholderHeaderValue
endpoints.default.web.enabled
:
true
management.endpoints.web.expose
:
'
*'
spring-cloud-netflix-eureka-client/src/test/java/org/springframework/cloud/netflix/eureka/EurekaClientAutoConfigurationTests.java
View file @
ae34b773
...
...
@@ -93,7 +93,7 @@ public class EurekaClientAutoConfigurationTests {
@Test
public
void
shouldNotSetManagementAndJmxPortsInMetadataMap
()
throws
Exception
{
addEnvironment
(
this
.
context
,
"server.port=8989"
,
"management.port=0"
);
addEnvironment
(
this
.
context
,
"server.port=8989"
,
"management.
server.
port=0"
);
setupContext
(
RefreshAutoConfiguration
.
class
);
EurekaInstanceConfigBean
instance
=
this
.
context
...
...
@@ -105,7 +105,7 @@ public class EurekaClientAutoConfigurationTests {
@Test
public
void
shouldSetManagementAndJmxPortsInMetadataMap
()
throws
Exception
{
addEnvironment
(
this
.
context
,
"management.port=9999"
,
addEnvironment
(
this
.
context
,
"management.
server.
port=9999"
,
"com.sun.management.jmxremote.port=6789"
);
setupContext
(
RefreshAutoConfiguration
.
class
);
...
...
@@ -117,7 +117,7 @@ public class EurekaClientAutoConfigurationTests {
@Test
public
void
shouldNotResetManagementAndJmxPortsInMetadataMap
()
throws
Exception
{
addEnvironment
(
this
.
context
,
"management.port=9999"
,
addEnvironment
(
this
.
context
,
"management.
server.
port=9999"
,
"eureka.instance.metadata-map.jmx.port=9898"
,
"eureka.instance.metadata-map.management.port=7878"
);
setupContext
(
RefreshAutoConfiguration
.
class
);
...
...
@@ -168,7 +168,7 @@ public class EurekaClientAutoConfigurationTests {
@Test
public
void
managementPort
()
{
TestPropertyValues
.
of
(
"server.port=8989"
,
"management.port=9999"
).
applyTo
(
this
.
context
);
"management.
server.
port=9999"
).
applyTo
(
this
.
context
);
setupContext
(
RefreshAutoConfiguration
.
class
);
EurekaInstanceConfigBean
instance
=
this
.
context
.
getBean
(
EurekaInstanceConfigBean
.
class
);
...
...
@@ -179,7 +179,7 @@ public class EurekaClientAutoConfigurationTests {
@Test
public
void
statusPageUrlPathAndManagementPort
()
{
TestPropertyValues
.
of
(
"server.port=8989"
,
"management.port=9999"
,
"management.
server.
port=9999"
,
"eureka.instance.statusPageUrlPath=/myStatusPage"
).
applyTo
(
this
.
context
);
setupContext
(
RefreshAutoConfiguration
.
class
);
EurekaInstanceConfigBean
instance
=
this
.
context
...
...
@@ -191,7 +191,7 @@ public class EurekaClientAutoConfigurationTests {
@Test
public
void
healthCheckUrlPathAndManagementPort
()
{
TestPropertyValues
.
of
(
"server.port=8989"
,
"management.port=9999"
,
"management.
server.
port=9999"
,
"eureka.instance.healthCheckUrlPath=/myHealthCheck"
).
applyTo
(
this
.
context
);
setupContext
(
RefreshAutoConfiguration
.
class
);
EurekaInstanceConfigBean
instance
=
this
.
context
...
...
@@ -203,7 +203,7 @@ public class EurekaClientAutoConfigurationTests {
@Test
public
void
statusPageUrl_and_healthCheckUrl_do_not_contain_server_context_path
()
throws
Exception
{
addEnvironment
(
this
.
context
,
"server.port=8989"
,
"management.port=9999"
,
"server.contextPath=/service"
);
"management.
server.
port=9999"
,
"server.contextPath=/service"
);
setupContext
(
RefreshAutoConfiguration
.
class
);
EurekaInstanceConfigBean
instance
=
this
.
context
...
...
@@ -217,7 +217,7 @@ public class EurekaClientAutoConfigurationTests {
@Test
public
void
statusPageUrl_and_healthCheckUrl_contain_management_context_path
()
throws
Exception
{
addEnvironment
(
this
.
context
,
"server.port=8989"
,
"management.
contextP
ath=/management"
);
"server.port=8989"
,
"management.
server.context-p
ath=/management"
);
setupContext
(
RefreshAutoConfiguration
.
class
);
EurekaInstanceConfigBean
instance
=
this
.
context
...
...
@@ -231,8 +231,8 @@ public class EurekaClientAutoConfigurationTests {
@Test
public
void
statusPageUrlPathAndManagementPortAndContextPath
()
{
TestPropertyValues
.
of
(
"server.port=8989"
,
"management.
port=9999"
,
"management.contextP
ath=/manage"
,
"eureka.instance.status
PageUrlP
ath=/myStatusPage"
).
applyTo
(
this
.
context
);
"management.
server.port=9999"
,
"management.server.context-p
ath=/manage"
,
"eureka.instance.status
-page-url-p
ath=/myStatusPage"
).
applyTo
(
this
.
context
);
setupContext
(
RefreshAutoConfiguration
.
class
);
EurekaInstanceConfigBean
instance
=
this
.
context
.
getBean
(
EurekaInstanceConfigBean
.
class
);
...
...
@@ -243,8 +243,8 @@ public class EurekaClientAutoConfigurationTests {
@Test
public
void
healthCheckUrlPathAndManagementPortAndContextPath
()
{
TestPropertyValues
.
of
(
"server.port=8989"
,
"management.
port=9999"
,
"management.contextP
ath=/manage"
,
"eureka.instance.health
CheckUrlP
ath=/myHealthCheck"
).
applyTo
(
this
.
context
);
"management.
server.port=9999"
,
"management.server.context-p
ath=/manage"
,
"eureka.instance.health
-check-url-p
ath=/myHealthCheck"
).
applyTo
(
this
.
context
);
setupContext
(
RefreshAutoConfiguration
.
class
);
EurekaInstanceConfigBean
instance
=
this
.
context
.
getBean
(
EurekaInstanceConfigBean
.
class
);
...
...
@@ -255,8 +255,8 @@ public class EurekaClientAutoConfigurationTests {
@Test
public
void
statusPageUrlPathAndManagementPortAndContextPathKebobCase
()
{
TestPropertyValues
.
of
(
"server.port=8989"
,
"management.
port=9999"
,
"management
.context-path=/manage"
,
"eureka.instance.status
PageUrlP
ath=/myStatusPage"
).
applyTo
(
this
.
context
);
"management.
server.port=9999"
,
"management.server
.context-path=/manage"
,
"eureka.instance.status
-page-url-p
ath=/myStatusPage"
).
applyTo
(
this
.
context
);
setupContext
(
RefreshAutoConfiguration
.
class
);
EurekaInstanceConfigBean
instance
=
this
.
context
.
getBean
(
EurekaInstanceConfigBean
.
class
);
...
...
@@ -267,8 +267,8 @@ public class EurekaClientAutoConfigurationTests {
@Test
public
void
healthCheckUrlPathAndManagementPortAndContextPathKebobCase
()
{
TestPropertyValues
.
of
(
"server.port=8989"
,
"management.
port=9999"
,
"management
.context-path=/manage"
,
"eureka.instance.health
CheckUrlP
ath=/myHealthCheck"
).
applyTo
(
this
.
context
);
"management.
server.port=9999"
,
"management.server
.context-path=/manage"
,
"eureka.instance.health
-check-url-p
ath=/myHealthCheck"
).
applyTo
(
this
.
context
);
setupContext
(
RefreshAutoConfiguration
.
class
);
EurekaInstanceConfigBean
instance
=
this
.
context
.
getBean
(
EurekaInstanceConfigBean
.
class
);
...
...
@@ -279,7 +279,7 @@ public class EurekaClientAutoConfigurationTests {
@Test
public
void
statusPageUrlPathAndManagementPortKabobCase
()
{
TestPropertyValues
.
of
(
"server.port=8989"
,
"management.port=9999"
,
"management.
server.
port=9999"
,
"eureka.instance.status-page-url-path=/myStatusPage"
).
applyTo
(
this
.
context
);
setupContext
(
RefreshAutoConfiguration
.
class
);
EurekaInstanceConfigBean
instance
=
this
.
context
...
...
@@ -291,7 +291,7 @@ public class EurekaClientAutoConfigurationTests {
@Test
public
void
statusPageUrlAndPreferIpAddress
()
{
TestPropertyValues
.
of
(
"server.port=8989"
,
"management.port=9999"
,
"eureka.instance.hostname=foo"
,
"management.
server.
port=9999"
,
"eureka.instance.hostname=foo"
,
"eureka.instance.preferIpAddress:true"
).
applyTo
(
this
.
context
);
setupContext
(
RefreshAutoConfiguration
.
class
);
...
...
@@ -305,7 +305,7 @@ public class EurekaClientAutoConfigurationTests {
@Test
public
void
healthCheckUrlPathAndManagementPortKabobCase
()
{
TestPropertyValues
.
of
(
"server.port=8989"
,
"management.port=9999"
,
"management.
server.
port=9999"
,
"eureka.instance.health-check-url-path=/myHealthCheck"
).
applyTo
(
this
.
context
);
setupContext
(
RefreshAutoConfiguration
.
class
);
EurekaInstanceConfigBean
instance
=
this
.
context
...
...
@@ -317,7 +317,7 @@ public class EurekaClientAutoConfigurationTests {
@Test
public
void
statusPageUrlPathAndManagementPortUpperCase
()
{
TestPropertyValues
.
of
(
"server.port=8989"
,
"management.port=9999"
).
applyTo
(
this
.
context
);
"management.
server.
port=9999"
).
applyTo
(
this
.
context
);
addSystemEnvironment
(
this
.
context
.
getEnvironment
(),
"EUREKA_INSTANCE_STATUS_PAGE_URL_PATH=/myStatusPage"
);
setupContext
(
RefreshAutoConfiguration
.
class
);
EurekaInstanceConfigBean
instance
=
this
.
context
...
...
@@ -329,7 +329,7 @@ public class EurekaClientAutoConfigurationTests {
@Test
public
void
healthCheckUrlPathAndManagementPortUpperCase
()
{
TestPropertyValues
.
of
(
"server.port=8989"
,
"management.port=9999"
).
applyTo
(
this
.
context
);
"management.
server.
port=9999"
).
applyTo
(
this
.
context
);
addSystemEnvironment
(
this
.
context
.
getEnvironment
(),
"EUREKA_INSTANCE_HEALTH_CHECK_URL_PATH=/myHealthCheck"
);
setupContext
(
RefreshAutoConfiguration
.
class
);
EurekaInstanceConfigBean
instance
=
this
.
context
...
...
@@ -341,7 +341,7 @@ public class EurekaClientAutoConfigurationTests {
@Test
public
void
hostname
()
{
TestPropertyValues
.
of
(
"server.port=8989"
,
"management.port=9999"
,
"eureka.instance.hostname=foo"
).
applyTo
(
this
.
context
);
"management.
server.
port=9999"
,
"eureka.instance.hostname=foo"
).
applyTo
(
this
.
context
);
setupContext
(
RefreshAutoConfiguration
.
class
);
EurekaInstanceConfigBean
instance
=
this
.
context
.
getBean
(
EurekaInstanceConfigBean
.
class
);
...
...
spring-cloud-netflix-eureka-server/src/test/java/org/springframework/cloud/netflix/eureka/server/ApplicationContextTests.java
View file @
ae34b773
...
...
@@ -44,7 +44,7 @@ import static org.junit.Assert.assertTrue;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
Application
.
class
,
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
,
properties
=
{
"spring.application.name=eureka"
,
"server.servlet.context-path=/context"
,
"management.security.enabled=false"
,
"
endpoints.default.web.enabled=true
"
})
"management.security.enabled=false"
,
"
management.endpoints.web.expose=*
"
})
public
class
ApplicationContextTests
{
@LocalServerPort
...
...
spring-cloud-netflix-eureka-server/src/test/java/org/springframework/cloud/netflix/eureka/server/ApplicationServletPathTests.java
View file @
ae34b773
...
...
@@ -43,7 +43,7 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
Application
.
class
,
webEnvironment
=
RANDOM_PORT
,
properties
=
{
"spring.application.name=eureka"
,
"server.servlet.path=/servlet"
,
"management.security.enabled=false"
,
"
endpoints.default.web.enabled=true
"
})
"management.security.enabled=false"
,
"
management.endpoints.web.expose=*
"
})
public
class
ApplicationServletPathTests
{
@LocalServerPort
...
...
spring-cloud-netflix-eureka-server/src/test/java/org/springframework/cloud/netflix/eureka/server/ApplicationTests.java
View file @
ae34b773
...
...
@@ -52,7 +52,7 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
Application
.
class
,
webEnvironment
=
RANDOM_PORT
,
properties
=
{
"spring.jmx.enabled=true"
,
"management.security.enabled=false"
,
"
endpoints.default.web.enabled=true
"
})
"spring.jmx.enabled=true"
,
"management.security.enabled=false"
,
"
management.endpoints.web.expose=*
"
})
public
class
ApplicationTests
{
@LocalServerPort
...
...
spring-cloud-netflix-zuul/src/test/java/org/springframework/cloud/netflix/zuul/RoutesEndpointIntegrationTests.java
View file @
ae34b773
...
...
@@ -51,7 +51,7 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
RANDOM_PORT
,
value
=
{
"zuul.routes.sslservice.url=https://localhost:8443"
,
"management.security.enabled=false"
})
value
=
{
"zuul.routes.sslservice.url=https://localhost:8443"
,
"management.security.enabled=false"
,
"management.endpoints.web.expose=*"
})
@DirtiesContext
public
class
RoutesEndpointIntegrationTests
{
...
...
@@ -62,12 +62,14 @@ public class RoutesEndpointIntegrationTests {
private
SimpleZuulProxyApplication
.
RoutesRefreshListener
refreshListener
;
@Test
@SuppressWarnings
(
"unchecked"
)
public
void
getRoutesTest
()
{
Map
<
String
,
String
>
routes
=
restTemplate
.
getForObject
(
"/application/routes"
,
Map
.
class
);
assertEquals
(
"https://localhost:8443"
,
routes
.
get
(
"/sslservice/**"
));
}
@Test
@SuppressWarnings
(
"unchecked"
)
public
void
postRoutesTest
()
{
Map
<
String
,
String
>
routes
=
restTemplate
.
postForObject
(
"/application/routes"
,
null
,
Map
.
class
);
assertEquals
(
"https://localhost:8443"
,
routes
.
get
(
"/sslservice/**"
));
...
...
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