Fix UserSessionProviderTest.testGetByClientPaginated

This commit is contained in:
Stian Thorgersen 2014-09-30 10:59:37 +02:00
parent 3ded1943e2
commit 209fdc1255

View file

@ -285,14 +285,14 @@ public class UserSessionProviderTest {
public void testGetByClientPaginated() { public void testGetByClientPaginated() {
try { try {
for (int i = 0; i < 25; i++) { for (int i = 0; i < 25; i++) {
UserSessionModel userSession = session.sessions().createUserSession(realm, session.users().getUserByUsername("user1", realm), "user1", "127.0.0." + i, "form", false);
Time.setOffset(i); Time.setOffset(i);
UserSessionModel userSession = session.sessions().createUserSession(realm, session.users().getUserByUsername("user1", realm), "user1", "127.0.0." + i, "form", false);
ClientSessionModel clientSession = session.sessions().createClientSession(realm, realm.findClient("test-app")); ClientSessionModel clientSession = session.sessions().createClientSession(realm, realm.findClient("test-app"));
clientSession.setUserSession(userSession); clientSession.setUserSession(userSession);
clientSession.setRedirectUri("http://redirect"); clientSession.setRedirectUri("http://redirect");
clientSession.setRoles(new HashSet<String>()); clientSession.setRoles(new HashSet<String>());
clientSession.setNote(OpenIDConnect.STATE_PARAM, "state"); clientSession.setNote(OpenIDConnect.STATE_PARAM, "state");
clientSession.setTimestamp(Time.currentTime() + i); clientSession.setTimestamp(userSession.getStarted());
} }
} finally { } finally {
Time.setOffset(0); Time.setOffset(0);