From 1f3099731b124d82e28d1edcea20f10574ec7237 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sun, 7 Jan 2018 20:58:14 +0200 Subject: [PATCH] remove extra spring-boot-actuator project --- spring-boot-actuator/.gitignore | 4 - spring-boot-actuator/README.MD | 0 spring-boot-actuator/pom.xml | 122 ------------------ .../java/org/baeldung/MainApplication.java | 13 -- .../java/org/baeldung/config/MainConfig.java | 17 --- .../src/main/resources/application.properties | 1 - .../config/ActuatorInfoIntegrationTest.java | 32 ----- .../src/test/resources/expectedResponse.json | 1 - 8 files changed, 190 deletions(-) delete mode 100644 spring-boot-actuator/.gitignore delete mode 100644 spring-boot-actuator/README.MD delete mode 100644 spring-boot-actuator/pom.xml delete mode 100644 spring-boot-actuator/src/main/java/org/baeldung/MainApplication.java delete mode 100644 spring-boot-actuator/src/main/java/org/baeldung/config/MainConfig.java delete mode 100644 spring-boot-actuator/src/main/resources/application.properties delete mode 100644 spring-boot-actuator/src/test/java/org/baeldung/config/ActuatorInfoIntegrationTest.java delete mode 100644 spring-boot-actuator/src/test/resources/expectedResponse.json diff --git a/spring-boot-actuator/.gitignore b/spring-boot-actuator/.gitignore deleted file mode 100644 index 60be5b80aa..0000000000 --- a/spring-boot-actuator/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/target/ -.settings/ -.classpath -.project diff --git a/spring-boot-actuator/README.MD b/spring-boot-actuator/README.MD deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/spring-boot-actuator/pom.xml b/spring-boot-actuator/pom.xml deleted file mode 100644 index 299c7e76a5..0000000000 --- a/spring-boot-actuator/pom.xml +++ /dev/null @@ -1,122 +0,0 @@ - - 4.0.0 - com.baeldung - spring-boot-actuator - 0.0.1-SNAPSHOT - jar - spring-boot - This is simple boot application for Spring boot actuator test - - - - org.springframework.boot - spring-boot-starter-parent - 1.5.2.RELEASE - - - - - - org.springframework.boot - spring-boot-starter-web - - - - org.springframework.boot - spring-boot-starter-actuator - - - - org.springframework.boot - spring-boot-starter - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - spring-boot-actuator - - - src/main/resources - true - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - **/*IntegrationTest.java - - - - - - - - - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - - - - - org.baeldung.MainApplication - UTF-8 - 1.8 - - - diff --git a/spring-boot-actuator/src/main/java/org/baeldung/MainApplication.java b/spring-boot-actuator/src/main/java/org/baeldung/MainApplication.java deleted file mode 100644 index 7c9054dbf8..0000000000 --- a/spring-boot-actuator/src/main/java/org/baeldung/MainApplication.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.baeldung; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.baeldung.config.MainConfig; - -@SpringBootApplication -public class MainApplication { - - public static void main(String args[]) { - SpringApplication.run(MainConfig.class, args); - } -} diff --git a/spring-boot-actuator/src/main/java/org/baeldung/config/MainConfig.java b/spring-boot-actuator/src/main/java/org/baeldung/config/MainConfig.java deleted file mode 100644 index 27c97cc006..0000000000 --- a/spring-boot-actuator/src/main/java/org/baeldung/config/MainConfig.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.baeldung.config; - -import java.util.Collections; -import org.springframework.boot.actuate.info.InfoContributor; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.context.annotation.Bean; - -@EnableAutoConfiguration -public class MainConfig { - - public MainConfig() {} - - @Bean - public InfoContributor getInfoContributor() { - return (infoBuilder) -> infoBuilder.withDetail("applicationInfo", Collections.singletonMap("ActiveUserCount", "10")); - } -} diff --git a/spring-boot-actuator/src/main/resources/application.properties b/spring-boot-actuator/src/main/resources/application.properties deleted file mode 100644 index 835c78eda2..0000000000 --- a/spring-boot-actuator/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ -info.app.name=Sample application \ No newline at end of file diff --git a/spring-boot-actuator/src/test/java/org/baeldung/config/ActuatorInfoIntegrationTest.java b/spring-boot-actuator/src/test/java/org/baeldung/config/ActuatorInfoIntegrationTest.java deleted file mode 100644 index 0b5e3b3eef..0000000000 --- a/spring-boot-actuator/src/test/java/org/baeldung/config/ActuatorInfoIntegrationTest.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.baeldung.config; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.web.client.TestRestTemplate; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; -import static org.junit.Assert.*; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Paths; - -@RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = MainConfig.class) -@TestPropertySource(properties = { "security.basic.enabled=false" }) -public class ActuatorInfoIntegrationTest { - - @Autowired - private TestRestTemplate restTemplate; - - @Test - public void whenGetInfo_thenAdditionalInfoReturned() throws IOException { - final String expectedResponse = new String(Files.readAllBytes(Paths.get("src/test/resources/expectedResponse.json"))); - final ResponseEntity responseEntity = this.restTemplate.getForEntity("/info", String.class); - assertEquals(HttpStatus.OK, responseEntity.getStatusCode()); - assertEquals(expectedResponse, responseEntity.getBody()); - } -} \ No newline at end of file diff --git a/spring-boot-actuator/src/test/resources/expectedResponse.json b/spring-boot-actuator/src/test/resources/expectedResponse.json deleted file mode 100644 index caa0bdbbf8..0000000000 --- a/spring-boot-actuator/src/test/resources/expectedResponse.json +++ /dev/null @@ -1 +0,0 @@ -{"app":{"name":"Sample application"},"applicationInfo":{"ActiveUserCount":"10"}} \ No newline at end of file