Commit 29b29e7d authored by Andy Wilkinson's avatar Andy Wilkinson

Merge pull request #11886 from Vedran Pavić

* gh-11886:
  Polish "Update deployment tests to include Actuator"
  Update deployment tests to include Actuator
parents 43285fb7 5cb38804
......@@ -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>
......
/*
* 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>
......
/*
* 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>
......
/*
* 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,7 @@
<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>
</deployment>
</jboss-deployment-structure>
/*
* 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>
......
/*
* 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\"}");
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment