@ -94,7 +94,7 @@ public class SampleActuatorApplicationTests {
@SuppressWarnings ( "rawtypes" )
@SuppressWarnings ( "rawtypes" )
ResponseEntity < Map > entity = this . restTemplate
ResponseEntity < Map > entity = this . restTemplate
. withBasicAuth ( "user" , getPassword ( ) )
. withBasicAuth ( "user" , getPassword ( ) )
. getForEntity ( "/a pplication /metrics", Map . class ) ;
. getForEntity ( "/a ctuator /metrics", Map . class ) ;
assertThat ( entity . getStatusCode ( ) ) . isEqualTo ( HttpStatus . OK ) ;
assertThat ( entity . getStatusCode ( ) ) . isEqualTo ( HttpStatus . OK ) ;
Map < String , Object > body = entity . getBody ( ) ;
Map < String , Object > body = entity . getBody ( ) ;
assertThat ( body ) . containsKey ( "names" ) ;
assertThat ( body ) . containsKey ( "names" ) ;
@ -107,7 +107,7 @@ public class SampleActuatorApplicationTests {
@SuppressWarnings ( "rawtypes" )
@SuppressWarnings ( "rawtypes" )
ResponseEntity < Map > entity = this . restTemplate
ResponseEntity < Map > entity = this . restTemplate
. withBasicAuth ( "user" , getPassword ( ) )
. withBasicAuth ( "user" , getPassword ( ) )
. getForEntity ( "/a pplication /env", Map . class ) ;
. getForEntity ( "/a ctuator /env", Map . class ) ;
assertThat ( entity . getStatusCode ( ) ) . isEqualTo ( HttpStatus . OK ) ;
assertThat ( entity . getStatusCode ( ) ) . isEqualTo ( HttpStatus . OK ) ;
@SuppressWarnings ( "unchecked" )
@SuppressWarnings ( "unchecked" )
Map < String , Object > body = entity . getBody ( ) ;
Map < String , Object > body = entity . getBody ( ) ;
@ -118,7 +118,7 @@ public class SampleActuatorApplicationTests {
public void testHealth ( ) throws Exception {
public void testHealth ( ) throws Exception {
ResponseEntity < String > entity = this . restTemplate
ResponseEntity < String > entity = this . restTemplate
. withBasicAuth ( "user" , getPassword ( ) )
. withBasicAuth ( "user" , getPassword ( ) )
. getForEntity ( "/a pplication /health", String . class ) ;
. getForEntity ( "/a ctuator /health", String . class ) ;
assertThat ( entity . getStatusCode ( ) ) . isEqualTo ( HttpStatus . OK ) ;
assertThat ( entity . getStatusCode ( ) ) . isEqualTo ( HttpStatus . OK ) ;
assertThat ( entity . getBody ( ) ) . contains ( "\"status\":\"UP\"" ) ;
assertThat ( entity . getBody ( ) ) . contains ( "\"status\":\"UP\"" ) ;
assertThat ( entity . getBody ( ) ) . doesNotContain ( "\"hello\":\"1\"" ) ;
assertThat ( entity . getBody ( ) ) . doesNotContain ( "\"hello\":\"1\"" ) ;
@ -128,7 +128,7 @@ public class SampleActuatorApplicationTests {
public void testInfo ( ) throws Exception {
public void testInfo ( ) throws Exception {
ResponseEntity < String > entity = this . restTemplate
ResponseEntity < String > entity = this . restTemplate
. withBasicAuth ( "user" , getPassword ( ) )
. withBasicAuth ( "user" , getPassword ( ) )
. getForEntity ( "/a pplication /info", String . class ) ;
. getForEntity ( "/a ctuator /info", String . class ) ;
assertThat ( entity . getStatusCode ( ) ) . isEqualTo ( HttpStatus . OK ) ;
assertThat ( entity . getStatusCode ( ) ) . isEqualTo ( HttpStatus . OK ) ;
assertThat ( entity . getBody ( ) )
assertThat ( entity . getBody ( ) )
. contains ( "\"artifact\":\"spring-boot-sample-actuator\"" ) ;
. contains ( "\"artifact\":\"spring-boot-sample-actuator\"" ) ;
@ -169,7 +169,7 @@ public class SampleActuatorApplicationTests {
@SuppressWarnings ( "rawtypes" )
@SuppressWarnings ( "rawtypes" )
ResponseEntity < Map > entity = this . restTemplate
ResponseEntity < Map > entity = this . restTemplate
. withBasicAuth ( "user" , getPassword ( ) )
. withBasicAuth ( "user" , getPassword ( ) )
. getForEntity ( "/a pplication /trace", Map . class ) ;
. getForEntity ( "/a ctuator /trace", Map . class ) ;
assertThat ( entity . getStatusCode ( ) ) . isEqualTo ( HttpStatus . OK ) ;
assertThat ( entity . getStatusCode ( ) ) . isEqualTo ( HttpStatus . OK ) ;
Map < String , Object > body = entity . getBody ( ) ;
Map < String , Object > body = entity . getBody ( ) ;
Map < String , Object > trace = ( ( List < Map < String , Object > > ) body . get ( "traces" ) )
Map < String , Object > trace = ( ( List < Map < String , Object > > ) body . get ( "traces" ) )
@ -183,11 +183,11 @@ public class SampleActuatorApplicationTests {
@SuppressWarnings ( "unchecked" )
@SuppressWarnings ( "unchecked" )
public void traceWithParameterMap ( ) throws Exception {
public void traceWithParameterMap ( ) throws Exception {
this . restTemplate . withBasicAuth ( "user" , getPassword ( ) )
this . restTemplate . withBasicAuth ( "user" , getPassword ( ) )
. getForEntity ( "/a pplication /health?param1=value1", String . class ) ;
. getForEntity ( "/a ctuator /health?param1=value1", String . class ) ;
@SuppressWarnings ( "rawtypes" )
@SuppressWarnings ( "rawtypes" )
ResponseEntity < Map > entity = this . restTemplate
ResponseEntity < Map > entity = this . restTemplate
. withBasicAuth ( "user" , getPassword ( ) )
. withBasicAuth ( "user" , getPassword ( ) )
. getForEntity ( "/a pplication /trace", Map . class ) ;
. getForEntity ( "/a ctuator /trace", Map . class ) ;
assertThat ( entity . getStatusCode ( ) ) . isEqualTo ( HttpStatus . OK ) ;
assertThat ( entity . getStatusCode ( ) ) . isEqualTo ( HttpStatus . OK ) ;
Map < String , Object > body = entity . getBody ( ) ;
Map < String , Object > body = entity . getBody ( ) ;
Map < String , Object > trace = ( ( List < Map < String , Object > > ) body . get ( "traces" ) )
Map < String , Object > trace = ( ( List < Map < String , Object > > ) body . get ( "traces" ) )
@ -215,7 +215,7 @@ public class SampleActuatorApplicationTests {
@SuppressWarnings ( "rawtypes" )
@SuppressWarnings ( "rawtypes" )
ResponseEntity < Map > entity = this . restTemplate
ResponseEntity < Map > entity = this . restTemplate
. withBasicAuth ( "user" , getPassword ( ) )
. withBasicAuth ( "user" , getPassword ( ) )
. getForEntity ( "/a pplication /beans", Map . class ) ;
. getForEntity ( "/a ctuator /beans", Map . class ) ;
assertThat ( entity . getStatusCode ( ) ) . isEqualTo ( HttpStatus . OK ) ;
assertThat ( entity . getStatusCode ( ) ) . isEqualTo ( HttpStatus . OK ) ;
assertThat ( entity . getBody ( ) ) . containsOnlyKeys ( "beans" , "parent" , "contextId" ) ;
assertThat ( entity . getBody ( ) ) . containsOnlyKeys ( "beans" , "parent" , "contextId" ) ;
assertThat ( ( ( String ) entity . getBody ( ) . get ( "contextId" ) ) )
assertThat ( ( ( String ) entity . getBody ( ) . get ( "contextId" ) ) )
@ -228,7 +228,7 @@ public class SampleActuatorApplicationTests {
@SuppressWarnings ( "rawtypes" )
@SuppressWarnings ( "rawtypes" )
ResponseEntity < Map > entity = this . restTemplate
ResponseEntity < Map > entity = this . restTemplate
. withBasicAuth ( "user" , getPassword ( ) )
. withBasicAuth ( "user" , getPassword ( ) )
. getForEntity ( "/a pplication /configprops", Map . class ) ;
. getForEntity ( "/a ctuator /configprops", Map . class ) ;
assertThat ( entity . getStatusCode ( ) ) . isEqualTo ( HttpStatus . OK ) ;
assertThat ( entity . getStatusCode ( ) ) . isEqualTo ( HttpStatus . OK ) ;
Map < String , Object > body = entity . getBody ( ) ;
Map < String , Object > body = entity . getBody ( ) ;
assertThat ( ( Map < String , Object > ) body . get ( "beans" ) )
assertThat ( ( Map < String , Object > ) body . get ( "beans" ) )