目录

chen 的个人博客

VX:ZzzChChen
Phone:13403656751
Email:zxydczzs@gmail.com

X

Junit4 单元测试注入bean失败

一、报错截图

image.png

二、单元测试截图

image.png

三、解决

@SpringBootTest(classes = XxxApplication.class) 改为 @SpringBootTest(classes = XxxApplication.class, webEnvironment=SpringBootTest.WebEnvironment.RANDOM_PORT)


标题:Junit4 单元测试注入bean失败
作者:zzzzchen
地址:https://www.dczzs.com/articles/2022/04/22/1650636414089.html