@Test public void storeRequestWithIdFromHttpSession() { testee.saveRequest(mockReq(HTTP_SESSION_ID, null), mockResp()); verify(valueOps, times(1)).set(eq(PREFIX + HTTP_SESSION_ID), any(DefaultSavedRequest.class), anyLong(), eq(TimeUnit.MINUTES)); }
@Override public void saveRequest(HttpServletRequest request, HttpServletResponse response) { if (requestMatcher.matches(request)) { DefaultSavedRequest savedRequest = new DefaultSavedRequest(request, portResolver); String requestedSessionId = getSessionId(request); if (requestedSessionId != null) { valueOps.set(buildKey(requestedSessionId), savedRequest, TIMEOUT, TimeUnit.MINUTES); logger.debug("DefaultSavedRequest added to Redis: " + savedRequest); } } else { logger.debug("Request not saved as configured RequestMatcher did not match"); } }
RedisSavedRequestCache implements RequestCache { @Override public void saveRequest(HttpServletRequest request, HttpServletResponse response) { if (requestMatcher.matches(request)) { DefaultSavedRequest savedRequest = new DefaultSavedRequest(request, portResolver); String requestedSessionId = getSessionId(request); if (requestedSessionId != null) { valueOps.set(buildKey(requestedSessionId), savedRequest, TIMEOUT, TimeUnit.MINUTES); logger.debug("DefaultSavedRequest added to Redis: " + savedRequest); } } else { logger.debug("Request not saved as configured RequestMatcher did not match"); } } }
RedisSavedRequestCache implements RequestCache { @Override public void saveRequest(HttpServletRequest request, HttpServletResponse response) { if (requestMatcher.matches(request)) { DefaultSavedRequest savedRequest = new DefaultSavedRequest(request, portResolver); String requestedSessionId = getSessionId(request); if (requestedSessionId != null) { valueOps.set(buildKey(requestedSessionId), savedRequest, TIMEOUT, TimeUnit.MINUTES); logger.debug("DefaultSavedRequest added to Redis: " + savedRequest); } } else { logger.debug("Request not saved as configured RequestMatcher did not match"); } }  }
RedisSavedRequestCache implements RequestCache { @Override public void saveRequest(HttpServletRequest request, HttpServletResponse response) { if (requestMatcher.matches(request)) { DefaultSavedRequest savedRequest = new DefaultSavedRequest(request, portResolver); String requestedSessionId = getSessionId(request); if (requestedSessionId != null) { valueOps.set(buildKey(requestedSessionId), savedRequest, TIMEOUT, TimeUnit.MINUTES); logger.debug("DefaultSavedRequest added to Redis: " + savedRequest); } } else { logger.debug("Request not saved as configured RequestMatcher did not match"); } }  @Override void saveRequest(HttpServletRequest request, HttpServletResponse response); @Override SavedRequest getRequest(HttpServletRequest currentRequest,
        HttpServletResponse response); @Override void removeRequest(HttpServletRequest currentRequest,
        HttpServletResponse response); @Override HttpServletRequest getMatchingRequest(HttpServletRequest request,
        HttpServletResponse response); void setRequestMatcher(RequestMatcher requestMatcher); }
RedisSavedRequestCache implements RequestCache { @Override public void saveRequest(HttpServletRequest request, HttpServletResponse response) { if (requestMatcher.matches(request)) { DefaultSavedRequest savedRequest = new DefaultSavedRequest(request, portResolver); String requestedSessionId = getSessionId(request); if (requestedSessionId != null) { valueOps.set(buildKey(requestedSessionId), savedRequest, TIMEOUT, TimeUnit.MINUTES); logger.debug("DefaultSavedRequest added to Redis: " + savedRequest); } } else { logger.debug("Request not saved as configured RequestMatcher did not match"); } }  @Override void saveRequest(HttpServletRequest request, HttpServletResponse response); @Override SavedRequest getRequest(HttpServletRequest currentRequest,
        HttpServletResponse response); @Override void removeRequest(HttpServletRequest currentRequest,
        HttpServletResponse response); @Override HttpServletRequest getMatchingRequest(HttpServletRequest request,
        HttpServletResponse response); void setRequestMatcher(RequestMatcher requestMatcher);  }