Make DeviceRepresentationProvider available for all model test profiles

Closes #17329
This commit is contained in:
Michal Hajas 2023-02-28 11:17:27 +01:00 committed by Hynek Mlnařík
parent 9144207755
commit 7899c6c80a
9 changed files with 4 additions and 16 deletions

View file

@ -30,6 +30,8 @@ import org.keycloak.common.profile.PropertiesProfileConfigResolver;
import org.keycloak.common.util.Time; import org.keycloak.common.util.Time;
import org.keycloak.component.ComponentFactoryProviderFactory; import org.keycloak.component.ComponentFactoryProviderFactory;
import org.keycloak.component.ComponentFactorySpi; import org.keycloak.component.ComponentFactorySpi;
import org.keycloak.device.DeviceRepresentationProviderFactoryImpl;
import org.keycloak.device.DeviceRepresentationSpi;
import org.keycloak.events.EventStoreSpi; import org.keycloak.events.EventStoreSpi;
import org.keycloak.executors.DefaultExecutorsProviderFactory; import org.keycloak.executors.DefaultExecutorsProviderFactory;
import org.keycloak.executors.ExecutorsSpi; import org.keycloak.executors.ExecutorsSpi;
@ -252,6 +254,7 @@ public abstract class KeycloakModelTest {
.add(UserSessionSpi.class) .add(UserSessionSpi.class)
.add(UserSpi.class) .add(UserSpi.class)
.add(DatastoreSpi.class) .add(DatastoreSpi.class)
.add(DeviceRepresentationSpi.class)
.build(); .build();
private static final Set<Class<? extends ProviderFactory>> ALLOWED_FACTORIES = ImmutableSet.<Class<? extends ProviderFactory>>builder() private static final Set<Class<? extends ProviderFactory>> ALLOWED_FACTORIES = ImmutableSet.<Class<? extends ProviderFactory>>builder()
@ -261,6 +264,7 @@ public abstract class KeycloakModelTest {
.add(DefaultExecutorsProviderFactory.class) .add(DefaultExecutorsProviderFactory.class)
.add(DeploymentStateProviderFactory.class) .add(DeploymentStateProviderFactory.class)
.add(DatastoreProviderFactory.class) .add(DatastoreProviderFactory.class)
.add(DeviceRepresentationProviderFactoryImpl.class)
.build(); .build();
protected static final List<KeycloakModelParameters> MODEL_PARAMETERS; protected static final List<KeycloakModelParameters> MODEL_PARAMETERS;

View file

@ -19,7 +19,6 @@ package org.keycloak.testsuite.model.session;
import org.infinispan.client.hotrod.RemoteCache; import org.infinispan.client.hotrod.RemoteCache;
import org.junit.Test; import org.junit.Test;
import org.keycloak.device.DeviceRepresentationProvider;
import org.keycloak.models.AuthenticatedClientSessionModel; import org.keycloak.models.AuthenticatedClientSessionModel;
import org.keycloak.models.ClientModel; import org.keycloak.models.ClientModel;
import org.keycloak.models.Constants; import org.keycloak.models.Constants;
@ -44,7 +43,6 @@ import static org.hamcrest.Matchers.containsInAnyOrder;
@RequireProvider(UserSessionProvider.class) @RequireProvider(UserSessionProvider.class)
@RequireProvider(value = HotRodConnectionProvider.class, only = DefaultHotRodConnectionProviderFactory.PROVIDER_ID) @RequireProvider(value = HotRodConnectionProvider.class, only = DefaultHotRodConnectionProviderFactory.PROVIDER_ID)
@RequireProvider(DeviceRepresentationProvider.class)
public class HotRodUserSessionClientSessionRelationshipTest extends KeycloakModelTest { public class HotRodUserSessionClientSessionRelationshipTest extends KeycloakModelTest {
private String realmId; private String realmId;

View file

@ -18,7 +18,6 @@ package org.keycloak.testsuite.model.session;
import org.infinispan.client.hotrod.RemoteCache; import org.infinispan.client.hotrod.RemoteCache;
import org.infinispan.commons.CacheException; import org.infinispan.commons.CacheException;
import org.keycloak.device.DeviceRepresentationProvider;
import org.keycloak.models.AuthenticatedClientSessionModel; import org.keycloak.models.AuthenticatedClientSessionModel;
import org.keycloak.models.ClientModel; import org.keycloak.models.ClientModel;
import org.keycloak.models.Constants; import org.keycloak.models.Constants;
@ -66,7 +65,6 @@ import static org.hamcrest.Matchers.containsInAnyOrder;
@RequireProvider(UserProvider.class) @RequireProvider(UserProvider.class)
@RequireProvider(RealmProvider.class) @RequireProvider(RealmProvider.class)
@RequireProvider(UserSessionProvider.class) @RequireProvider(UserSessionProvider.class)
@RequireProvider(DeviceRepresentationProvider.class)
public class OfflineSessionPersistenceTest extends KeycloakModelTest { public class OfflineSessionPersistenceTest extends KeycloakModelTest {
private static final int USER_COUNT = 50; private static final int USER_COUNT = 50;

View file

@ -18,7 +18,6 @@
package org.keycloak.testsuite.model.session; package org.keycloak.testsuite.model.session;
import org.junit.Test; import org.junit.Test;
import org.keycloak.device.DeviceRepresentationProvider;
import org.keycloak.models.AuthenticatedClientSessionModel; import org.keycloak.models.AuthenticatedClientSessionModel;
import org.keycloak.models.ClientModel; import org.keycloak.models.ClientModel;
import org.keycloak.models.Constants; import org.keycloak.models.Constants;
@ -54,7 +53,6 @@ import static org.keycloak.utils.LockObjectsForModification.lockUserSessionsForM
@RequireProvider(UserSessionProvider.class) @RequireProvider(UserSessionProvider.class)
@RequireProvider(DeviceRepresentationProvider.class)
public class UserSessionConcurrencyTest extends KeycloakModelTest { public class UserSessionConcurrencyTest extends KeycloakModelTest {
private String realmId; private String realmId;

View file

@ -18,7 +18,6 @@
package org.keycloak.testsuite.model.session; package org.keycloak.testsuite.model.session;
import org.junit.Test; import org.junit.Test;
import org.keycloak.device.DeviceRepresentationProvider;
import org.keycloak.models.Constants; import org.keycloak.models.Constants;
import org.keycloak.models.KeycloakSession; import org.keycloak.models.KeycloakSession;
import org.keycloak.models.RealmModel; import org.keycloak.models.RealmModel;
@ -34,7 +33,6 @@ import static org.hamcrest.MatcherAssert.assertThat;
@RequireProvider(value = UserSessionProvider.class, only = MapUserSessionProviderFactory.PROVIDER_ID) @RequireProvider(value = UserSessionProvider.class, only = MapUserSessionProviderFactory.PROVIDER_ID)
@RequireProvider(RealmProvider.class) @RequireProvider(RealmProvider.class)
@RequireProvider(DeviceRepresentationProvider.class)
public class UserSessionExpirationTest extends KeycloakModelTest { public class UserSessionExpirationTest extends KeycloakModelTest {
private String realmId; private String realmId;

View file

@ -22,7 +22,6 @@ import org.infinispan.client.hotrod.RemoteCache;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
import org.keycloak.connections.infinispan.InfinispanConnectionProvider; import org.keycloak.connections.infinispan.InfinispanConnectionProvider;
import org.keycloak.device.DeviceRepresentationProvider;
import org.keycloak.models.ClientModel; import org.keycloak.models.ClientModel;
import org.keycloak.models.Constants; import org.keycloak.models.Constants;
import org.keycloak.models.KeycloakSession; import org.keycloak.models.KeycloakSession;
@ -62,7 +61,6 @@ import static org.keycloak.connections.infinispan.InfinispanConnectionProvider.U
@RequireProvider(UserSessionProvider.class) @RequireProvider(UserSessionProvider.class)
@RequireProvider(UserProvider.class) @RequireProvider(UserProvider.class)
@RequireProvider(RealmProvider.class) @RequireProvider(RealmProvider.class)
@RequireProvider(DeviceRepresentationProvider.class)
public class UserSessionInitializerTest extends KeycloakModelTest { public class UserSessionInitializerTest extends KeycloakModelTest {
private String realmId; private String realmId;

View file

@ -21,7 +21,6 @@ import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
import org.keycloak.OAuth2Constants; import org.keycloak.OAuth2Constants;
import org.keycloak.common.util.Time; import org.keycloak.common.util.Time;
import org.keycloak.device.DeviceRepresentationProvider;
import org.keycloak.models.AuthenticatedClientSessionModel; import org.keycloak.models.AuthenticatedClientSessionModel;
import org.keycloak.models.ClientModel; import org.keycloak.models.ClientModel;
import org.keycloak.models.KeycloakSession; import org.keycloak.models.KeycloakSession;
@ -71,7 +70,6 @@ import java.util.LinkedList;
@RequireProvider(value = UserSessionProvider.class, only = InfinispanUserSessionProviderFactory.PROVIDER_ID) @RequireProvider(value = UserSessionProvider.class, only = InfinispanUserSessionProviderFactory.PROVIDER_ID)
@RequireProvider(UserProvider.class) @RequireProvider(UserProvider.class)
@RequireProvider(RealmProvider.class) @RequireProvider(RealmProvider.class)
@RequireProvider(DeviceRepresentationProvider.class)
public class UserSessionPersisterProviderTest extends KeycloakModelTest { public class UserSessionPersisterProviderTest extends KeycloakModelTest {
private static final int USER_SESSION_COUNT = 2000; private static final int USER_SESSION_COUNT = 2000;

View file

@ -20,7 +20,6 @@ import org.hamcrest.Matchers;
import org.infinispan.client.hotrod.RemoteCache; import org.infinispan.client.hotrod.RemoteCache;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
import org.keycloak.device.DeviceRepresentationProvider;
import org.keycloak.models.AuthenticatedClientSessionModel; import org.keycloak.models.AuthenticatedClientSessionModel;
import org.keycloak.models.ClientModel; import org.keycloak.models.ClientModel;
import org.keycloak.models.Constants; import org.keycloak.models.Constants;
@ -70,7 +69,6 @@ import static org.keycloak.testsuite.model.session.UserSessionPersisterProviderT
@RequireProvider(UserSessionProvider.class) @RequireProvider(UserSessionProvider.class)
@RequireProvider(UserProvider.class) @RequireProvider(UserProvider.class)
@RequireProvider(RealmProvider.class) @RequireProvider(RealmProvider.class)
@RequireProvider(DeviceRepresentationProvider.class)
public class UserSessionProviderModelTest extends KeycloakModelTest { public class UserSessionProviderModelTest extends KeycloakModelTest {
private String realmId; private String realmId;

View file

@ -23,7 +23,6 @@ import org.junit.Assume;
import org.junit.Test; import org.junit.Test;
import org.keycloak.common.util.Time; import org.keycloak.common.util.Time;
import org.keycloak.connections.infinispan.InfinispanConnectionProvider; import org.keycloak.connections.infinispan.InfinispanConnectionProvider;
import org.keycloak.device.DeviceRepresentationProvider;
import org.keycloak.models.AuthenticatedClientSessionModel; import org.keycloak.models.AuthenticatedClientSessionModel;
import org.keycloak.models.ClientModel; import org.keycloak.models.ClientModel;
import org.keycloak.models.Constants; import org.keycloak.models.Constants;
@ -66,7 +65,6 @@ import org.keycloak.testsuite.model.RequireProvider;
@RequireProvider(value=UserSessionProvider.class, only={"infinispan"}) @RequireProvider(value=UserSessionProvider.class, only={"infinispan"})
@RequireProvider(UserProvider.class) @RequireProvider(UserProvider.class)
@RequireProvider(RealmProvider.class) @RequireProvider(RealmProvider.class)
@RequireProvider(DeviceRepresentationProvider.class)
public class UserSessionProviderOfflineModelTest extends KeycloakModelTest { public class UserSessionProviderOfflineModelTest extends KeycloakModelTest {
private String realmId; private String realmId;