@Test public void readRequestUriNull() { String result = extractor.getRequestUri(httpServletRequest.getClass(), httpServletRequest); assertThat(result, is(HttpInfo.UNDEFINED)); }
public String getRequestUri(Class<?> httpServletRequestClass, Object httpServletRequest) { Method m = retrieveMethod(HttpMethods.SERVLET_REQUEST_URI, httpServletRequestClass); if (null == m) { return HttpInfo.UNDEFINED; } try { String uri = (String) m.invoke(httpServletRequest, (Object[]) null); if (null != uri) { return uri; } else { return HttpInfo.UNDEFINED; } } catch (Exception e) { LOG.error("Invocation on given object failed.", e); return HttpInfo.UNDEFINED; } }
HttpInformationExtractor { public String getRequestUri(Class<?> httpServletRequestClass, Object httpServletRequest) { Method m = retrieveMethod(HttpMethods.SERVLET_REQUEST_URI, httpServletRequestClass); if (null == m) { return HttpInfo.UNDEFINED; } try { String uri = (String) m.invoke(httpServletRequest, (Object[]) null); if (null != uri) { return uri; } else { return HttpInfo.UNDEFINED; } } catch (Exception e) { LOG.error("Invocation on given object failed.", e); return HttpInfo.UNDEFINED; } } }
HttpInformationExtractor { public String getRequestUri(Class<?> httpServletRequestClass, Object httpServletRequest) { Method m = retrieveMethod(HttpMethods.SERVLET_REQUEST_URI, httpServletRequestClass); if (null == m) { return HttpInfo.UNDEFINED; } try { String uri = (String) m.invoke(httpServletRequest, (Object[]) null); if (null != uri) { return uri; } else { return HttpInfo.UNDEFINED; } } catch (Exception e) { LOG.error("Invocation on given object failed.", e); return HttpInfo.UNDEFINED; } } HttpInformationExtractor(StringConstraint strConstraint); }
HttpInformationExtractor { public String getRequestUri(Class<?> httpServletRequestClass, Object httpServletRequest) { Method m = retrieveMethod(HttpMethods.SERVLET_REQUEST_URI, httpServletRequestClass); if (null == m) { return HttpInfo.UNDEFINED; } try { String uri = (String) m.invoke(httpServletRequest, (Object[]) null); if (null != uri) { return uri; } else { return HttpInfo.UNDEFINED; } } catch (Exception e) { LOG.error("Invocation on given object failed.", e); return HttpInfo.UNDEFINED; } } 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 String getRequestUri(Class<?> httpServletRequestClass, Object httpServletRequest) { Method m = retrieveMethod(HttpMethods.SERVLET_REQUEST_URI, httpServletRequestClass); if (null == m) { return HttpInfo.UNDEFINED; } try { String uri = (String) m.invoke(httpServletRequest, (Object[]) null); if (null != uri) { return uri; } else { return HttpInfo.UNDEFINED; } } catch (Exception e) { LOG.error("Invocation on given object failed.", e); return HttpInfo.UNDEFINED; } } 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);  }