diff --git a/spring-boot-samples/spring-boot-sample-webflux/pom.xml b/spring-boot-samples/spring-boot-sample-webflux/pom.xml index 5c5a2f3d79..55578047c4 100644 --- a/spring-boot-samples/spring-boot-sample-webflux/pom.xml +++ b/spring-boot-samples/spring-boot-sample-webflux/pom.xml @@ -25,6 +25,10 @@ org.springframework.boot spring-boot-starter-webflux + + org.springframework.boot + spring-boot-starter-actuator + org.springframework.boot @@ -42,6 +46,14 @@ org.springframework.boot spring-boot-maven-plugin + + + generate build info + + build-info + + + diff --git a/spring-boot-samples/spring-boot-sample-webflux/src/test/java/sample/webflux/SampleWebFluxApplicationTests.java b/spring-boot-samples/spring-boot-sample-webflux/src/test/java/sample/webflux/SampleWebFluxApplicationTests.java index be265f5cb9..3381a9ff5e 100644 --- a/spring-boot-samples/spring-boot-sample-webflux/src/test/java/sample/webflux/SampleWebFluxApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-webflux/src/test/java/sample/webflux/SampleWebFluxApplicationTests.java @@ -40,17 +40,24 @@ public class SampleWebFluxApplicationTests { private WebTestClient webClient; @Test - public void testWelcome() throws Exception { + public void testWelcome() { this.webClient.get().uri("/").accept(MediaType.TEXT_PLAIN).exchange() .expectBody(String.class).isEqualTo("Hello World"); } @Test - public void testEcho() throws Exception { + public void testEcho() { this.webClient.post().uri("/echo").contentType(MediaType.TEXT_PLAIN) .accept(MediaType.TEXT_PLAIN) .body(Mono.just("Hello WebFlux!"), String.class).exchange() .expectBody(String.class).isEqualTo("Hello WebFlux!"); } + @Test + public void testActuatorStatus() { + this.webClient.get().uri("/application/status").accept(MediaType.APPLICATION_JSON) + .exchange().expectStatus().isOk().expectBody() + .json("{\"status\":\"UP\"}"); + } + }