Update deployment tests to include Actuator

See gh-11886
pull/11922/merge
Vedran Pavic 7 years ago committed by Andy Wilkinson
parent 43285fb77c
commit fc9036a3d9

@ -31,6 +31,10 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>

@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -41,4 +41,14 @@ public class SampleGlassfishDeployApplicationIT {
assertThat(entity.getBody()).isEqualTo("Hello World");
}
@Test
public void testHealth() throws Exception {
String url = "http://localhost:" + this.port + "/bootapp/actuator/health";
System.out.println(url);
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url,
String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
assertThat(entity.getBody()).isEqualTo("{\"status\":\"UP\"}");
}
}

@ -28,6 +28,10 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>

@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -40,4 +40,14 @@ public class SampleTomcatDeployApplicationIT {
assertThat(entity.getBody()).isEqualTo("Hello World");
}
@Test
public void testHealth() throws Exception {
String url = "http://localhost:" + this.port + "/bootapp/actuator/health";
System.out.println(url);
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url,
String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
assertThat(entity.getBody()).isEqualTo("{\"status\":\"UP\"}");
}
}

@ -33,6 +33,10 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>

@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -40,4 +40,14 @@ public class SampleTomEEDeployApplicationIT {
assertThat(entity.getBody()).isEqualTo("Hello World");
}
@Test
public void testHealth() throws Exception {
String url = "http://localhost:" + this.port + "/bootapp/actuator/health";
System.out.println(url);
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url,
String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
assertThat(entity.getBody()).isEqualTo("{\"status\":\"UP\"}");
}
}

@ -28,6 +28,10 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>

@ -7,6 +7,14 @@
<module name="com.fasterxml.jackson.core.jackson-databind" />
<module name="com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider" />
<module name="org.jboss.resteasy.resteasy-jackson2-provider" />
<module name="org.slf4j" />
</exclusions>
<dependencies>
<system>
<paths>
<path name="com/sun/management" />
</paths>
</system>
</dependencies>
</deployment>
</jboss-deployment-structure>
</jboss-deployment-structure>

@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -40,4 +40,14 @@ public class SampleWildFlyDeployApplicationIT {
assertThat(entity.getBody()).isEqualTo("Hello World");
}
@Test
public void testHealth() throws Exception {
String url = "http://localhost:" + this.port + "/bootapp/actuator/health";
System.out.println(url);
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url,
String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
assertThat(entity.getBody()).isEqualTo("{\"status\":\"UP\"}");
}
}

@ -27,6 +27,10 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>

@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -40,4 +40,14 @@ public class SampleWlpDeployApplicationIT {
assertThat(entity.getBody()).isEqualTo("Hello World");
}
@Test
public void testHealth() throws Exception {
String url = "http://localhost:" + this.port + "/bootapp/actuator/health";
System.out.println(url);
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url,
String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
assertThat(entity.getBody()).isEqualTo("{\"status\":\"UP\"}");
}
}

Loading…
Cancel
Save