@Test public void testGetLoginChallengeData() throws Exception { Object[] data = loginResult.getLoginChallengeData(); Assert.assertTrue(String.format("Expected null login challenge data, got %s", data), data == null); loginResult.challenge(); assertLoginResultChallenge(); data = loginResult.getLoginChallengeData(); Assert.assertTrue(String.format("Expected null login challenge data, got %s", data), data == null); loginResult.challenge(); assertLoginResultChallenge(); data = loginResult.getLoginChallengeData(); Assert.assertTrue(String.format("Expected null login challenge data, got %s", data), data == null); String param1 = "foo=\"bar\""; loginResult.challenge(param1); assertLoginResultChallenge(); data = loginResult.getLoginChallengeData(); Assert.assertTrue("Expected login challenge data, got null", data != null); Assert.assertTrue(String.format("Expected 1 login challenge datum, got %d", data.length), data.length == 1); String param2 = "baz=\"quxx\""; String param3 = "quzz=\"alef\""; loginResult.challenge(param2, param3); assertLoginResultChallenge(); data = loginResult.getLoginChallengeData(); Assert.assertTrue("Expected login challenge data, got null", data != null); Assert.assertTrue(String.format("Expected 3 login challenge data, got %d", data.length), data.length == 3); int expectedDataCount = 0; for (Object datum : data) { if (param1.equals(datum)) { expectedDataCount++; continue; } if (param2.equals(datum)) { expectedDataCount++; continue; } if (param3.equals(datum)) { expectedDataCount++; continue; } } Assert.assertTrue("Found all expected challenge data", expectedDataCount == 3); }
public Object[] getLoginChallengeData() { if (loginChallengeData.isEmpty()) { return null; } return loginChallengeData.toArray(); }
DefaultLoginResult extends LoginResult { public Object[] getLoginChallengeData() { if (loginChallengeData.isEmpty()) { return null; } return loginChallengeData.toArray(); } }
DefaultLoginResult extends LoginResult { public Object[] getLoginChallengeData() { if (loginChallengeData.isEmpty()) { return null; } return loginChallengeData.toArray(); } DefaultLoginResult(); }
DefaultLoginResult extends LoginResult { public Object[] getLoginChallengeData() { if (loginChallengeData.isEmpty()) { return null; } return loginChallengeData.toArray(); } DefaultLoginResult(); @Override Type getType(); @Override void challenge(Object... challengeData); void setAuthorizationAttachment(Object authorizationAttachment); @Override void failure(LoginException e); @Override void success(); void clearTimeouts(); @Override void setSessionTimeout(long deltaSeconds); Long getSessionTimeout(); LoginException getLoginException(); Object[] getLoginChallengeData(); boolean hasLoginAuthorizationAttachment(); Object getLoginAuthorizationAttachment(); }
DefaultLoginResult extends LoginResult { public Object[] getLoginChallengeData() { if (loginChallengeData.isEmpty()) { return null; } return loginChallengeData.toArray(); } DefaultLoginResult(); @Override Type getType(); @Override void challenge(Object... challengeData); void setAuthorizationAttachment(Object authorizationAttachment); @Override void failure(LoginException e); @Override void success(); void clearTimeouts(); @Override void setSessionTimeout(long deltaSeconds); Long getSessionTimeout(); LoginException getLoginException(); Object[] getLoginChallengeData(); boolean hasLoginAuthorizationAttachment(); Object getLoginAuthorizationAttachment();  }