@Test
public void usesEnvironmentContextToResolveContextParameters() throws Exception {

    HttpServletRequest servletRequest = mock(HttpServletRequest.class);
    when(environmentContext.get(eq(HttpServletRequest.class))).thenReturn(servletRequest);
    when(parameter.getParameterClass()).thenReturn((Class)HttpServletRequest.class);
    assertSame(servletRequest, contextParameterResolver.resolve(parameter, applicationContext));
    verify(environmentContext, times(1)).get(any(Class.class));
}