Skip to content

Commit bbadf14

Browse files
Merge pull request #67 from mohamed-taman/bugfix/Eureka_Build_Failed fixes #66
fix eureka failed tests.
2 parents 700b390 + 079bcbc commit bbadf14

File tree

3 files changed

+25
-25
lines changed

3 files changed

+25
-25
lines changed

config/repo/eureka-server.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ eureka:
1414
hostname: localhost #eurekaInstance Name
1515
client:
1616
# for development set it to false in order to not register itself to its peer.
17-
Register-with-eureka: false #Do you register yourself with Eureka Server?
18-
Fetch-registry: false #Do not get registration information through eureka
17+
register-with-eureka: false #Do you register yourself with Eureka Server?
18+
fetch-registry: false #Do not get registration information through eureka
1919
service-url.defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/
2020
server:
2121
# Make the number of renewals required to prevent an emergency tiny (probably 0)

store-cloud-infra/eureka-server/src/test/java/com/siriusxi/cloud/infra/eds/EurekaDiscoveryServerTests.java

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,19 @@
1313

1414
@SpringBootTest(
1515
webEnvironment = RANDOM_PORT,
16-
properties = {"spring.cloud.config.enabled: false"})
16+
properties = {
17+
"spring.cloud.config.enabled: false",
18+
"eureka.client.register-with-eureka: false",
19+
"eureka.client.fetch-registry: false",
20+
"app.eureka.user: mt",
21+
"app.eureka.pass: p"
22+
})
1723
class EurekaDiscoveryServerTests {
1824

19-
@Value("${app.eureka.username}")
25+
@Value("${app.eureka.user}")
2026
private String username;
2127

22-
@Value("${app.eureka.password}")
28+
@Value("${app.eureka.pass}")
2329
private String password;
2430

2531
private TestRestTemplate testRestTemplate;
@@ -32,20 +38,19 @@ public void setTestRestTemplate(TestRestTemplate testRestTemplate) {
3238
@Test
3339
public void catalogLoads() {
3440

35-
String expectedResponseBody =
36-
"{\"applications\":{\"versions__delta\":\"1\"," +
37-
"\"apps__hashcode\":\"\",\"application\":[]}}";
38-
ResponseEntity<String> entity = testRestTemplate.getForEntity("/eureka/apps", String.class);
39-
assertEquals(HttpStatus.OK, entity.getStatusCode());
40-
assertEquals(expectedResponseBody, entity.getBody());
41-
}
42-
43-
@Test
44-
public void healthy() {
45-
String expectedResponseBody = "{\"status\":\"UP\"}";
46-
ResponseEntity<String> entity = testRestTemplate.getForEntity("/actuator/health", String.class);
47-
assertEquals(HttpStatus.OK, entity.getStatusCode());
48-
assertEquals(expectedResponseBody, entity.getBody());
49-
}
41+
String expectedResponseBody =
42+
"{\"applications\":{\"versions__delta\":\"1\","
43+
+ "\"apps__hashcode\":\"\",\"application\":[]}}";
44+
ResponseEntity<String> entity = testRestTemplate.getForEntity("/eureka/apps", String.class);
45+
assertEquals(HttpStatus.OK, entity.getStatusCode());
46+
assertEquals(expectedResponseBody, entity.getBody());
47+
}
5048

49+
@Test
50+
public void healthy() {
51+
String expectedResponseBody = "{\"status\":\"UP\"}";
52+
ResponseEntity<String> entity = testRestTemplate.getForEntity("/actuator/health", String.class);
53+
assertEquals(HttpStatus.OK, entity.getStatusCode());
54+
assertEquals(expectedResponseBody, entity.getBody());
55+
}
5156
}

store-cloud-infra/eureka-server/src/test/resources/application.yaml

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)