Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-4508

DefaultActionMapperTest failures due to invalid mock type for parameterMap

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.3.24
    • Fix Version/s: 2.5.x
    • Component/s: Unit Tests
    • Labels:
      None
    • Environment:

      Description

      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

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              dmcgahon Dermot McGahon
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: