背景
新建了一个spring boot项目,但是在进行单元测试时提示“Empty test suite”
alpha.iml
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/alpha-interface/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/alpha-exptmgr/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/alpha-exptmgr/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/alpha-exptmgr/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/alpha-exptmgr/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/alpha-demo/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/alpha-demo/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/alpha-demo/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/alpha-demo/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/alpha-interfaces/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/alpha-interfaces/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/alpha-interfaces/src/test/java" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
······
原因
/alpha-exptmgr/src/test/resources下的代码已经被alpha模块占用
解决方案
删除<content url="file://$MODULE_DIR$">下相关配置即可
网友评论