【发布时间】:2017-10-10 13:59:46
【问题描述】:
我有一个大型 java 项目,想为项目的几个部分构建测试类。
我的 Spring Boot 测试文件夹的 Root 包中有 Context 测试。
-Test
-Root
-ParentContextTest.class
-ChildContextTest.class
-FocusedTest
-UserPermissioningTest.class <- extends ChildContextTest.class
我想像上面那样安排我的测试包,所以在构建项目时只测试主上下文,并且 FocusedTest 包中的任何内容都不会运行。
FocusedTest 测试类在手动运行测试时扩展了相应的 Context。
我正在使用 spring boot + maven。
任何帮助都会很棒。
我在 pom 中使用 Spring boot Build 如下所示
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
<executable>true</executable>
<excludes>
<exclude>
<groupId>com.Test.FocusedTest</groupId>
</exclude>
</excludes>
</configuration>
</plugin>
【问题讨论】: