Reputation: 1484
Guys what is the best way to test struts actions? Is there any framework someone can recommend? I just recently started working with struts, I used to use mockito for spring mvc testing, but I can't find any good source online, most of them are way too outdated.
Upvotes: 0
Views: 306
Reputation: 2694
Refer to this sample implementation:
@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();
}
Upvotes: 1