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 @@ ...@@ -31,6 +31,10 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency> <dependency>
<groupId>javax.servlet</groupId> <groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId> <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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -41,4 +41,14 @@ public class SampleGlassfishDeployApplicationIT { ...@@ -41,4 +41,14 @@ public class SampleGlassfishDeployApplicationIT {
assertThat(entity.getBody()).isEqualTo("Hello World"); 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 @@ ...@@ -28,6 +28,10 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency> <dependency>
<groupId>javax.servlet</groupId> <groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId> <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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -40,4 +40,14 @@ public class SampleTomcatDeployApplicationIT { ...@@ -40,4 +40,14 @@ public class SampleTomcatDeployApplicationIT {
assertThat(entity.getBody()).isEqualTo("Hello World"); 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 @@ ...@@ -33,6 +33,10 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency> <dependency>
<groupId>javax.servlet</groupId> <groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId> <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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -40,4 +40,14 @@ public class SampleTomEEDeployApplicationIT { ...@@ -40,4 +40,14 @@ public class SampleTomEEDeployApplicationIT {
assertThat(entity.getBody()).isEqualTo("Hello World"); 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 @@ ...@@ -28,6 +28,10 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency> <dependency>
<groupId>javax.servlet</groupId> <groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId> <artifactId>javax.servlet-api</artifactId>
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
<module name="com.fasterxml.jackson.core.jackson-databind" /> <module name="com.fasterxml.jackson.core.jackson-databind" />
<module name="com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider" /> <module name="com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider" />
<module name="org.jboss.resteasy.resteasy-jackson2-provider" /> <module name="org.jboss.resteasy.resteasy-jackson2-provider" />
<module name="org.slf4j" />
</exclusions> </exclusions>
</deployment> </deployment>
</jboss-deployment-structure> </jboss-deployment-structure>
\ No newline at end of file
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -40,4 +40,14 @@ public class SampleWildFlyDeployApplicationIT { ...@@ -40,4 +40,14 @@ public class SampleWildFlyDeployApplicationIT {
assertThat(entity.getBody()).isEqualTo("Hello World"); 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 @@ ...@@ -27,6 +27,10 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency> <dependency>
<groupId>javax.servlet</groupId> <groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId> <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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -40,4 +40,14 @@ public class SampleWlpDeployApplicationIT { ...@@ -40,4 +40,14 @@ public class SampleWlpDeployApplicationIT {
assertThat(entity.getBody()).isEqualTo("Hello World"); 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