springmvc或者springboot 单元测试
- 加上注解
注意: 一定要有@WebAppConfiguration,不然httpServletRequest和httpServletResponse不注入工厂
@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
@ContextConfiguration(locations={"classpath:config/applicationContext.xml","classpath:config/jetty-context.xml"})
public class TopoServiceImplTest {
}