public void testGetWrappedCacheableSessionInvalid() throws Exception {
final HttpSessionWrapper sessionWrapper = createMock(HttpSessionWrapper.class);
final HttpServletRequest request = createMock(HttpServletRequest.class);
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);