MockHttpServletRequest's getParameter(Values) returns null for null parameter name

Issue: SPR-10192
This commit is contained in:
Juergen Hoeller
2013-01-21 11:31:28 +01:00
committed by unknown
parent 692ced8046
commit c1a4f5c0fe
3 changed files with 54 additions and 45 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,8 +16,6 @@
package org.springframework.mock.web;
import static org.junit.Assert.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -29,6 +27,8 @@ import java.util.Map;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Unit tests for {@link MockHttpServletRequest}.
*
@@ -105,6 +105,12 @@ public class MockHttpServletRequestTests {
assertEquals("HTTP header casing not being preserved", headerName, requestHeaders.nextElement());
}
@Test
public void nullParameterName() {
assertNull(request.getParameter(null));
assertNull(request.getParameterValues(null));
}
@Test
public void setMultipleParameters() {
request.setParameter("key1", "value1");