JUnit测试报错
public class ProductCategoryDaoTest extends BaseTest {
@Autowired
private ProductCategoryDao productCategoryDao;
@Test
public void testBQueryByShopId() throws Exception {
long shopId = 1;
List<ProductCategory> productCategoryList = productCategoryDao.queryProductCategoryList(shopId);
System.out.println("店铺类别数为:" + productCategoryList.size());
}商品类别列表展示,JUnit单元测试的时候显示错误,

严重: Caught exception while allowing TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener@4157f54e] to prepare test instance [com.hbut.o2o.dao.ProductCategoryDaoTest@71e693fa]
java.lang.IllegalStateException: Failed to load ApplicationContext
16
收起
正在回答 回答被采纳积分+1
4. SSM到Spring Boot入门与综合实战
- 参与学习 人
- 提交作业 323 份
- 解答问题 8263 个
本阶段将带你学习主流框架SSM,以及SpringBoot ,打通成为Java工程师的最后一公里!
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星