- jdk版本 1.8
- spring版本4.0+
- 1.启动测试类会报错 则做出以下的修改 资料
A. 测试类加上 @WebAppConfiguration B. 把servlet版本提高到3.0版本以上 <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>3.0.1</version> </dependency>
- 2.项目标准测试类开头为:
@RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = {"classpath:/applicationContext.xml"}) @Slf4j @WebAppConfiguration public class GroupServiceTest { @Autowired private xxxService xxxService; @Test public void test() { } }
集成Swagger2单元测试的问题
最新推荐文章于 2024-04-07 16:06:01 发布