Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.5.25
-
None
Description
org.apache.struts2.StrutsJUnit4TestCase is not pushing the ACTION_MAPPING into the context which results in the following NPE when testing a Struts action and using the struts-rest plugin.
java.lang.NullPointerException at org.apache.struts2.rest.RestWorkflowInterceptor.doIntercept(RestWorkflowInterceptor.java:205)
The issue can be replicated with this sample github project
https://github.com/zepernick/struts25-rest-junit
The current work around is to override the org.apache.struts2.StrutsJUnit4TestCase#getActionProxy and add
ActionMapping mapping = getActionMapping(request); ServletActionContext.getContext().put(ServletActionContext.ACTION_MAPPING, mapping);
Also see this discussion on the struts mailing list
Attachments
Issue Links
- links to