SpringBoot AOP测试在Eclipse正常但Maven执行失败求助
Maven Surefire执行Spring AOP切面测试失败,但Eclipse中正常运行
我的项目jobkit模块中有4个验证@Aspect调用的测试无法通过,这些测试在最新版Eclipse中可正常运行,但在最新版Maven中执行失败。
复现步骤
git clone https://github.com/hdsdi3g/prodlib git checkout issue51 mvn install -DskipTests && mvn test -rf :jobkit # 或直接执行mvn test
相关代码位置
- 测试类:
jobkit/springboot-service/src/test/java/tv/hd3g/jobkit/mod/component/SupervisableAspectTest.java第70行 - 切面类:
jobkit/springboot-service/src/main/java/tv/hd3g/jobkit/mod/component/SupervisableAspect.java - 目标测试类:
jobkit/springboot-service/src/test/java/tv/hd3g/jobkit/mod/component/TestWithSupervisable.java
错误信息
[ERROR] Failures: [ERROR] SupervisableAspectTest.testWithDefaultName:76 Wanted but not invoked: getSupervisableSupplier bean.createAndStart( "TestWithSupervisable.aSupervisableMethod" ); -> at tv.hd3g.jobkit.engine.SupervisableServiceSupplier.createAndStart(SupervisableServiceSupplier.java:31) Actually, there were zero interactions with this mock.
相关配置文件
- 主pom:
pom.xml - 项目pom:
jobkit/springboot-service/pom.xml - 依赖版本:
jobkit/springboot-service/THIRD-PARTY.txt
所有测试在Eclipse中正常,但Maven Surefire测试失败,想确认是代码实现问题还是Maven配置问题?
内容的提问来源于stack exchange,提问作者hdsdi3g
相关产品推荐
相关产品推荐

