final CacheableHttpSession session = createMock(CacheableHttpSession.class);
final String attribute = MappedHttpServletRequest.class.getName()+".WRAPPED_SESSION";
expect(request.getAttribute(attribute)).andReturn(session);
expect(session.isValid()).andReturn(false);
request.removeAttribute(attribute);
replay(request, sessionWrapper, session);
MappedHttpServletRequest wrapper = new MappedHttpServletRequest(servletContext, request, sessionWrapper, null, applicationId);