@Test public void readParametersNull() { Map<String, String[]> result = extractor.getParameterMap(httpServletRequest.getClass(), httpServletRequest); assertThat(result, is(nullValue())); }
public Map<String, String[]> getParameterMap(Class<?> httpServletRequestClass, Object httpServletRequest) { Method m = retrieveMethod(HttpMethods.SERVLET_GET_PARAMETER_MAP, httpServletRequestClass); if (null == m) { return null; } try { @SuppressWarnings("unchecked") Map<String, String[]> parameterMap = (Map<String, String[]>) m.invoke(httpServletRequest, (Object[]) null); if ((null == parameterMap) || parameterMap.isEmpty()) { return null; } return strConstraint.crop(parameterMap); } catch (Exception e) { LOG.error("Invocation on given object failed.", e); return null; } }
HttpInformationExtractor { public Map<String, String[]> getParameterMap(Class<?> httpServletRequestClass, Object httpServletRequest) { Method m = retrieveMethod(HttpMethods.SERVLET_GET_PARAMETER_MAP, httpServletRequestClass); if (null == m) { return null; } try { @SuppressWarnings("unchecked") Map<String, String[]> parameterMap = (Map<String, String[]>) m.invoke(httpServletRequest, (Object[]) null); if ((null == parameterMap) || parameterMap.isEmpty()) { return null; } return strConstraint.crop(parameterMap); } catch (Exception e) { LOG.error("Invocation on given object failed.", e); return null; } } }
HttpInformationExtractor { public Map<String, String[]> getParameterMap(Class<?> httpServletRequestClass, Object httpServletRequest) { Method m = retrieveMethod(HttpMethods.SERVLET_GET_PARAMETER_MAP, httpServletRequestClass); if (null == m) { return null; } try { @SuppressWarnings("unchecked") Map<String, String[]> parameterMap = (Map<String, String[]>) m.invoke(httpServletRequest, (Object[]) null); if ((null == parameterMap) || parameterMap.isEmpty()) { return null; } return strConstraint.crop(parameterMap); } catch (Exception e) { LOG.error("Invocation on given object failed.", e); return null; } } HttpInformationExtractor(StringConstraint strConstraint); }
HttpInformationExtractor { public Map<String, String[]> getParameterMap(Class<?> httpServletRequestClass, Object httpServletRequest) { Method m = retrieveMethod(HttpMethods.SERVLET_GET_PARAMETER_MAP, httpServletRequestClass); if (null == m) { return null; } try { @SuppressWarnings("unchecked") Map<String, String[]> parameterMap = (Map<String, String[]>) m.invoke(httpServletRequest, (Object[]) null); if ((null == parameterMap) || parameterMap.isEmpty()) { return null; } return strConstraint.crop(parameterMap); } catch (Exception e) { LOG.error("Invocation on given object failed.", e); return null; } } HttpInformationExtractor(StringConstraint strConstraint); String getRequestUri(Class<?> httpServletRequestClass, Object httpServletRequest); String getRequestMethod(Class<?> httpServletRequestClass, Object httpServletRequest); Map<String, String[]> getParameterMap(Class<?> httpServletRequestClass, Object httpServletRequest); Map<String, String> getAttributes(Class<?> httpServletRequestClass, Object httpServletRequest); Map<String, String> getHeaders(Class<?> httpServletRequestClass, Object httpServletRequest); Map<String, String> getSessionAttributes(Class<?> httpServletRequestClass, Object httpServletRequest); int getResponseStatus(Class<?> httpServletResponseClass, Object httpServletResponse); String getScheme(Class<?> httpServletRequestClass, Object httpServletRequest); String getServerName(Class<?> httpServletRequestClass, Object httpServletRequest); int getServerPort(Class<?> httpServletRequestClass, Object httpServletRequest); String getQueryString(Class<?> httpServletRequestClass, Object httpServletRequest); }
HttpInformationExtractor { public Map<String, String[]> getParameterMap(Class<?> httpServletRequestClass, Object httpServletRequest) { Method m = retrieveMethod(HttpMethods.SERVLET_GET_PARAMETER_MAP, httpServletRequestClass); if (null == m) { return null; } try { @SuppressWarnings("unchecked") Map<String, String[]> parameterMap = (Map<String, String[]>) m.invoke(httpServletRequest, (Object[]) null); if ((null == parameterMap) || parameterMap.isEmpty()) { return null; } return strConstraint.crop(parameterMap); } catch (Exception e) { LOG.error("Invocation on given object failed.", e); return null; } } HttpInformationExtractor(StringConstraint strConstraint); String getRequestUri(Class<?> httpServletRequestClass, Object httpServletRequest); String getRequestMethod(Class<?> httpServletRequestClass, Object httpServletRequest); Map<String, String[]> getParameterMap(Class<?> httpServletRequestClass, Object httpServletRequest); Map<String, String> getAttributes(Class<?> httpServletRequestClass, Object httpServletRequest); Map<String, String> getHeaders(Class<?> httpServletRequestClass, Object httpServletRequest); Map<String, String> getSessionAttributes(Class<?> httpServletRequestClass, Object httpServletRequest); int getResponseStatus(Class<?> httpServletResponseClass, Object httpServletResponse); String getScheme(Class<?> httpServletRequestClass, Object httpServletRequest); String getServerName(Class<?> httpServletRequestClass, Object httpServletRequest); int getServerPort(Class<?> httpServletRequestClass, Object httpServletRequest); String getQueryString(Class<?> httpServletRequestClass, Object httpServletRequest);  }