@Test
public void retrieveUserFromWSSessionWithNonDefaultUserKey() {

    TestSession session = new TestSession();
    TestHttpSession httpSession = new TestHttpSession();
    TestSUser user1 = new TestSUser();
    TestSUser user2 = new TestSUser();
    session.getUserProperties().put(HttpSession.class.getName(), httpSession);
    httpSession.setAttribute(WebUtils.DEFAULT_USER_KEY, user1);
    httpSession.setAttribute("nonDefaultUserKey", user2);
    session.addRequestParameter(WebUtils.USER_KEY_PARAM, "nonDefaultUserKey");
    assertThat(WebUtils.retrieveUserFromWSSession(session).get()).isSameAs(user2);
}