[ 
https://issues.apache.org/jira/browse/WW-5095?focusedWorklogId=512061&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-512061
 ]

ASF GitHub Bot logged work on WW-5095:
--------------------------------------

                Author: ASF GitHub Bot
            Created on: 15/Nov/20 23:00
            Start Date: 15/Nov/20 23:00
    Worklog Time Spent: 10m 
      Work Description: coveralls commented on pull request #447:
URL: https://github.com/apache/struts/pull/447#issuecomment-727652536


   
   [![Coverage 
Status](https://coveralls.io/builds/34980669/badge)](https://coveralls.io/builds/34980669)
   
   Coverage increased (+0.003%) to 49.781% when pulling 
**8d3393f09a06ff4a2b6827b6544524d1d6af3c7c on WW-5095-cherry-pick** into 
**fe5830c26b35112c1716770c03d84a54b5834c4f on master**.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 512061)
    Time Spent: 20m  (was: 10m)

> Junit plugin does not push ACTION_MAPPING into the context resulting in NPE
> ---------------------------------------------------------------------------
>
>                 Key: WW-5095
>                 URL: https://issues.apache.org/jira/browse/WW-5095
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - JUnit
>    Affects Versions: 2.5.25
>            Reporter: Paul Zepernick
>            Priority: Major
>             Fix For: 2.5.26, 2.6
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> 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.
> {noformat}
>  java.lang.NullPointerException
>       at 
> org.apache.struts2.rest.RestWorkflowInterceptor.doIntercept(RestWorkflowInterceptor.java:205){noformat}
> 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
> {code:java}
>         ActionMapping mapping = getActionMapping(request);
>         
> ServletActionContext.getContext().put(ServletActionContext.ACTION_MAPPING, 
> mapping);
> {code}
> Also see this discussion on the struts mailing list
> http://struts.1045723.n5.nabble.com/NPE-when-running-unit-test-with-struts-rest-plugin-tp5724974p5724986.html



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to