You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Lukasz Lenart (Jira)" <ji...@apache.org> on 2023/06/28 07:00:00 UTC

[jira] [Updated] (WW-4508) DefaultActionMapperTest failures due to invalid mock type for parameterMap

     [ https://issues.apache.org/jira/browse/WW-4508?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lukasz Lenart updated WW-4508:
------------------------------
    Fix Version/s: 6.4.0
                       (was: 6.2.0)

> DefaultActionMapperTest failures due to invalid mock type for parameterMap
> --------------------------------------------------------------------------
>
>                 Key: WW-4508
>                 URL: https://issues.apache.org/jira/browse/WW-4508
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Unit Tests
>    Affects Versions: 2.3.24
>         Environment: The JVM where this was encountered is the Waratek JVM (www.waratek.com) which contains support for prevention of SQL Injection attacks. This bug is not reproducible using OpenJDK or any other JVM due to the fact the tests reference only the keys and not the values.
>            Reporter: Dermot McGahon
>            Priority: Minor
>             Fix For: 6.4.0
>
>
> All of the tests which use StrutsMockHttpServletRequest are setting up incorrectly typed parameterMaps in the mock.
> A parameterMap should be typed java.util.Map<java.lang.String,java.lang.String[]> and not Map<String,String> as the tests are doing i.e the value parameter should be String[] and not String. This caused us to see test failures when treating those values as String[] when they weren't.
> See:
> http://docs.oracle.com/javaee/6/api/javax/servlet/ServletRequest.html
> http://docs.oracle.com/javaee/7/api/javax/servlet/ServletRequest.html#getParameterMap%28%29



--
This message was sent by Atlassian Jira
(v8.20.10#820010)