### Question:
RequestParametersDataResolver implements RuntimeDataResolver { @Override public void resolveData(final HttpServletRequest request, final HttpServletResponse response, final Map<String, ? extends Object> model, final SoyMapData root) { for (final Enumeration e = request.getParameterNames(); e.hasMoreElements();) { final String paramName = (String) e.nextElement(); final String parameter = request.getParameter(paramName); if (parameter != null) { root.put("_request.parameter." + paramName, parameter); } } }  @Override void resolveData(final HttpServletRequest request, final HttpServletResponse response, final Map<String, ? extends Object> model, final SoyMapData root); String getPrefix(); void setPrefix(String prefix);  }### Answer:
@Test public void resolveRequestParameters() throws Exception { final SoyMapData soyMapData = new SoyMapData(); final Vector<String> names = new Vector<String>(); names.add("name1"); names.add("name2"); final Vector<String> values = new Vector<String>(); values.add("value1"); values.add("value2"); final HttpServletRequest request = mock(HttpServletRequest.class); final HttpServletResponse response = mock(HttpServletResponse.class); final Enumeration e = mock(Enumeration.class); when(e.hasMoreElements()).thenReturn(false); when(request.getParameterNames()).thenReturn(names.elements()); when(request.getHeaderNames()).thenReturn(e); when(request.getParameter("name1")).thenReturn(values.get(0)); when(request.getParameter("name2")).thenReturn(values.get(1)); when(request.getCookies()).thenReturn(new Cookie[]{}); requestParametersResolver.resolveData(request, response, null, soyMapData); Assert.assertEquals("should not be value1", "value1", soyMapData.get("_request.parameter.name1").stringValue()); Assert.assertEquals("should not be value2", "value2", soyMapData.get("_request.parameter.name2").stringValue()); }