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
33511fd1
Unverified
Commit
33511fd1
authored
Apr 04, 2018
by
Spencer Gibb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds sidecar test for prefer-ip-address
parent
0c7be074
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletion
+19
-1
SidecarApplicationTests.java
...mework/cloud/netflix/sidecar/SidecarApplicationTests.java
+19
-1
No files found.
spring-cloud-netflix-sidecar/src/test/java/org/springframework/cloud/netflix/sidecar/SidecarApplicationTests.java
View file @
33511fd1
...
@@ -74,7 +74,25 @@ public class SidecarApplicationTests {
...
@@ -74,7 +74,25 @@ public class SidecarApplicationTests {
@Test
@Test
public
void
testEurekaConfigBeanEurekaInstanceHostnamePropertyShouldBeUsed
()
{
public
void
testEurekaConfigBeanEurekaInstanceHostnamePropertyShouldBeUsed
()
{
assertThat
(
this
.
config
.
getAppname
(),
equalTo
(
"mytest"
));
assertThat
(
this
.
config
.
getAppname
(),
equalTo
(
"mytest"
));
assertThat
(
this
.
config
.
getHostname
(),
equalTo
(
"mhhost1"
));
assertThat
(
this
.
config
.
getHostname
(),
equalTo
(
"127.0.0.1"
));
assertThat
(
this
.
config
.
getInstanceId
(),
equalTo
(
"mhhost:mytest:1"
));
assertThat
(
this
.
config
.
getNonSecurePort
(),
equalTo
(
7000
));
}
}
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
SidecarApplication
.
class
,
webEnvironment
=
RANDOM_PORT
,
properties
=
{
"spring.application.name=mytest"
,
"spring.cloud.client.hostname=mhhost"
,
"spring.application.instance_id=1"
,
"eureka.instance.hostname=mhhost1"
,
"sidecar.hostname=mhhost2"
,
"sidecar.port=7000"
,
"sidecar.ip-address=10.0.0.1"
,
"eureka.instance.prefer-ip-address=true"
})
public
static
class
PreferIpAddressTest
{
@Autowired
EurekaInstanceConfigBean
config
;
@Test
public
void
testEurekaConfigBeanPreferIpAddress
()
{
assertThat
(
this
.
config
.
getAppname
(),
equalTo
(
"mytest"
));
assertThat
(
this
.
config
.
getHostname
(),
equalTo
(
"10.0.0.1"
));
assertThat
(
this
.
config
.
getInstanceId
(),
equalTo
(
"mhhost:mytest:1"
));
assertThat
(
this
.
config
.
getInstanceId
(),
equalTo
(
"mhhost:mytest:1"
));
assertThat
(
this
.
config
.
getNonSecurePort
(),
equalTo
(
7000
));
assertThat
(
this
.
config
.
getNonSecurePort
(),
equalTo
(
7000
));
}
}
...
...
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