HttpSessionChallengeRepository implements ChallengeRepository { @Override public Challenge loadChallenge(HttpServletRequest request) { HttpSession session = request.getSession(false); if (session == null) { return null; } return (Challenge) session.getAttribute(this.sessionAttributeName); }  @Override Challenge generateChallenge(); @Override void saveChallenge(Challenge challenge, HttpServletRequest request); @Override Challenge loadChallenge(HttpServletRequest request); void setSessionAttributeName(String sessionAttributeName);  }
@Test public void loadChallenge_test_without_previous_request() { MockHttpServletRequest request = new MockHttpServletRequest(); Challenge loadedChallenge = target.loadChallenge(request); assertThat(loadedChallenge).isNull(); }