伙计们,测试struts动作的最好方法是什么?有没有人可以推荐的框架?我最近刚刚开始使用struts,我曾经使用mockito进行spring mvc测试,但我在网上找不到任何好的源码,它们中的大多数都太过时了。
发布于 2020-06-26 20:56:22
参考这个示例实现:
@Override
public void setUp() throws Exception {
super.setUp();
List<ContainerProvider> providers = super.configurationManager.getContainerProviders();
//make one of these for each config file you want to add
StrutsXmlConfigurationProvider newConfig = new StrutsXmlConfigurationProvider("src/main/webapp/WEB-INF/classes/struts.xml", true, super.servletContext);
providers.add(newConfig);
super.configurationManager.reload();
}https://stackoverflow.com/questions/62594853
复制相似问题