@Test public void getRequestReturnsNullWhenNoRequestSaved() { DefaultSavedRequest mockedSavedRequest = mock(DefaultSavedRequest.class); when(valueOps.get(PREFIX + HTTP_SESSION_ID)).thenReturn(null); SavedRequest request = testee.getRequest(mockReq(HTTP_SESSION_ID, COOKIE_SESSION_ID), mockResp()); assertNull(request); }
@Override public SavedRequest getRequest(HttpServletRequest currentRequest, HttpServletResponse response) { String requestedSessionId = getSessionId(currentRequest); if (requestedSessionId != null) { return valueOps.get(buildKey(requestedSessionId)); } return null; }
RedisSavedRequestCache implements RequestCache { @Override public SavedRequest getRequest(HttpServletRequest currentRequest, HttpServletResponse response) { String requestedSessionId = getSessionId(currentRequest); if (requestedSessionId != null) { return valueOps.get(buildKey(requestedSessionId)); } return null; } }
RedisSavedRequestCache implements RequestCache { @Override public SavedRequest getRequest(HttpServletRequest currentRequest, HttpServletResponse response) { String requestedSessionId = getSessionId(currentRequest); if (requestedSessionId != null) { return valueOps.get(buildKey(requestedSessionId)); } return null; }  }
RedisSavedRequestCache implements RequestCache { @Override public SavedRequest getRequest(HttpServletRequest currentRequest, HttpServletResponse response) { String requestedSessionId = getSessionId(currentRequest); if (requestedSessionId != null) { return valueOps.get(buildKey(requestedSessionId)); } return null; }  @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 SavedRequest getRequest(HttpServletRequest currentRequest, HttpServletResponse response) { String requestedSessionId = getSessionId(currentRequest); if (requestedSessionId != null) { return valueOps.get(buildKey(requestedSessionId)); } return null; }  @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);  }