diff --git a/testsuite/model/src/test/java/org/keycloak/testsuite/model/events/AdminEventQueryTest.java b/testsuite/model/src/test/java/org/keycloak/testsuite/model/events/AdminEventQueryTest.java index b0958552d2..e9bc56ec16 100644 --- a/testsuite/model/src/test/java/org/keycloak/testsuite/model/events/AdminEventQueryTest.java +++ b/testsuite/model/src/test/java/org/keycloak/testsuite/model/events/AdminEventQueryTest.java @@ -41,7 +41,6 @@ import org.keycloak.testsuite.model.KeycloakModelTest; import org.keycloak.testsuite.model.RequireProvider; import java.util.List; -import java.util.Map; import java.util.stream.Collectors; @RequireProvider(EventStoreProvider.class) @@ -70,10 +69,10 @@ public class AdminEventQueryTest extends KeycloakModelTest { public void testQuery() { withRealm(realmId, (session, realm) -> { EventStoreProvider eventStore = session.getProvider(EventStoreProvider.class); - eventStore.onEvent(createClientEvent(realm, OperationType.CREATE), false); - eventStore.onEvent(createClientEvent(realm, OperationType.UPDATE), false); - eventStore.onEvent(createClientEvent(realm, OperationType.DELETE), false); - eventStore.onEvent(createClientEvent(realm, OperationType.CREATE), false); + eventStore.onEvent(createClientEvent(realm, session, OperationType.CREATE), false); + eventStore.onEvent(createClientEvent(realm, session, OperationType.UPDATE), false); + eventStore.onEvent(createClientEvent(realm, session, OperationType.DELETE), false); + eventStore.onEvent(createClientEvent(realm, session, OperationType.CREATE), false); return null; }); @@ -93,9 +92,9 @@ public class AdminEventQueryTest extends KeycloakModelTest { public void testQueryOrder() { withRealm(realmId, (session, realm) -> { EventStoreProvider eventStore = session.getProvider(EventStoreProvider.class); - AdminEvent firstEvent = createClientEvent(realm, OperationType.CREATE); + AdminEvent firstEvent = createClientEvent(realm, session, OperationType.CREATE); firstEvent.setTime(1L); - AdminEvent secondEvent = createClientEvent(realm, OperationType.DELETE); + AdminEvent secondEvent = createClientEvent(realm, session, OperationType.DELETE); secondEvent.setTime(2L); eventStore.onEvent(firstEvent, false); eventStore.onEvent(secondEvent, false); @@ -126,7 +125,7 @@ public class AdminEventQueryTest extends KeycloakModelTest { withRealm(realmId, (session, realm) -> { - AdminEvent event = createClientEvent(realm, OperationType.CREATE); + AdminEvent event = createClientEvent(realm, session, OperationType.CREATE); event.setRepresentation(longValue); session.getProvider(EventStoreProvider.class).onEvent(event, true); @@ -144,8 +143,8 @@ public class AdminEventQueryTest extends KeycloakModelTest { }); } - private AdminEvent createClientEvent(RealmModel realm, OperationType operation) { - return new AdminEventBuilder(realm, new DummyAuth(realm), null, DummyClientConnection.DUMMY_CONNECTION) + private AdminEvent createClientEvent(RealmModel realm, KeycloakSession session, OperationType operation) { + return new AdminEventBuilder(realm, new DummyAuth(realm), session, DummyClientConnection.DUMMY_CONNECTION) .resource(ResourceType.CLIENT).operation(operation).getEvent(); }