UaaAuthenticationDetails implements Serializable { public Map<String, String[]> getParameterMap() { return new HashMap<>(parameterMap); } private  UaaAuthenticationDetails();  UaaAuthenticationDetails(HttpServletRequest request);  UaaAuthenticationDetails(HttpServletRequest request, String clientId);  UaaAuthenticationDetails(@JsonProperty("addNew") boolean addNew,
                                    @JsonProperty("clientId") String clientId,
                                    @JsonProperty("origin") String origin,
                                    @JsonProperty("sessionId") String sessionId); String getOrigin(); String getSessionId(); String getClientId(); boolean isAddNew(); void setAddNew(boolean addNew); UaaLoginHint getLoginHint(); void setLoginHint(UaaLoginHint loginHint); Map<String, String[]> getParameterMap(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); static final String ADD_NEW; static final UaaAuthenticationDetails UNKNOWN; }
@Test void testSavesRequestParameters() { MockHttpServletRequest request = new MockHttpServletRequest(); request.addParameter("key", "value"); UaaAuthenticationDetails details = new UaaAuthenticationDetails(request, null); assertEquals("value", details.getParameterMap().get("key")[0]); }
@Test void testDoesNotSaveUsernamePasswordRequestParameters() { MockHttpServletRequest request = new MockHttpServletRequest(); String[] filteredKeys = {"Username", "username", "Password", "password", "Passcode", "passcode"}; for(String key : filteredKeys) { request.addParameter(key, "value"); } UaaAuthenticationDetails details = new UaaAuthenticationDetails(request, null); for(String key : filteredKeys) { assertNull(details.getParameterMap().get(key)); } }