From cef7e11ec1a273c589fe7a8cd73962209dc3cdfb Mon Sep 17 00:00:00 2001 From: liaozan <378024053@qq.com> Date: Mon, 13 Mar 2023 22:47:07 +0800 Subject: [PATCH] Add spring-boot-starter-test --- .../META-INF/maven/archetype-metadata.xml | 12 ++++++++++ .../__subModuleNamePrefix__-web/pom.xml | 5 ++++ .../src/test/java/ApplicationTest.java | 23 +++++++++++++++++++ .../src/test/resources/application.yaml | 8 +++++++ 4 files changed, 48 insertions(+) create mode 100644 src/main/resources/archetype-resources/__subModuleNamePrefix__-web/src/test/java/ApplicationTest.java create mode 100644 src/main/resources/archetype-resources/__subModuleNamePrefix__-web/src/test/resources/application.yaml diff --git a/src/main/resources/META-INF/maven/archetype-metadata.xml b/src/main/resources/META-INF/maven/archetype-metadata.xml index 43b894c..c04af24 100644 --- a/src/main/resources/META-INF/maven/archetype-metadata.xml +++ b/src/main/resources/META-INF/maven/archetype-metadata.xml @@ -135,6 +135,18 @@ **/*.* + + src/test/java + + **/*.java + + + + src/test/resources + + **/*.* + + diff --git a/src/main/resources/archetype-resources/__subModuleNamePrefix__-web/pom.xml b/src/main/resources/archetype-resources/__subModuleNamePrefix__-web/pom.xml index c5cb65a..dc032ea 100644 --- a/src/main/resources/archetype-resources/__subModuleNamePrefix__-web/pom.xml +++ b/src/main/resources/archetype-resources/__subModuleNamePrefix__-web/pom.xml @@ -30,6 +30,11 @@ com.schbrain.framework logger-spring-boot-starter + + org.springframework.boot + spring-boot-starter-test + test + diff --git a/src/main/resources/archetype-resources/__subModuleNamePrefix__-web/src/test/java/ApplicationTest.java b/src/main/resources/archetype-resources/__subModuleNamePrefix__-web/src/test/java/ApplicationTest.java new file mode 100644 index 0000000..b74afec --- /dev/null +++ b/src/main/resources/archetype-resources/__subModuleNamePrefix__-web/src/test/java/ApplicationTest.java @@ -0,0 +1,23 @@ +package ${package}; + +import lombok.extern.slf4j.Slf4j; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@Slf4j +@SpringBootTest +public class ApplicationTest { + + @BeforeEach + void init() { + + } + + @Test + void applicationTest() { + // write your testcase here + log.info("application started"); + } + +} \ No newline at end of file diff --git a/src/main/resources/archetype-resources/__subModuleNamePrefix__-web/src/test/resources/application.yaml b/src/main/resources/archetype-resources/__subModuleNamePrefix__-web/src/test/resources/application.yaml new file mode 100644 index 0000000..76f82db --- /dev/null +++ b/src/main/resources/archetype-resources/__subModuleNamePrefix__-web/src/test/resources/application.yaml @@ -0,0 +1,8 @@ +spring: + application: + name: ${rootArtifactId} + profiles: + active: dev +apollo: + bootstrap: + namespaces: application,jdbc-common,redis-common \ No newline at end of file -- GitLab