Spring MVC Controller测试报WebApplicationContext is required
来源:互联网 发布:有好看衣服的淘宝店铺 编辑:程序博客网 时间:2024/05/20 06:56
我在用Spock做Spring MVC Controller测试时,总是报webapplicationcontext无法找到,我在代码里已经标注了@WebAppConfiguration,但是application文件确实没有加载。后来查找知道原因是因为用Spock测试框架时,没有
加载相应的jar包spock-spring-1.0-groovy-2.4.jar.
java.lang.IllegalArgumentException: WebApplicationContext is required
at org.springframework.util.Assert.notNull(Assert.java:115)at org.springframework.test.web.servlet.setup.DefaultMockMvcBuilder.<init>(DefaultMockMvcBuilder.java:52)
at org.springframework.test.web.servlet.setup.MockMvcBuilders.webAppContextSetup(MockMvcBuilders.java:47)
0 0
- Spring MVC Controller测试报WebApplicationContext is required
- spring mvc测试controller
- spring mvc + hibernate 整合报错 'sessionFactory' or 'hibernateTemplate' is required
- Spring MVC学习------------WebApplicationContext
- Spring MVC学习------------WebApplicationContext
- [spring-mvc] webApplicationContext
- spring controller中获取webApplicationContext
- spring mvc Controller重复导致报错
- [Spring MVC] What is my Spring MVC controller not working?
- 使用MockMvc测试Spring mvc Controller
- 使用MockMvc测试Spring mvc Controller
- spring mvc 使用junit 测试 controller
- 使用MockMvc测试Spring mvc Controller
- spring mvc + junit4测试(包含测试controller)
- Spring MVC不进入Controller,报错404解决方案
- spring mvc 下 applicationContext 和webApplicationContext
- spring MVC--WebApplicationContext做了什么
- spring mvc 下 applicationContext 和webApplicationContext
- #define的一些用法
- 深度学习--数据增强
- poj 3666 线性dp
- 深入理解Java虚拟机--OutOfMemoryError异常
- 事务
- Spring MVC Controller测试报WebApplicationContext is required
- Merge k Sorted Lists
- hbase hive
- 异步
- POJ 2492 A Bug's Life
- 阻塞
- J2EE自定义标签
- PlSql链接不上Oracle问题跟踪
- Android逆向之旅--运行时修改内存中的Dalvik指令来改变代码逻辑