13
13
14
14
@ SpringBootTest (
15
15
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
+ })
17
23
class EurekaDiscoveryServerTests {
18
24
19
- @ Value ("${app.eureka.username }" )
25
+ @ Value ("${app.eureka.user }" )
20
26
private String username ;
21
27
22
- @ Value ("${app.eureka.password }" )
28
+ @ Value ("${app.eureka.pass }" )
23
29
private String password ;
24
30
25
31
private TestRestTemplate testRestTemplate ;
@@ -32,20 +38,19 @@ public void setTestRestTemplate(TestRestTemplate testRestTemplate) {
32
38
@ Test
33
39
public void catalogLoads () {
34
40
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
+ }
50
48
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
+ }
51
56
}
0 commit comments