发现是单元测试代码中import错误导致,具体看示例:
import org.junit.Test; //这样是正确的
import org.junit.jupiter.api.Test //这样是错误的,maven打包会出错
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class FormFeignApplicationTests {
@Test
void contextLoads() {
}
}
本文解决了一个单元测试代码中由于import语句错误导致的问题,详细解释了正确的导入JUnit和Spring Boot测试注解的方法。

488

被折叠的 条评论
为什么被折叠?



