Skip to content

Commit

Permalink
Merge branch 'release/5.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamed-taman committed May 21, 2020
2 parents 3db98a4 + bbadf14 commit 94f3d14
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions config/repo/eureka-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ eureka:
hostname: localhost #eurekaInstance Name
client:
# for development set it to false in order to not register itself to its peer.
Register-with-eureka: false #Do you register yourself with Eureka Server?
Fetch-registry: false #Do not get registration information through eureka
register-with-eureka: false #Do you register yourself with Eureka Server?
fetch-registry: false #Do not get registration information through eureka
service-url.defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/
server:
# Make the number of renewals required to prevent an emergency tiny (probably 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,19 @@

@SpringBootTest(
webEnvironment = RANDOM_PORT,
properties = {"spring.cloud.config.enabled: false"})
properties = {
"spring.cloud.config.enabled: false",
"eureka.client.register-with-eureka: false",
"eureka.client.fetch-registry: false",
"app.eureka.user: mt",
"app.eureka.pass: p"
})
class EurekaDiscoveryServerTests {

@Value("${app.eureka.username}")
@Value("${app.eureka.user}")
private String username;

@Value("${app.eureka.password}")
@Value("${app.eureka.pass}")
private String password;

private TestRestTemplate testRestTemplate;
Expand All @@ -32,20 +38,19 @@ public void setTestRestTemplate(TestRestTemplate testRestTemplate) {
@Test
public void catalogLoads() {

String expectedResponseBody =
"{\"applications\":{\"versions__delta\":\"1\"," +
"\"apps__hashcode\":\"\",\"application\":[]}}";
ResponseEntity<String> entity = testRestTemplate.getForEntity("/eureka/apps", String.class);
assertEquals(HttpStatus.OK, entity.getStatusCode());
assertEquals(expectedResponseBody, entity.getBody());
}

@Test
public void healthy() {
String expectedResponseBody = "{\"status\":\"UP\"}";
ResponseEntity<String> entity = testRestTemplate.getForEntity("/actuator/health", String.class);
assertEquals(HttpStatus.OK, entity.getStatusCode());
assertEquals(expectedResponseBody, entity.getBody());
}
String expectedResponseBody =
"{\"applications\":{\"versions__delta\":\"1\","
+ "\"apps__hashcode\":\"\",\"application\":[]}}";
ResponseEntity<String> entity = testRestTemplate.getForEntity("/eureka/apps", String.class);
assertEquals(HttpStatus.OK, entity.getStatusCode());
assertEquals(expectedResponseBody, entity.getBody());
}

@Test
public void healthy() {
String expectedResponseBody = "{\"status\":\"UP\"}";
ResponseEntity<String> entity = testRestTemplate.getForEntity("/actuator/health", String.class);
assertEquals(HttpStatus.OK, entity.getStatusCode());
assertEquals(expectedResponseBody, entity.getBody());
}
}

This file was deleted.

0 comments on commit 94f3d14

Please sign in to comment.