@Test public void shouldReturnNullValueIfNoRequestParameterWithSpecifiedNameWasFound() { String expectedParameterName = "foo"; when(mockHttpRequest.getParameterNames()).thenReturn( makeParameterNamesEnumeration(expectedParameterName)); when(mockHttpRequest.getParameterValues(anyString())).thenReturn(null); PippoWebContext context = makePippoWebContext(); assertThat(context.getRequestParameter(expectedParameterName), is(nullValue())); verify(mockHttpRequest, times(1)).getParameterNames(); verify(mockHttpRequest, times(1)).getParameterValues(expectedParameterName); }
@Override public String getRequestParameter(String name) { ParameterValue parameter = getRequest().getParameter(name); return parameter.isNull() ? null : parameter.toString(); }
PippoWebContext implements WebContext { @Override public String getRequestParameter(String name) { ParameterValue parameter = getRequest().getParameter(name); return parameter.isNull() ? null : parameter.toString(); } }
PippoWebContext implements WebContext { @Override public String getRequestParameter(String name) { ParameterValue parameter = getRequest().getParameter(name); return parameter.isNull() ? null : parameter.toString(); } PippoWebContext(RouteContext routeContext);  PippoWebContext(RouteContext routeContext, SessionStore<PippoWebContext> sessionStore); }
PippoWebContext implements WebContext { @Override public String getRequestParameter(String name) { ParameterValue parameter = getRequest().getParameter(name); return parameter.isNull() ? null : parameter.toString(); } PippoWebContext(RouteContext routeContext);  PippoWebContext(RouteContext routeContext, SessionStore<PippoWebContext> sessionStore); @Override SessionStore<PippoWebContext> getSessionStore(); @Override void setSessionStore(SessionStore sessionStore); @Override String getRequestParameter(String name); @Override Map<String, String[]> getRequestParameters(); @Override Object getRequestAttribute(String name); @Override void setRequestAttribute(String name, Object value); @Override String getRequestHeader(String name); @Override String getRequestMethod(); @Override String getRemoteAddr(); @Override void writeResponseContent(String contentToWrite); @Override void setResponseStatus(int statusCode); @Override void setResponseHeader(String name, String value); @Override void setResponseContentType(String contentType); @Override String getServerName(); @Override int getServerPort(); @Override String getScheme(); @Override boolean isSecure(); @Override String getFullRequestURL(); @Override Collection<Cookie> getRequestCookies(); @Override void addResponseCookie(Cookie cookie); @Override String getPath(); RouteContext getRouteContext(); Request getRequest(); Response getResponse(); }
PippoWebContext implements WebContext { @Override public String getRequestParameter(String name) { ParameterValue parameter = getRequest().getParameter(name); return parameter.isNull() ? null : parameter.toString(); } PippoWebContext(RouteContext routeContext);  PippoWebContext(RouteContext routeContext, SessionStore<PippoWebContext> sessionStore); @Override SessionStore<PippoWebContext> getSessionStore(); @Override void setSessionStore(SessionStore sessionStore); @Override String getRequestParameter(String name); @Override Map<String, String[]> getRequestParameters(); @Override Object getRequestAttribute(String name); @Override void setRequestAttribute(String name, Object value); @Override String getRequestHeader(String name); @Override String getRequestMethod(); @Override String getRemoteAddr(); @Override void writeResponseContent(String contentToWrite); @Override void setResponseStatus(int statusCode); @Override void setResponseHeader(String name, String value); @Override void setResponseContentType(String contentType); @Override String getServerName(); @Override int getServerPort(); @Override String getScheme(); @Override boolean isSecure(); @Override String getFullRequestURL(); @Override Collection<Cookie> getRequestCookies(); @Override void addResponseCookie(Cookie cookie); @Override String getPath(); RouteContext getRouteContext(); Request getRequest(); Response getResponse();  }