diff --git a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/AdapterDeploymentContext.java b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/AdapterDeploymentContext.java index 925a0dba15..63ea79e65b 100755 --- a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/AdapterDeploymentContext.java +++ b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/AdapterDeploymentContext.java @@ -26,9 +26,9 @@ import org.keycloak.adapters.rotation.PublicKeyLocator; import org.keycloak.adapters.spi.HttpFacade; import org.keycloak.common.enums.RelativeUrlsUsed; import org.keycloak.common.enums.SslRequired; +import org.keycloak.common.util.KeycloakUriBuilder; import org.keycloak.enums.TokenStore; import org.keycloak.representations.adapters.config.AdapterConfig; -import org.keycloak.common.util.KeycloakUriBuilder; import java.io.IOException; import java.net.URI; diff --git a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/AdapterUtils.java b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/AdapterUtils.java index 935a9fcc99..a6dfa0637e 100755 --- a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/AdapterUtils.java +++ b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/AdapterUtils.java @@ -19,9 +19,7 @@ package org.keycloak.adapters; import org.jboss.logging.Logger; import org.keycloak.KeycloakPrincipal; -import org.keycloak.KeycloakSecurityContext; import org.keycloak.representations.AccessToken; -import org.keycloak.common.util.UriUtils; import java.util.Collections; import java.util.Set; diff --git a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/BasicAuthRequestAuthenticator.java b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/BasicAuthRequestAuthenticator.java index 6560796ca2..176b1d2a92 100755 --- a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/BasicAuthRequestAuthenticator.java +++ b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/BasicAuthRequestAuthenticator.java @@ -31,10 +31,10 @@ import org.keycloak.adapters.authentication.ClientCredentialsProviderUtils; import org.keycloak.adapters.spi.AuthOutcome; import org.keycloak.adapters.spi.HttpFacade; import org.keycloak.common.util.Base64; +import org.keycloak.common.util.KeycloakUriBuilder; import org.keycloak.constants.ServiceUrlConstants; import org.keycloak.representations.AccessTokenResponse; import org.keycloak.util.JsonSerialization; -import org.keycloak.common.util.KeycloakUriBuilder; import java.util.List; diff --git a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/BearerTokenRequestAuthenticator.java b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/BearerTokenRequestAuthenticator.java index 70b90b1044..5eed432920 100755 --- a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/BearerTokenRequestAuthenticator.java +++ b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/BearerTokenRequestAuthenticator.java @@ -18,7 +18,6 @@ package org.keycloak.adapters; import org.jboss.logging.Logger; -import org.keycloak.RSATokenVerifier; import org.keycloak.adapters.rotation.AdapterRSATokenVerifier; import org.keycloak.adapters.spi.AuthChallenge; import org.keycloak.adapters.spi.AuthOutcome; diff --git a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/CookieTokenStore.java b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/CookieTokenStore.java index 2093645533..7d67dd6cd3 100755 --- a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/CookieTokenStore.java +++ b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/CookieTokenStore.java @@ -17,20 +17,17 @@ package org.keycloak.adapters; -import java.io.IOException; - import org.jboss.logging.Logger; import org.keycloak.KeycloakPrincipal; -import org.keycloak.RSATokenVerifier; import org.keycloak.adapters.rotation.AdapterRSATokenVerifier; import org.keycloak.adapters.spi.HttpFacade; import org.keycloak.common.VerificationException; +import org.keycloak.common.util.KeycloakUriBuilder; import org.keycloak.constants.AdapterConstants; import org.keycloak.jose.jws.JWSInput; import org.keycloak.jose.jws.JWSInputException; import org.keycloak.representations.AccessToken; import org.keycloak.representations.IDToken; -import org.keycloak.common.util.KeycloakUriBuilder; /** * @author Marek Posolda diff --git a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/HttpAdapterUtils.java b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/HttpAdapterUtils.java index e01f7dc32e..3e0f36dee7 100644 --- a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/HttpAdapterUtils.java +++ b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/HttpAdapterUtils.java @@ -17,15 +17,15 @@ package org.keycloak.adapters; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; - import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.client.methods.HttpRequestBase; import org.keycloak.util.JsonSerialization; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; + /** * @author Marek Posolda */ diff --git a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/KeycloakDeployment.java b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/KeycloakDeployment.java index 30c40c37ca..1071b710fc 100755 --- a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/KeycloakDeployment.java +++ b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/KeycloakDeployment.java @@ -22,12 +22,12 @@ import org.jboss.logging.Logger; import org.keycloak.adapters.authentication.ClientCredentialsProvider; import org.keycloak.adapters.authorization.PolicyEnforcer; import org.keycloak.adapters.rotation.PublicKeyLocator; -import org.keycloak.constants.ServiceUrlConstants; import org.keycloak.common.enums.RelativeUrlsUsed; import org.keycloak.common.enums.SslRequired; +import org.keycloak.common.util.KeycloakUriBuilder; +import org.keycloak.constants.ServiceUrlConstants; import org.keycloak.enums.TokenStore; import org.keycloak.representations.adapters.config.AdapterConfig; -import org.keycloak.common.util.KeycloakUriBuilder; import java.net.URI; import java.util.HashMap; diff --git a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/NodesRegistrationManagement.java b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/NodesRegistrationManagement.java index 1002d391fe..673901c3d6 100755 --- a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/NodesRegistrationManagement.java +++ b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/NodesRegistrationManagement.java @@ -17,6 +17,10 @@ package org.keycloak.adapters; +import org.jboss.logging.Logger; +import org.keycloak.common.util.HostUtils; +import org.keycloak.common.util.Time; + import java.io.IOException; import java.util.Collection; import java.util.Map; @@ -24,10 +28,6 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.Executor; import java.util.concurrent.Executors; -import org.jboss.logging.Logger; -import org.keycloak.common.util.HostUtils; -import org.keycloak.common.util.Time; - /** * @author Marek Posolda */ diff --git a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/OAuthRequestAuthenticator.java b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/OAuthRequestAuthenticator.java index 02637c0810..109361f1df 100755 --- a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/OAuthRequestAuthenticator.java +++ b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/OAuthRequestAuthenticator.java @@ -19,13 +19,14 @@ package org.keycloak.adapters; import org.jboss.logging.Logger; import org.keycloak.OAuth2Constants; -import org.keycloak.RSATokenVerifier; import org.keycloak.adapters.rotation.AdapterRSATokenVerifier; import org.keycloak.adapters.spi.AdapterSessionStore; import org.keycloak.adapters.spi.AuthChallenge; import org.keycloak.adapters.spi.AuthOutcome; import org.keycloak.adapters.spi.HttpFacade; import org.keycloak.common.VerificationException; +import org.keycloak.common.util.KeycloakUriBuilder; +import org.keycloak.common.util.UriUtils; import org.keycloak.constants.AdapterConstants; import org.keycloak.enums.TokenStore; import org.keycloak.jose.jws.JWSInput; @@ -33,8 +34,6 @@ import org.keycloak.jose.jws.JWSInputException; import org.keycloak.representations.AccessToken; import org.keycloak.representations.AccessTokenResponse; import org.keycloak.representations.IDToken; -import org.keycloak.common.util.KeycloakUriBuilder; -import org.keycloak.common.util.UriUtils; import org.keycloak.util.TokenUtil; import java.io.IOException; diff --git a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/PreAuthActionsHandler.java b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/PreAuthActionsHandler.java index 5a1df8c1b6..b5506a5173 100755 --- a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/PreAuthActionsHandler.java +++ b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/PreAuthActionsHandler.java @@ -17,23 +17,23 @@ package org.keycloak.adapters; -import java.security.PublicKey; - import org.jboss.logging.Logger; import org.keycloak.adapters.rotation.AdapterRSATokenVerifier; import org.keycloak.adapters.spi.HttpFacade; import org.keycloak.adapters.spi.UserSessionManagement; -import org.keycloak.jose.jws.JWSInputException; -import org.keycloak.representations.VersionRepresentation; +import org.keycloak.common.util.StreamUtil; import org.keycloak.constants.AdapterConstants; import org.keycloak.jose.jws.JWSInput; +import org.keycloak.jose.jws.JWSInputException; import org.keycloak.jose.jws.crypto.RSAProvider; +import org.keycloak.representations.VersionRepresentation; import org.keycloak.representations.adapters.action.AdminAction; import org.keycloak.representations.adapters.action.LogoutAction; import org.keycloak.representations.adapters.action.PushNotBeforeAction; import org.keycloak.representations.adapters.action.TestAvailabilityAction; import org.keycloak.util.JsonSerialization; -import org.keycloak.common.util.StreamUtil; + +import java.security.PublicKey; /** * @author Bill Burke diff --git a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/RefreshableKeycloakSecurityContext.java b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/RefreshableKeycloakSecurityContext.java index 75f0cb8f2a..39a3f1e59f 100755 --- a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/RefreshableKeycloakSecurityContext.java +++ b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/RefreshableKeycloakSecurityContext.java @@ -20,7 +20,6 @@ package org.keycloak.adapters; import org.jboss.logging.Logger; import org.keycloak.AuthorizationContext; import org.keycloak.KeycloakSecurityContext; -import org.keycloak.RSATokenVerifier; import org.keycloak.adapters.rotation.AdapterRSATokenVerifier; import org.keycloak.common.VerificationException; import org.keycloak.common.util.Time; diff --git a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/ServerRequest.java b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/ServerRequest.java index 8996777842..7ec546c710 100755 --- a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/ServerRequest.java +++ b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/ServerRequest.java @@ -26,12 +26,12 @@ import org.apache.http.client.methods.HttpPost; import org.apache.http.message.BasicNameValuePair; import org.keycloak.OAuth2Constants; import org.keycloak.adapters.authentication.ClientCredentialsProviderUtils; -import org.keycloak.constants.AdapterConstants; -import org.keycloak.representations.AccessTokenResponse; import org.keycloak.common.util.HostUtils; -import org.keycloak.util.JsonSerialization; import org.keycloak.common.util.KeycloakUriBuilder; import org.keycloak.common.util.StreamUtil; +import org.keycloak.constants.AdapterConstants; +import org.keycloak.representations.AccessTokenResponse; +import org.keycloak.util.JsonSerialization; import java.io.ByteArrayOutputStream; import java.io.IOException; diff --git a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/authentication/ClientCredentialsProvider.java b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/authentication/ClientCredentialsProvider.java index 2483bdfd1e..c84af87ce7 100644 --- a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/authentication/ClientCredentialsProvider.java +++ b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/authentication/ClientCredentialsProvider.java @@ -17,10 +17,10 @@ package org.keycloak.adapters.authentication; -import java.util.Map; - import org.keycloak.adapters.KeycloakDeployment; +import java.util.Map; + /** * The simple SPI for authenticating clients/applications . It's used by adapter during all OIDC backchannel requests to Keycloak server * (codeToToken exchange, refresh token or backchannel logout) . You can also use it in your application during direct access grants or service account request diff --git a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/authentication/ClientCredentialsProviderUtils.java b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/authentication/ClientCredentialsProviderUtils.java index 4152338a07..4df727d937 100644 --- a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/authentication/ClientCredentialsProviderUtils.java +++ b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/authentication/ClientCredentialsProviderUtils.java @@ -17,6 +17,12 @@ package org.keycloak.adapters.authentication; +import org.apache.http.NameValuePair; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.message.BasicNameValuePair; +import org.jboss.logging.Logger; +import org.keycloak.adapters.KeycloakDeployment; + import java.util.HashMap; import java.util.Iterator; import java.util.List; @@ -24,12 +30,6 @@ import java.util.Map; import java.util.ServiceConfigurationError; import java.util.ServiceLoader; -import org.apache.http.NameValuePair; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.message.BasicNameValuePair; -import org.jboss.logging.Logger; -import org.keycloak.adapters.KeycloakDeployment; - /** * @author Marek Posolda */ diff --git a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/authentication/ClientIdAndSecretCredentialsProvider.java b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/authentication/ClientIdAndSecretCredentialsProvider.java index 6c8a075bef..d1c9cf9cae 100644 --- a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/authentication/ClientIdAndSecretCredentialsProvider.java +++ b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/authentication/ClientIdAndSecretCredentialsProvider.java @@ -17,14 +17,14 @@ package org.keycloak.adapters.authentication; -import java.util.Map; - import org.jboss.logging.Logger; import org.keycloak.OAuth2Constants; import org.keycloak.adapters.KeycloakDeployment; import org.keycloak.representations.idm.CredentialRepresentation; import org.keycloak.util.BasicAuthHelper; +import java.util.Map; + /** * Traditional OAuth2 authentication of clients based on client_id and client_secret * diff --git a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/authentication/JWTClientCredentialsProvider.java b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/authentication/JWTClientCredentialsProvider.java index 2490c0e653..8e06d5aa2c 100644 --- a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/authentication/JWTClientCredentialsProvider.java +++ b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/authentication/JWTClientCredentialsProvider.java @@ -17,16 +17,16 @@ package org.keycloak.adapters.authentication; -import java.security.PrivateKey; -import java.util.Map; - import org.keycloak.OAuth2Constants; import org.keycloak.adapters.AdapterUtils; import org.keycloak.adapters.KeycloakDeployment; -import org.keycloak.jose.jws.JWSBuilder; -import org.keycloak.representations.JsonWebToken; import org.keycloak.common.util.KeystoreUtil; import org.keycloak.common.util.Time; +import org.keycloak.jose.jws.JWSBuilder; +import org.keycloak.representations.JsonWebToken; + +import java.security.PrivateKey; +import java.util.Map; /** * Client authentication based on JWT signed by client private key . diff --git a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/authorization/BearerTokenPolicyEnforcer.java b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/authorization/BearerTokenPolicyEnforcer.java index efa2b2b948..91e23cf9b9 100644 --- a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/authorization/BearerTokenPolicyEnforcer.java +++ b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/authorization/BearerTokenPolicyEnforcer.java @@ -26,7 +26,6 @@ import org.keycloak.authorization.client.resource.PermissionResource; import org.keycloak.authorization.client.resource.ProtectionResource; import org.keycloak.representations.adapters.config.PolicyEnforcerConfig.PathConfig; -import java.util.List; import java.util.Set; /** diff --git a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/authorization/KeycloakAdapterPolicyEnforcer.java b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/authorization/KeycloakAdapterPolicyEnforcer.java index 1c900b8657..518c0549f7 100644 --- a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/authorization/KeycloakAdapterPolicyEnforcer.java +++ b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/authorization/KeycloakAdapterPolicyEnforcer.java @@ -18,7 +18,6 @@ package org.keycloak.adapters.authorization; import org.jboss.logging.Logger; -import org.keycloak.RSATokenVerifier; import org.keycloak.adapters.KeycloakDeployment; import org.keycloak.adapters.OIDCHttpFacade; import org.keycloak.adapters.rotation.AdapterRSATokenVerifier; @@ -34,7 +33,6 @@ import org.keycloak.authorization.client.representation.PermissionResponse; import org.keycloak.representations.AccessToken; import org.keycloak.representations.adapters.config.PolicyEnforcerConfig.PathConfig; import org.keycloak.representations.idm.authorization.Permission; -import org.keycloak.util.JsonSerialization; import java.util.ArrayList; import java.util.HashSet; diff --git a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/authorization/PolicyEnforcer.java b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/authorization/PolicyEnforcer.java index 88ef9ce00e..ff694bf54f 100644 --- a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/authorization/PolicyEnforcer.java +++ b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/authorization/PolicyEnforcer.java @@ -33,12 +33,9 @@ import org.keycloak.representations.adapters.config.PolicyEnforcerConfig.PathCon import org.keycloak.representations.idm.authorization.Permission; import java.util.ArrayList; -import java.util.Collection; import java.util.Collections; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Set; /** diff --git a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/jaas/AbstractKeycloakLoginModule.java b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/jaas/AbstractKeycloakLoginModule.java index 75086e7804..8d93fe995e 100755 --- a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/jaas/AbstractKeycloakLoginModule.java +++ b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/jaas/AbstractKeycloakLoginModule.java @@ -17,14 +17,17 @@ package org.keycloak.adapters.jaas; -import java.io.InputStream; -import java.lang.reflect.Constructor; -import java.security.Principal; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentMap; +import org.jboss.logging.Logger; +import org.keycloak.KeycloakPrincipal; +import org.keycloak.adapters.AdapterUtils; +import org.keycloak.adapters.KeycloakDeployment; +import org.keycloak.adapters.KeycloakDeploymentBuilder; +import org.keycloak.adapters.RefreshableKeycloakSecurityContext; +import org.keycloak.adapters.rotation.AdapterRSATokenVerifier; +import org.keycloak.common.VerificationException; +import org.keycloak.common.util.FindFile; +import org.keycloak.common.util.reflections.Reflections; +import org.keycloak.representations.AccessToken; import javax.security.auth.Subject; import javax.security.auth.callback.Callback; @@ -34,20 +37,14 @@ import javax.security.auth.callback.PasswordCallback; import javax.security.auth.callback.UnsupportedCallbackException; import javax.security.auth.login.LoginException; import javax.security.auth.spi.LoginModule; - -import org.jboss.logging.Logger; -import org.keycloak.KeycloakPrincipal; -import org.keycloak.RSATokenVerifier; -import org.keycloak.adapters.AdapterDeploymentContext; -import org.keycloak.adapters.AdapterUtils; -import org.keycloak.adapters.KeycloakDeployment; -import org.keycloak.adapters.KeycloakDeploymentBuilder; -import org.keycloak.adapters.RefreshableKeycloakSecurityContext; -import org.keycloak.adapters.rotation.AdapterRSATokenVerifier; -import org.keycloak.common.VerificationException; -import org.keycloak.common.util.FindFile; -import org.keycloak.representations.AccessToken; -import org.keycloak.common.util.reflections.Reflections; +import java.io.InputStream; +import java.lang.reflect.Constructor; +import java.security.Principal; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; /** * @author Marek Posolda diff --git a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/jaas/DirectAccessGrantsLoginModule.java b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/jaas/DirectAccessGrantsLoginModule.java index 78d98e779d..fffd39bad0 100755 --- a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/jaas/DirectAccessGrantsLoginModule.java +++ b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/jaas/DirectAccessGrantsLoginModule.java @@ -17,19 +17,6 @@ package org.keycloak.adapters.jaas; -import java.io.IOException; -import java.io.InputStream; -import java.io.Serializable; -import java.net.URI; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.security.auth.Subject; -import javax.security.auth.callback.CallbackHandler; -import javax.security.auth.login.LoginException; - import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.NameValuePair; @@ -39,13 +26,25 @@ import org.apache.http.client.methods.HttpPost; import org.apache.http.message.BasicNameValuePair; import org.jboss.logging.Logger; import org.keycloak.OAuth2Constants; -import org.keycloak.common.VerificationException; import org.keycloak.adapters.authentication.ClientCredentialsProviderUtils; +import org.keycloak.common.VerificationException; +import org.keycloak.common.util.KeycloakUriBuilder; import org.keycloak.constants.ServiceUrlConstants; import org.keycloak.representations.AccessTokenResponse; import org.keycloak.representations.idm.OAuth2ErrorRepresentation; import org.keycloak.util.JsonSerialization; -import org.keycloak.common.util.KeycloakUriBuilder; + +import javax.security.auth.Subject; +import javax.security.auth.callback.CallbackHandler; +import javax.security.auth.login.LoginException; +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; +import java.net.URI; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; /** * Login module based on Resource Owner password credentials grant from OAuth2 specs. It's supposed to be used in environments. which diff --git a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/rotation/AdapterRSATokenVerifier.java b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/rotation/AdapterRSATokenVerifier.java index c69ee38d65..236844ebc1 100644 --- a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/rotation/AdapterRSATokenVerifier.java +++ b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/rotation/AdapterRSATokenVerifier.java @@ -17,8 +17,6 @@ package org.keycloak.adapters.rotation; -import java.security.PublicKey; - import org.jboss.logging.Logger; import org.keycloak.RSATokenVerifier; import org.keycloak.adapters.KeycloakDeployment; @@ -26,6 +24,8 @@ import org.keycloak.common.VerificationException; import org.keycloak.jose.jws.JWSInput; import org.keycloak.representations.AccessToken; +import java.security.PublicKey; + /** * @author Marek Posolda */ diff --git a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/rotation/HardcodedPublicKeyLocator.java b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/rotation/HardcodedPublicKeyLocator.java index 40fb71ad77..469dd266d0 100644 --- a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/rotation/HardcodedPublicKeyLocator.java +++ b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/rotation/HardcodedPublicKeyLocator.java @@ -17,11 +17,11 @@ package org.keycloak.adapters.rotation; -import java.security.PublicKey; - import org.keycloak.adapters.KeycloakDeployment; import org.keycloak.jose.jws.JWSInput; +import java.security.PublicKey; + /** * @author Marek Posolda */ diff --git a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/rotation/JWKPublicKeyLocator.java b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/rotation/JWKPublicKeyLocator.java index 500392338c..cdb59f5b8a 100644 --- a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/rotation/JWKPublicKeyLocator.java +++ b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/rotation/JWKPublicKeyLocator.java @@ -17,10 +17,6 @@ package org.keycloak.adapters.rotation; -import java.security.PublicKey; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - import org.apache.http.client.methods.HttpGet; import org.jboss.logging.Logger; import org.keycloak.adapters.HttpAdapterUtils; @@ -32,6 +28,10 @@ import org.keycloak.jose.jwk.JWK; import org.keycloak.jose.jws.JWSInput; import org.keycloak.util.JWKSUtils; +import java.security.PublicKey; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + /** * When needed, publicKeys are downloaded by sending request to realm's jwks_url * diff --git a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/rotation/PublicKeyLocator.java b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/rotation/PublicKeyLocator.java index bda80dc3a3..62cef81971 100644 --- a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/rotation/PublicKeyLocator.java +++ b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/rotation/PublicKeyLocator.java @@ -17,11 +17,11 @@ package org.keycloak.adapters.rotation; -import java.security.PublicKey; - import org.keycloak.adapters.KeycloakDeployment; import org.keycloak.jose.jws.JWSInput; +import java.security.PublicKey; + /** * @author Marek Posolda */ diff --git a/adapters/oidc/adapter-core/src/test/java/org/keycloak/adapters/KeycloakDeploymentBuilderTest.java b/adapters/oidc/adapter-core/src/test/java/org/keycloak/adapters/KeycloakDeploymentBuilderTest.java index d1ce748f63..77eb475bf6 100644 --- a/adapters/oidc/adapter-core/src/test/java/org/keycloak/adapters/KeycloakDeploymentBuilderTest.java +++ b/adapters/oidc/adapter-core/src/test/java/org/keycloak/adapters/KeycloakDeploymentBuilderTest.java @@ -25,8 +25,8 @@ import org.keycloak.adapters.rotation.HardcodedPublicKeyLocator; import org.keycloak.adapters.rotation.JWKPublicKeyLocator; import org.keycloak.common.enums.RelativeUrlsUsed; import org.keycloak.common.enums.SslRequired; -import org.keycloak.enums.TokenStore; import org.keycloak.common.util.PemUtils; +import org.keycloak.enums.TokenStore; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; diff --git a/adapters/oidc/adapter-core/src/test/java/org/keycloak/adapters/RefreshableKeycloakSecurityContextTest.java b/adapters/oidc/adapter-core/src/test/java/org/keycloak/adapters/RefreshableKeycloakSecurityContextTest.java index 2310b21ab6..390680a4a7 100644 --- a/adapters/oidc/adapter-core/src/test/java/org/keycloak/adapters/RefreshableKeycloakSecurityContextTest.java +++ b/adapters/oidc/adapter-core/src/test/java/org/keycloak/adapters/RefreshableKeycloakSecurityContextTest.java @@ -1,9 +1,9 @@ package org.keycloak.adapters; -import static org.junit.Assert.*; - import org.junit.Test; import org.keycloak.representations.oidc.TokenMetadataRepresentation; + +import static org.junit.Assert.assertFalse; /** * @author github.com/tubbynl * diff --git a/adapters/oidc/as7-eap6/as7-adapter/src/main/java/org/keycloak/adapters/jbossweb/KeycloakAuthenticatorValve.java b/adapters/oidc/as7-eap6/as7-adapter/src/main/java/org/keycloak/adapters/jbossweb/KeycloakAuthenticatorValve.java index 46b7e64c42..72088b3b7d 100755 --- a/adapters/oidc/as7-eap6/as7-adapter/src/main/java/org/keycloak/adapters/jbossweb/KeycloakAuthenticatorValve.java +++ b/adapters/oidc/as7-eap6/as7-adapter/src/main/java/org/keycloak/adapters/jbossweb/KeycloakAuthenticatorValve.java @@ -22,15 +22,11 @@ import org.apache.catalina.connector.Request; import org.apache.catalina.connector.Response; import org.apache.catalina.core.StandardContext; import org.apache.catalina.deploy.LoginConfig; -import org.apache.catalina.realm.GenericPrincipal; import org.keycloak.adapters.tomcat.AbstractKeycloakAuthenticatorValve; import org.keycloak.adapters.tomcat.GenericPrincipalFactory; -import javax.servlet.ServletException; import javax.servlet.http.HttpServletResponse; import java.io.IOException; -import java.security.Principal; -import java.util.List; /** * Keycloak authentication valve diff --git a/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/KeycloakAdapterConfigService.java b/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/KeycloakAdapterConfigService.java index 0b690c3511..34c5a6bc05 100755 --- a/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/KeycloakAdapterConfigService.java +++ b/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/KeycloakAdapterConfigService.java @@ -17,17 +17,17 @@ package org.keycloak.subsystem.as7; +import org.jboss.as.server.deployment.DeploymentUnit; +import org.jboss.as.web.deployment.WarMetaData; import org.jboss.dmr.ModelNode; import org.jboss.dmr.Property; import org.jboss.logging.Logger; +import org.jboss.metadata.web.jboss.JBossWebMetaData; import java.util.HashMap; import java.util.Map; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADDRESS; -import org.jboss.as.server.deployment.DeploymentUnit; -import org.jboss.as.web.deployment.WarMetaData; -import org.jboss.metadata.web.jboss.JBossWebMetaData; /** * This service keeps track of the entire Keycloak management model so as to provide diff --git a/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/KeycloakSubsystemAdd.java b/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/KeycloakSubsystemAdd.java index 9f995b3b12..f4cb6c4ad3 100755 --- a/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/KeycloakSubsystemAdd.java +++ b/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/KeycloakSubsystemAdd.java @@ -25,7 +25,6 @@ import org.jboss.as.server.AbstractDeploymentChainStep; import org.jboss.as.server.DeploymentProcessorTarget; import org.jboss.as.server.deployment.Phase; import org.jboss.dmr.ModelNode; - import org.jboss.msc.service.ServiceController; import java.util.List; diff --git a/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/RealmWriteAttributeHandler.java b/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/RealmWriteAttributeHandler.java index f4cdca3c19..3a4ec04a99 100755 --- a/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/RealmWriteAttributeHandler.java +++ b/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/RealmWriteAttributeHandler.java @@ -23,8 +23,6 @@ import org.jboss.as.controller.OperationContext; import org.jboss.as.controller.OperationFailedException; import org.jboss.dmr.ModelNode; -import java.util.List; - /** * Update an attribute on a realm. * diff --git a/adapters/oidc/installed/src/main/java/org/keycloak/adapters/installed/KeycloakInstalled.java b/adapters/oidc/installed/src/main/java/org/keycloak/adapters/installed/KeycloakInstalled.java index c52a44af65..9834fe24de 100644 --- a/adapters/oidc/installed/src/main/java/org/keycloak/adapters/installed/KeycloakInstalled.java +++ b/adapters/oidc/installed/src/main/java/org/keycloak/adapters/installed/KeycloakInstalled.java @@ -19,12 +19,11 @@ package org.keycloak.adapters.installed; import org.keycloak.OAuth2Constants; import org.keycloak.OAuthErrorException; -import org.keycloak.RSATokenVerifier; -import org.keycloak.adapters.rotation.AdapterRSATokenVerifier; -import org.keycloak.common.VerificationException; import org.keycloak.adapters.KeycloakDeployment; import org.keycloak.adapters.KeycloakDeploymentBuilder; import org.keycloak.adapters.ServerRequest; +import org.keycloak.adapters.rotation.AdapterRSATokenVerifier; +import org.keycloak.common.VerificationException; import org.keycloak.jose.jws.JWSInput; import org.keycloak.jose.jws.JWSInputException; import org.keycloak.representations.AccessToken; diff --git a/adapters/oidc/jaxrs-oauth-client/src/main/java/org/keycloak/jaxrs/JaxrsBearerTokenFilterImpl.java b/adapters/oidc/jaxrs-oauth-client/src/main/java/org/keycloak/jaxrs/JaxrsBearerTokenFilterImpl.java index b3d1035a8e..bec9875a60 100755 --- a/adapters/oidc/jaxrs-oauth-client/src/main/java/org/keycloak/jaxrs/JaxrsBearerTokenFilterImpl.java +++ b/adapters/oidc/jaxrs-oauth-client/src/main/java/org/keycloak/jaxrs/JaxrsBearerTokenFilterImpl.java @@ -20,8 +20,6 @@ package org.keycloak.jaxrs; import org.keycloak.KeycloakPrincipal; import org.keycloak.adapters.AdapterDeploymentContext; import org.keycloak.adapters.AdapterUtils; -import org.keycloak.adapters.spi.AuthChallenge; -import org.keycloak.adapters.spi.AuthOutcome; import org.keycloak.adapters.AuthenticatedActionsHandler; import org.keycloak.adapters.BasicAuthRequestAuthenticator; import org.keycloak.adapters.BearerTokenRequestAuthenticator; @@ -31,6 +29,8 @@ import org.keycloak.adapters.KeycloakDeploymentBuilder; import org.keycloak.adapters.NodesRegistrationManagement; import org.keycloak.adapters.PreAuthActionsHandler; import org.keycloak.adapters.RefreshableKeycloakSecurityContext; +import org.keycloak.adapters.spi.AuthChallenge; +import org.keycloak.adapters.spi.AuthOutcome; import org.keycloak.adapters.spi.UserSessionManagement; import org.keycloak.common.constants.GenericConstants; @@ -40,7 +40,6 @@ import javax.ws.rs.container.ContainerRequestContext; import javax.ws.rs.container.PreMatching; import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; - import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; diff --git a/adapters/oidc/jaxrs-oauth-client/src/main/java/org/keycloak/jaxrs/JaxrsHttpFacade.java b/adapters/oidc/jaxrs-oauth-client/src/main/java/org/keycloak/jaxrs/JaxrsHttpFacade.java index 5c9c2631ba..82ecc0b308 100755 --- a/adapters/oidc/jaxrs-oauth-client/src/main/java/org/keycloak/jaxrs/JaxrsHttpFacade.java +++ b/adapters/oidc/jaxrs-oauth-client/src/main/java/org/keycloak/jaxrs/JaxrsHttpFacade.java @@ -17,22 +17,21 @@ package org.keycloak.jaxrs; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.List; -import java.util.Map; - -import javax.security.cert.X509Certificate; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.SecurityContext; - import org.keycloak.KeycloakSecurityContext; import org.keycloak.adapters.OIDCHttpFacade; import org.keycloak.adapters.spi.AuthenticationError; import org.keycloak.adapters.spi.LogoutError; import org.keycloak.common.util.HostUtils; +import javax.security.cert.X509Certificate; +import javax.ws.rs.container.ContainerRequestContext; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.SecurityContext; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; + /** * @author Marek Posolda */ diff --git a/adapters/oidc/jaxrs-oauth-client/src/main/java/org/keycloak/jaxrs/OsgiJaxrsBearerTokenFilterImpl.java b/adapters/oidc/jaxrs-oauth-client/src/main/java/org/keycloak/jaxrs/OsgiJaxrsBearerTokenFilterImpl.java index 16c7c4247a..b19fc7a9fe 100644 --- a/adapters/oidc/jaxrs-oauth-client/src/main/java/org/keycloak/jaxrs/OsgiJaxrsBearerTokenFilterImpl.java +++ b/adapters/oidc/jaxrs-oauth-client/src/main/java/org/keycloak/jaxrs/OsgiJaxrsBearerTokenFilterImpl.java @@ -17,18 +17,17 @@ package org.keycloak.jaxrs; -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.util.logging.Logger; +import org.keycloak.adapters.KeycloakConfigResolver; +import org.keycloak.common.constants.GenericConstants; +import org.osgi.framework.BundleContext; import javax.annotation.Priority; import javax.ws.rs.Priorities; import javax.ws.rs.container.PreMatching; - -import org.keycloak.adapters.KeycloakConfigResolver; -import org.keycloak.common.constants.GenericConstants; -import org.osgi.framework.BundleContext; +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.util.logging.Logger; /** * Variant of JaxrsBearerTokenFilter, which can be used to properly use resources from current osgi bundle diff --git a/adapters/oidc/jetty/jetty-core/src/main/java/org/keycloak/adapters/jetty/core/AbstractKeycloakJettyAuthenticator.java b/adapters/oidc/jetty/jetty-core/src/main/java/org/keycloak/adapters/jetty/core/AbstractKeycloakJettyAuthenticator.java index d732714a1d..ee41c0d209 100755 --- a/adapters/oidc/jetty/jetty-core/src/main/java/org/keycloak/adapters/jetty/core/AbstractKeycloakJettyAuthenticator.java +++ b/adapters/oidc/jetty/jetty-core/src/main/java/org/keycloak/adapters/jetty/core/AbstractKeycloakJettyAuthenticator.java @@ -27,28 +27,26 @@ import org.eclipse.jetty.security.authentication.FormAuthenticator; import org.eclipse.jetty.security.authentication.LoginAuthenticator; import org.eclipse.jetty.server.Authentication; import org.eclipse.jetty.server.Request; -import org.eclipse.jetty.server.Response; import org.eclipse.jetty.server.UserIdentity; import org.eclipse.jetty.server.handler.ContextHandler; -import org.eclipse.jetty.util.URIUtil; import org.jboss.logging.Logger; import org.keycloak.KeycloakPrincipal; import org.keycloak.KeycloakSecurityContext; import org.keycloak.adapters.AdapterDeploymentContext; import org.keycloak.adapters.AdapterTokenStore; import org.keycloak.adapters.AdapterUtils; -import org.keycloak.adapters.jetty.spi.JettyHttpFacade; -import org.keycloak.adapters.jetty.spi.JettyUserSessionManagement; -import org.keycloak.adapters.spi.AuthChallenge; -import org.keycloak.adapters.spi.AuthOutcome; import org.keycloak.adapters.AuthenticatedActionsHandler; -import org.keycloak.adapters.spi.HttpFacade; import org.keycloak.adapters.KeycloakConfigResolver; import org.keycloak.adapters.KeycloakDeployment; import org.keycloak.adapters.KeycloakDeploymentBuilder; import org.keycloak.adapters.NodesRegistrationManagement; import org.keycloak.adapters.PreAuthActionsHandler; import org.keycloak.adapters.RefreshableKeycloakSecurityContext; +import org.keycloak.adapters.jetty.spi.JettyHttpFacade; +import org.keycloak.adapters.jetty.spi.JettyUserSessionManagement; +import org.keycloak.adapters.spi.AuthChallenge; +import org.keycloak.adapters.spi.AuthOutcome; +import org.keycloak.adapters.spi.HttpFacade; import org.keycloak.constants.AdapterConstants; import org.keycloak.enums.TokenStore; import org.keycloak.representations.adapters.config.AdapterConfig; @@ -61,7 +59,6 @@ import javax.servlet.http.HttpServletResponse; import java.io.ByteArrayInputStream; import java.io.FileInputStream; import java.io.FileNotFoundException; -import java.io.IOException; import java.io.InputStream; import java.util.HashSet; import java.util.Set; diff --git a/adapters/oidc/jetty/jetty-core/src/main/java/org/keycloak/adapters/jetty/core/JettyCookieTokenStore.java b/adapters/oidc/jetty/jetty-core/src/main/java/org/keycloak/adapters/jetty/core/JettyCookieTokenStore.java index 01c17d117f..2aa973dd4d 100755 --- a/adapters/oidc/jetty/jetty-core/src/main/java/org/keycloak/adapters/jetty/core/JettyCookieTokenStore.java +++ b/adapters/oidc/jetty/jetty-core/src/main/java/org/keycloak/adapters/jetty/core/JettyCookieTokenStore.java @@ -23,11 +23,11 @@ import org.keycloak.KeycloakPrincipal; import org.keycloak.KeycloakSecurityContext; import org.keycloak.adapters.AdapterTokenStore; import org.keycloak.adapters.CookieTokenStore; -import org.keycloak.adapters.spi.HttpFacade; import org.keycloak.adapters.KeycloakDeployment; import org.keycloak.adapters.OidcKeycloakAccount; import org.keycloak.adapters.RefreshableKeycloakSecurityContext; import org.keycloak.adapters.RequestAuthenticator; +import org.keycloak.adapters.spi.HttpFacade; /** * Handle storage of token info in cookie. Per-request object. diff --git a/adapters/oidc/jetty/jetty-core/src/main/java/org/keycloak/adapters/jetty/core/JettyRequestAuthenticator.java b/adapters/oidc/jetty/jetty-core/src/main/java/org/keycloak/adapters/jetty/core/JettyRequestAuthenticator.java index 782a305668..38a2480b54 100755 --- a/adapters/oidc/jetty/jetty-core/src/main/java/org/keycloak/adapters/jetty/core/JettyRequestAuthenticator.java +++ b/adapters/oidc/jetty/jetty-core/src/main/java/org/keycloak/adapters/jetty/core/JettyRequestAuthenticator.java @@ -23,12 +23,12 @@ import org.keycloak.KeycloakPrincipal; import org.keycloak.KeycloakSecurityContext; import org.keycloak.adapters.AdapterTokenStore; import org.keycloak.adapters.AdapterUtils; -import org.keycloak.adapters.spi.HttpFacade; import org.keycloak.adapters.KeycloakDeployment; import org.keycloak.adapters.OAuthRequestAuthenticator; import org.keycloak.adapters.OidcKeycloakAccount; import org.keycloak.adapters.RefreshableKeycloakSecurityContext; import org.keycloak.adapters.RequestAuthenticator; +import org.keycloak.adapters.spi.HttpFacade; import javax.servlet.http.HttpSession; import java.security.Principal; diff --git a/adapters/oidc/jetty/jetty-core/src/main/java/org/keycloak/adapters/jetty/core/JettySessionTokenStore.java b/adapters/oidc/jetty/jetty-core/src/main/java/org/keycloak/adapters/jetty/core/JettySessionTokenStore.java index 676187b282..aada9c6fde 100755 --- a/adapters/oidc/jetty/jetty-core/src/main/java/org/keycloak/adapters/jetty/core/JettySessionTokenStore.java +++ b/adapters/oidc/jetty/jetty-core/src/main/java/org/keycloak/adapters/jetty/core/JettySessionTokenStore.java @@ -21,13 +21,13 @@ import org.eclipse.jetty.server.Request; import org.jboss.logging.Logger; import org.keycloak.KeycloakPrincipal; import org.keycloak.KeycloakSecurityContext; -import org.keycloak.adapters.spi.AdapterSessionStore; import org.keycloak.adapters.AdapterTokenStore; import org.keycloak.adapters.AdapterUtils; import org.keycloak.adapters.KeycloakDeployment; import org.keycloak.adapters.OidcKeycloakAccount; import org.keycloak.adapters.RefreshableKeycloakSecurityContext; import org.keycloak.adapters.RequestAuthenticator; +import org.keycloak.adapters.spi.AdapterSessionStore; import javax.servlet.http.HttpSession; diff --git a/adapters/oidc/jetty/jetty8.1/src/main/java/org/keycloak/adapters/jetty/JettyAdapterSessionStore.java b/adapters/oidc/jetty/jetty8.1/src/main/java/org/keycloak/adapters/jetty/JettyAdapterSessionStore.java index d4804bbee9..58d3fcb55c 100755 --- a/adapters/oidc/jetty/jetty8.1/src/main/java/org/keycloak/adapters/jetty/JettyAdapterSessionStore.java +++ b/adapters/oidc/jetty/jetty8.1/src/main/java/org/keycloak/adapters/jetty/JettyAdapterSessionStore.java @@ -20,8 +20,8 @@ package org.keycloak.adapters.jetty; import org.eclipse.jetty.security.authentication.FormAuthenticator; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.util.MultiMap; -import org.keycloak.adapters.spi.AdapterSessionStore; import org.keycloak.adapters.jetty.spi.JettyHttpFacade; +import org.keycloak.adapters.spi.AdapterSessionStore; import org.keycloak.common.util.MultivaluedHashMap; import javax.servlet.http.HttpSession; diff --git a/adapters/oidc/jetty/jetty9.1/src/main/java/org/keycloak/adapters/jetty/JettyAdapterSessionStore.java b/adapters/oidc/jetty/jetty9.1/src/main/java/org/keycloak/adapters/jetty/JettyAdapterSessionStore.java index 2abf4b0826..87fcd308b9 100755 --- a/adapters/oidc/jetty/jetty9.1/src/main/java/org/keycloak/adapters/jetty/JettyAdapterSessionStore.java +++ b/adapters/oidc/jetty/jetty9.1/src/main/java/org/keycloak/adapters/jetty/JettyAdapterSessionStore.java @@ -21,8 +21,8 @@ import org.eclipse.jetty.http.HttpMethod; import org.eclipse.jetty.security.authentication.FormAuthenticator; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.util.MultiMap; -import org.keycloak.adapters.spi.AdapterSessionStore; import org.keycloak.adapters.jetty.spi.JettyHttpFacade; +import org.keycloak.adapters.spi.AdapterSessionStore; import org.keycloak.common.util.MultivaluedHashMap; import javax.servlet.http.HttpSession; diff --git a/adapters/oidc/jetty/jetty9.2/src/main/java/org/keycloak/adapters/jetty/JettyAdapterSessionStore.java b/adapters/oidc/jetty/jetty9.2/src/main/java/org/keycloak/adapters/jetty/JettyAdapterSessionStore.java index d70b329b57..35e6683460 100755 --- a/adapters/oidc/jetty/jetty9.2/src/main/java/org/keycloak/adapters/jetty/JettyAdapterSessionStore.java +++ b/adapters/oidc/jetty/jetty9.2/src/main/java/org/keycloak/adapters/jetty/JettyAdapterSessionStore.java @@ -21,8 +21,8 @@ import org.eclipse.jetty.http.HttpMethod; import org.eclipse.jetty.security.authentication.FormAuthenticator; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.util.MultiMap; -import org.keycloak.adapters.spi.AdapterSessionStore; import org.keycloak.adapters.jetty.spi.JettyHttpFacade; +import org.keycloak.adapters.spi.AdapterSessionStore; import org.keycloak.common.util.MultivaluedHashMap; import javax.servlet.http.HttpSession; diff --git a/adapters/oidc/jetty/jetty9.3/src/main/java/org/keycloak/adapters/jetty/JettyAdapterSessionStore.java b/adapters/oidc/jetty/jetty9.3/src/main/java/org/keycloak/adapters/jetty/JettyAdapterSessionStore.java index f5f6ef83e9..642bdf5663 100644 --- a/adapters/oidc/jetty/jetty9.3/src/main/java/org/keycloak/adapters/jetty/JettyAdapterSessionStore.java +++ b/adapters/oidc/jetty/jetty9.3/src/main/java/org/keycloak/adapters/jetty/JettyAdapterSessionStore.java @@ -17,12 +17,11 @@ package org.keycloak.adapters.jetty; -import org.eclipse.jetty.http.HttpMethod; import org.eclipse.jetty.security.authentication.FormAuthenticator; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.util.MultiMap; -import org.keycloak.adapters.spi.AdapterSessionStore; import org.keycloak.adapters.jetty.spi.JettyHttpFacade; +import org.keycloak.adapters.spi.AdapterSessionStore; import org.keycloak.common.util.MultivaluedHashMap; import javax.servlet.http.HttpSession; diff --git a/adapters/oidc/osgi-adapter/src/main/java/org/keycloak/adapters/osgi/PathBasedKeycloakConfigResolver.java b/adapters/oidc/osgi-adapter/src/main/java/org/keycloak/adapters/osgi/PathBasedKeycloakConfigResolver.java index 93d5cb6f40..77e19dfa54 100644 --- a/adapters/oidc/osgi-adapter/src/main/java/org/keycloak/adapters/osgi/PathBasedKeycloakConfigResolver.java +++ b/adapters/oidc/osgi-adapter/src/main/java/org/keycloak/adapters/osgi/PathBasedKeycloakConfigResolver.java @@ -16,6 +16,11 @@ */ package org.keycloak.adapters.osgi; +import org.keycloak.adapters.KeycloakConfigResolver; +import org.keycloak.adapters.KeycloakDeployment; +import org.keycloak.adapters.KeycloakDeploymentBuilder; +import org.keycloak.adapters.OIDCHttpFacade; + import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; @@ -23,11 +28,6 @@ import java.io.InputStream; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import org.keycloak.adapters.KeycloakConfigResolver; -import org.keycloak.adapters.KeycloakDeployment; -import org.keycloak.adapters.KeycloakDeploymentBuilder; -import org.keycloak.adapters.OIDCHttpFacade; - public class PathBasedKeycloakConfigResolver implements KeycloakConfigResolver { private final Map cache = new ConcurrentHashMap(); diff --git a/adapters/oidc/osgi-adapter/src/main/java/org/keycloak/adapters/osgi/PaxWebIntegrationService.java b/adapters/oidc/osgi-adapter/src/main/java/org/keycloak/adapters/osgi/PaxWebIntegrationService.java index 9420900163..f295b30945 100644 --- a/adapters/oidc/osgi-adapter/src/main/java/org/keycloak/adapters/osgi/PaxWebIntegrationService.java +++ b/adapters/oidc/osgi-adapter/src/main/java/org/keycloak/adapters/osgi/PaxWebIntegrationService.java @@ -17,11 +17,6 @@ package org.keycloak.adapters.osgi; -import java.net.URL; -import java.security.SecureRandom; -import java.util.Arrays; -import java.util.List; - import org.eclipse.jetty.security.ConstraintMapping; import org.eclipse.jetty.util.security.Constraint; import org.jboss.logging.Logger; @@ -32,6 +27,11 @@ import org.osgi.service.http.HttpContext; import org.osgi.util.tracker.ServiceTracker; import org.osgi.util.tracker.ServiceTrackerCustomizer; +import java.net.URL; +import java.security.SecureRandom; +import java.util.Arrays; +import java.util.List; + /** * Integration with pax-web, which allows to inject custom jetty-web.xml configuration from current bundle classpath into {@link WebContainer} * and allows to inject custom security constraint for securing resources by Keycloak. diff --git a/adapters/oidc/osgi-adapter/src/main/java/org/keycloak/adapters/osgi/ServletReregistrationService.java b/adapters/oidc/osgi-adapter/src/main/java/org/keycloak/adapters/osgi/ServletReregistrationService.java index 1aace71011..269b3cd5fb 100644 --- a/adapters/oidc/osgi-adapter/src/main/java/org/keycloak/adapters/osgi/ServletReregistrationService.java +++ b/adapters/oidc/osgi-adapter/src/main/java/org/keycloak/adapters/osgi/ServletReregistrationService.java @@ -17,15 +17,6 @@ package org.keycloak.adapters.osgi; -import java.util.Arrays; -import java.util.Dictionary; -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.List; -import java.util.Properties; - -import javax.servlet.Servlet; - import org.apache.cxf.transport.http.DestinationRegistry; import org.apache.cxf.transport.servlet.CXFNonSpringServlet; import org.jboss.logging.Logger; @@ -38,6 +29,14 @@ import org.osgi.service.http.HttpContext; import org.osgi.util.tracker.ServiceTracker; import org.osgi.util.tracker.ServiceTrackerCustomizer; +import javax.servlet.Servlet; +import java.util.Arrays; +import java.util.Dictionary; +import java.util.Enumeration; +import java.util.Hashtable; +import java.util.List; +import java.util.Properties; + /** * Service, which allows to remove previously registered servlets in karaf/fuse environment. It assumes that particular servlet was previously * registered as service in OSGI container under {@link javax.servlet.Servlet} interface. diff --git a/adapters/oidc/servlet-filter/src/main/java/org/keycloak/adapters/servlet/KeycloakOIDCFilter.java b/adapters/oidc/servlet-filter/src/main/java/org/keycloak/adapters/servlet/KeycloakOIDCFilter.java index fc136167d1..43cc69f34b 100755 --- a/adapters/oidc/servlet-filter/src/main/java/org/keycloak/adapters/servlet/KeycloakOIDCFilter.java +++ b/adapters/oidc/servlet-filter/src/main/java/org/keycloak/adapters/servlet/KeycloakOIDCFilter.java @@ -18,15 +18,15 @@ package org.keycloak.adapters.servlet; import org.keycloak.adapters.AdapterDeploymentContext; -import org.keycloak.adapters.spi.AuthChallenge; -import org.keycloak.adapters.spi.AuthOutcome; import org.keycloak.adapters.AuthenticatedActionsHandler; -import org.keycloak.adapters.spi.InMemorySessionIdMapper; import org.keycloak.adapters.KeycloakConfigResolver; import org.keycloak.adapters.KeycloakDeployment; import org.keycloak.adapters.KeycloakDeploymentBuilder; import org.keycloak.adapters.NodesRegistrationManagement; import org.keycloak.adapters.PreAuthActionsHandler; +import org.keycloak.adapters.spi.AuthChallenge; +import org.keycloak.adapters.spi.AuthOutcome; +import org.keycloak.adapters.spi.InMemorySessionIdMapper; import org.keycloak.adapters.spi.SessionIdMapper; import org.keycloak.adapters.spi.UserSessionManagement; @@ -39,7 +39,6 @@ import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequestWrapper; import javax.servlet.http.HttpServletResponse; - import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; diff --git a/adapters/oidc/servlet-oauth-client/src/main/java/org/keycloak/servlet/KeycloakDeploymentDelegateOAuthClient.java b/adapters/oidc/servlet-oauth-client/src/main/java/org/keycloak/servlet/KeycloakDeploymentDelegateOAuthClient.java index 0d03fb508c..e01f157fa8 100644 --- a/adapters/oidc/servlet-oauth-client/src/main/java/org/keycloak/servlet/KeycloakDeploymentDelegateOAuthClient.java +++ b/adapters/oidc/servlet-oauth-client/src/main/java/org/keycloak/servlet/KeycloakDeploymentDelegateOAuthClient.java @@ -17,12 +17,12 @@ package org.keycloak.servlet; -import java.util.Map; - import org.keycloak.AbstractOAuthClient; import org.keycloak.adapters.KeycloakDeployment; import org.keycloak.common.enums.RelativeUrlsUsed; +import java.util.Map; + /** * @author Marek Posolda */ diff --git a/adapters/oidc/servlet-oauth-client/src/main/java/org/keycloak/servlet/ServletOAuthClient.java b/adapters/oidc/servlet-oauth-client/src/main/java/org/keycloak/servlet/ServletOAuthClient.java index 64099e622e..966006204e 100755 --- a/adapters/oidc/servlet-oauth-client/src/main/java/org/keycloak/servlet/ServletOAuthClient.java +++ b/adapters/oidc/servlet-oauth-client/src/main/java/org/keycloak/servlet/ServletOAuthClient.java @@ -25,11 +25,11 @@ import org.keycloak.adapters.OIDCHttpFacade; import org.keycloak.adapters.ServerRequest; import org.keycloak.adapters.spi.AuthenticationError; import org.keycloak.adapters.spi.LogoutError; +import org.keycloak.common.util.KeycloakUriBuilder; import org.keycloak.jose.jws.JWSInput; import org.keycloak.jose.jws.JWSInputException; import org.keycloak.representations.AccessTokenResponse; import org.keycloak.representations.IDToken; -import org.keycloak.common.util.KeycloakUriBuilder; import org.keycloak.util.TokenUtil; import javax.security.cert.X509Certificate; diff --git a/adapters/oidc/servlet-oauth-client/src/main/java/org/keycloak/servlet/ServletOAuthClientBuilder.java b/adapters/oidc/servlet-oauth-client/src/main/java/org/keycloak/servlet/ServletOAuthClientBuilder.java index fbd6723c09..f515bfbf5a 100755 --- a/adapters/oidc/servlet-oauth-client/src/main/java/org/keycloak/servlet/ServletOAuthClientBuilder.java +++ b/adapters/oidc/servlet-oauth-client/src/main/java/org/keycloak/servlet/ServletOAuthClientBuilder.java @@ -20,6 +20,7 @@ package org.keycloak.servlet; import org.keycloak.adapters.KeycloakDeployment; import org.keycloak.adapters.KeycloakDeploymentBuilder; import org.keycloak.representations.adapters.config.AdapterConfig; + import java.io.InputStream; /** diff --git a/adapters/oidc/spring-security/src/main/java/org/keycloak/adapters/springsecurity/AdapterDeploymentContextFactoryBean.java b/adapters/oidc/spring-security/src/main/java/org/keycloak/adapters/springsecurity/AdapterDeploymentContextFactoryBean.java index f3ae8473c3..788564a2e1 100644 --- a/adapters/oidc/spring-security/src/main/java/org/keycloak/adapters/springsecurity/AdapterDeploymentContextFactoryBean.java +++ b/adapters/oidc/spring-security/src/main/java/org/keycloak/adapters/springsecurity/AdapterDeploymentContextFactoryBean.java @@ -17,22 +17,20 @@ package org.keycloak.adapters.springsecurity; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.Objects; - import org.keycloak.adapters.AdapterDeploymentContext; import org.keycloak.adapters.KeycloakConfigResolver; import org.keycloak.adapters.KeycloakDeployment; import org.keycloak.adapters.KeycloakDeploymentBuilder; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; - import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.InitializingBean; import org.springframework.core.io.Resource; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.Objects; + /** * {@link FactoryBean} that creates an {@link AdapterDeploymentContext} given a {@link Resource} defining the Keycloak * client configuration or a {@link KeycloakConfigResolver} for multi-tenant environments. diff --git a/adapters/oidc/spring-security/src/main/java/org/keycloak/adapters/springsecurity/authentication/SpringSecurityRequestAuthenticator.java b/adapters/oidc/spring-security/src/main/java/org/keycloak/adapters/springsecurity/authentication/SpringSecurityRequestAuthenticator.java index 63ccee5b12..9dd989fd19 100755 --- a/adapters/oidc/spring-security/src/main/java/org/keycloak/adapters/springsecurity/authentication/SpringSecurityRequestAuthenticator.java +++ b/adapters/oidc/spring-security/src/main/java/org/keycloak/adapters/springsecurity/authentication/SpringSecurityRequestAuthenticator.java @@ -21,13 +21,13 @@ import org.keycloak.KeycloakPrincipal; import org.keycloak.KeycloakSecurityContext; import org.keycloak.adapters.AdapterTokenStore; import org.keycloak.adapters.AdapterUtils; -import org.keycloak.adapters.spi.HttpFacade; -import org.keycloak.adapters.spi.KeycloakAccount; import org.keycloak.adapters.KeycloakDeployment; import org.keycloak.adapters.OAuthRequestAuthenticator; import org.keycloak.adapters.OidcKeycloakAccount; import org.keycloak.adapters.RefreshableKeycloakSecurityContext; import org.keycloak.adapters.RequestAuthenticator; +import org.keycloak.adapters.spi.HttpFacade; +import org.keycloak.adapters.spi.KeycloakAccount; import org.keycloak.adapters.springsecurity.account.SimpleKeycloakAccount; import org.keycloak.adapters.springsecurity.token.KeycloakAuthenticationToken; import org.slf4j.Logger; diff --git a/adapters/oidc/spring-security/src/main/java/org/keycloak/adapters/springsecurity/client/KeycloakClientRequestFactory.java b/adapters/oidc/spring-security/src/main/java/org/keycloak/adapters/springsecurity/client/KeycloakClientRequestFactory.java index 283c1a3b52..a5954694e0 100644 --- a/adapters/oidc/spring-security/src/main/java/org/keycloak/adapters/springsecurity/client/KeycloakClientRequestFactory.java +++ b/adapters/oidc/spring-security/src/main/java/org/keycloak/adapters/springsecurity/client/KeycloakClientRequestFactory.java @@ -17,7 +17,6 @@ package org.keycloak.adapters.springsecurity.client; -import org.apache.http.HttpHost; import org.apache.http.client.methods.HttpUriRequest; import org.apache.http.impl.client.HttpClients; import org.keycloak.KeycloakSecurityContext; diff --git a/adapters/oidc/spring-security/src/main/java/org/keycloak/adapters/springsecurity/filter/KeycloakAuthenticationProcessingFilter.java b/adapters/oidc/spring-security/src/main/java/org/keycloak/adapters/springsecurity/filter/KeycloakAuthenticationProcessingFilter.java index 33f498472b..a3ed6b835b 100644 --- a/adapters/oidc/spring-security/src/main/java/org/keycloak/adapters/springsecurity/filter/KeycloakAuthenticationProcessingFilter.java +++ b/adapters/oidc/spring-security/src/main/java/org/keycloak/adapters/springsecurity/filter/KeycloakAuthenticationProcessingFilter.java @@ -19,10 +19,10 @@ package org.keycloak.adapters.springsecurity.filter; import org.keycloak.adapters.AdapterDeploymentContext; import org.keycloak.adapters.AdapterTokenStore; -import org.keycloak.adapters.spi.AuthChallenge; -import org.keycloak.adapters.spi.AuthOutcome; import org.keycloak.adapters.KeycloakDeployment; import org.keycloak.adapters.RequestAuthenticator; +import org.keycloak.adapters.spi.AuthChallenge; +import org.keycloak.adapters.spi.AuthOutcome; import org.keycloak.adapters.spi.HttpFacade; import org.keycloak.adapters.springsecurity.KeycloakAuthenticationException; import org.keycloak.adapters.springsecurity.authentication.KeycloakAuthenticationEntryPoint; diff --git a/adapters/oidc/spring-security/src/main/java/org/keycloak/adapters/springsecurity/filter/KeycloakPreAuthActionsFilter.java b/adapters/oidc/spring-security/src/main/java/org/keycloak/adapters/springsecurity/filter/KeycloakPreAuthActionsFilter.java index b8ecbb07b4..fc79dd07a4 100755 --- a/adapters/oidc/spring-security/src/main/java/org/keycloak/adapters/springsecurity/filter/KeycloakPreAuthActionsFilter.java +++ b/adapters/oidc/spring-security/src/main/java/org/keycloak/adapters/springsecurity/filter/KeycloakPreAuthActionsFilter.java @@ -18,9 +18,9 @@ package org.keycloak.adapters.springsecurity.filter; import org.keycloak.adapters.AdapterDeploymentContext; -import org.keycloak.adapters.spi.HttpFacade; import org.keycloak.adapters.NodesRegistrationManagement; import org.keycloak.adapters.PreAuthActionsHandler; +import org.keycloak.adapters.spi.HttpFacade; import org.keycloak.adapters.spi.UserSessionManagement; import org.keycloak.adapters.springsecurity.facade.SimpleHttpFacade; import org.slf4j.Logger; diff --git a/adapters/oidc/spring-security/src/main/java/org/keycloak/adapters/springsecurity/token/KeycloakAuthenticationToken.java b/adapters/oidc/spring-security/src/main/java/org/keycloak/adapters/springsecurity/token/KeycloakAuthenticationToken.java index 6e09e5ee3c..95db51011a 100755 --- a/adapters/oidc/spring-security/src/main/java/org/keycloak/adapters/springsecurity/token/KeycloakAuthenticationToken.java +++ b/adapters/oidc/spring-security/src/main/java/org/keycloak/adapters/springsecurity/token/KeycloakAuthenticationToken.java @@ -17,8 +17,8 @@ package org.keycloak.adapters.springsecurity.token; -import org.keycloak.adapters.spi.KeycloakAccount; import org.keycloak.adapters.OidcKeycloakAccount; +import org.keycloak.adapters.spi.KeycloakAccount; import org.springframework.security.authentication.AbstractAuthenticationToken; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.core.Authentication; diff --git a/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/AdapterDeploymentContextFactoryBeanTest.java b/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/AdapterDeploymentContextFactoryBeanTest.java index 24ed50476b..3546b5b05d 100644 --- a/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/AdapterDeploymentContextFactoryBeanTest.java +++ b/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/AdapterDeploymentContextFactoryBeanTest.java @@ -17,19 +17,17 @@ package org.keycloak.adapters.springsecurity; -import java.io.FileNotFoundException; - import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; - import org.keycloak.adapters.KeycloakConfigResolver; import org.keycloak.adapters.KeycloakDeployment; import org.keycloak.adapters.spi.HttpFacade; - import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; +import java.io.FileNotFoundException; + import static org.junit.Assert.assertNotNull; public class AdapterDeploymentContextFactoryBeanTest { diff --git a/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/authentication/HttpHeaderInspectingApiRequestMatcherTest.java b/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/authentication/HttpHeaderInspectingApiRequestMatcherTest.java index 9684133586..8e6ab8097a 100644 --- a/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/authentication/HttpHeaderInspectingApiRequestMatcherTest.java +++ b/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/authentication/HttpHeaderInspectingApiRequestMatcherTest.java @@ -23,7 +23,8 @@ import org.junit.Test; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.security.web.util.matcher.RequestMatcher; -import static org.junit.Assert.*; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; /** * HTTP header inspecting API request matcher tests. diff --git a/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/authentication/KeycloakAuthenticationEntryPointTest.java b/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/authentication/KeycloakAuthenticationEntryPointTest.java index cb18b118b5..49eb512b84 100644 --- a/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/authentication/KeycloakAuthenticationEntryPointTest.java +++ b/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/authentication/KeycloakAuthenticationEntryPointTest.java @@ -24,7 +24,8 @@ import org.springframework.http.HttpStatus; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.mock.web.MockHttpServletResponse; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; /** * Keycloak authentication entry point tests. diff --git a/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/authentication/KeycloakAuthenticationProviderTest.java b/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/authentication/KeycloakAuthenticationProviderTest.java index 07fc06054e..06757bba99 100644 --- a/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/authentication/KeycloakAuthenticationProviderTest.java +++ b/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/authentication/KeycloakAuthenticationProviderTest.java @@ -19,8 +19,8 @@ package org.keycloak.adapters.springsecurity.authentication; import org.junit.Before; import org.junit.Test; -import org.keycloak.adapters.spi.KeycloakAccount; import org.keycloak.adapters.RefreshableKeycloakSecurityContext; +import org.keycloak.adapters.spi.KeycloakAccount; import org.keycloak.adapters.springsecurity.account.SimpleKeycloakAccount; import org.keycloak.adapters.springsecurity.token.KeycloakAuthenticationToken; import org.mockito.internal.util.collections.Sets; @@ -32,8 +32,11 @@ import org.springframework.security.web.authentication.preauth.PreAuthenticatedA import java.security.Principal; import java.util.Set; -import static org.junit.Assert.*; -import static org.mockito.Mockito.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; /** * Keycloak authentication provider tests. diff --git a/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/authentication/KeycloakLogoutHandlerTest.java b/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/authentication/KeycloakLogoutHandlerTest.java index 3d783e304f..12865de1a8 100755 --- a/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/authentication/KeycloakLogoutHandlerTest.java +++ b/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/authentication/KeycloakLogoutHandlerTest.java @@ -39,7 +39,12 @@ import java.util.Collection; import java.util.Collections; import java.util.UUID; -import static org.mockito.Mockito.*; +import static org.mockito.Mockito.any; +import static org.mockito.Mockito.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyZeroInteractions; +import static org.mockito.Mockito.when; /** * Keycloak logout handler tests. diff --git a/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/authentication/SpringSecurityRequestAuthenticatorTest.java b/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/authentication/SpringSecurityRequestAuthenticatorTest.java index d5667cb8ea..373a8dd41b 100755 --- a/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/authentication/SpringSecurityRequestAuthenticatorTest.java +++ b/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/authentication/SpringSecurityRequestAuthenticatorTest.java @@ -22,11 +22,11 @@ import org.junit.Test; import org.keycloak.KeycloakPrincipal; import org.keycloak.KeycloakSecurityContext; import org.keycloak.adapters.AdapterTokenStore; -import org.keycloak.adapters.spi.HttpFacade; import org.keycloak.adapters.KeycloakDeployment; import org.keycloak.adapters.OAuthRequestAuthenticator; import org.keycloak.adapters.OidcKeycloakAccount; import org.keycloak.adapters.RefreshableKeycloakSecurityContext; +import org.keycloak.adapters.spi.HttpFacade; import org.keycloak.adapters.springsecurity.facade.SimpleHttpFacade; import org.keycloak.adapters.springsecurity.token.KeycloakAuthenticationToken; import org.keycloak.representations.AccessToken; @@ -37,8 +37,14 @@ import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.mock.web.MockHttpServletResponse; import org.springframework.security.core.context.SecurityContextHolder; -import static org.junit.Assert.*; -import static org.mockito.Mockito.*; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.any; +import static org.mockito.Mockito.eq; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; /** * Spring Security request authenticator tests. diff --git a/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/client/KeycloakClientRequestFactoryTest.java b/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/client/KeycloakClientRequestFactoryTest.java index 9777992dca..bfd3bd022c 100755 --- a/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/client/KeycloakClientRequestFactoryTest.java +++ b/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/client/KeycloakClientRequestFactoryTest.java @@ -33,8 +33,11 @@ import org.springframework.security.web.authentication.preauth.PreAuthenticatedA import java.util.Collections; import java.util.UUID; -import static org.junit.Assert.*; -import static org.mockito.Mockito.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.mockito.Mockito.eq; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; /** * Keycloak client request factory tests. diff --git a/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/facade/WrappedHttpServletRequestTest.java b/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/facade/WrappedHttpServletRequestTest.java index fd29f39383..cb259ce5f2 100644 --- a/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/facade/WrappedHttpServletRequestTest.java +++ b/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/facade/WrappedHttpServletRequestTest.java @@ -25,7 +25,9 @@ import org.springframework.web.bind.annotation.RequestMethod; import javax.servlet.http.Cookie; import java.util.List; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; /** * Wrapped HTTP servlet request tests. diff --git a/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/facade/WrappedHttpServletResponseTest.java b/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/facade/WrappedHttpServletResponseTest.java index 8ebdda33ca..6349fbb840 100644 --- a/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/facade/WrappedHttpServletResponseTest.java +++ b/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/facade/WrappedHttpServletResponseTest.java @@ -25,8 +25,13 @@ import org.springframework.mock.web.MockHttpServletResponse; import javax.servlet.http.Cookie; -import static org.junit.Assert.*; -import static org.mockito.Mockito.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.any; +import static org.mockito.Mockito.eq; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.verify; public class WrappedHttpServletResponseTest { diff --git a/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/filter/KeycloakAuthenticationProcessingFilterTest.java b/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/filter/KeycloakAuthenticationProcessingFilterTest.java index 0e81eb3df1..055447f034 100755 --- a/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/filter/KeycloakAuthenticationProcessingFilterTest.java +++ b/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/filter/KeycloakAuthenticationProcessingFilterTest.java @@ -49,8 +49,16 @@ import java.util.Collections; import java.util.List; import java.util.UUID; -import static org.junit.Assert.*; -import static org.mockito.Mockito.*; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.any; +import static org.mockito.Mockito.anyString; +import static org.mockito.Mockito.eq; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.startsWith; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; /** * Keycloak authentication process filter test cases. diff --git a/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/filter/KeycloakCsrfRequestMatcherTest.java b/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/filter/KeycloakCsrfRequestMatcherTest.java index 521be6ea62..a693203d1c 100644 --- a/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/filter/KeycloakCsrfRequestMatcherTest.java +++ b/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/filter/KeycloakCsrfRequestMatcherTest.java @@ -23,7 +23,8 @@ import org.keycloak.constants.AdapterConstants; import org.springframework.http.HttpMethod; import org.springframework.mock.web.MockHttpServletRequest; -import static org.junit.Assert.*; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; /** * Keycloak CSRF request matcher tests. diff --git a/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/token/SpringSecurityAdapterTokenStoreFactoryTest.java b/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/token/SpringSecurityAdapterTokenStoreFactoryTest.java index 199500cde9..d074fd2570 100755 --- a/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/token/SpringSecurityAdapterTokenStoreFactoryTest.java +++ b/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/token/SpringSecurityAdapterTokenStoreFactoryTest.java @@ -19,14 +19,15 @@ package org.keycloak.adapters.springsecurity.token; import org.junit.Before; import org.junit.Test; -import org.keycloak.adapters.spi.AdapterSessionStore; import org.keycloak.adapters.KeycloakDeployment; +import org.keycloak.adapters.spi.AdapterSessionStore; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import javax.servlet.http.HttpServletRequest; -import static org.junit.Assert.*; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; /** * Spring Security adapter token store factory tests. diff --git a/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/token/SpringSecurityTokenStoreTest.java b/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/token/SpringSecurityTokenStoreTest.java index 8ba0b70e54..8b5ebbc40f 100755 --- a/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/token/SpringSecurityTokenStoreTest.java +++ b/adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/token/SpringSecurityTokenStoreTest.java @@ -37,7 +37,9 @@ import org.springframework.security.web.authentication.preauth.PreAuthenticatedA import java.security.Principal; import java.util.Collections; -import static org.junit.Assert.*; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; /** * Spring Security token store tests. diff --git a/adapters/oidc/tomcat/tomcat-core/src/main/java/org/keycloak/adapters/tomcat/AbstractKeycloakAuthenticatorValve.java b/adapters/oidc/tomcat/tomcat-core/src/main/java/org/keycloak/adapters/tomcat/AbstractKeycloakAuthenticatorValve.java index 106fe2a4b3..32bcf39aa5 100755 --- a/adapters/oidc/tomcat/tomcat-core/src/main/java/org/keycloak/adapters/tomcat/AbstractKeycloakAuthenticatorValve.java +++ b/adapters/oidc/tomcat/tomcat-core/src/main/java/org/keycloak/adapters/tomcat/AbstractKeycloakAuthenticatorValve.java @@ -26,17 +26,18 @@ import org.apache.catalina.authenticator.FormAuthenticator; import org.apache.catalina.connector.Request; import org.apache.catalina.connector.Response; import org.keycloak.KeycloakSecurityContext; -import org.keycloak.constants.AdapterConstants; import org.keycloak.adapters.AdapterDeploymentContext; import org.keycloak.adapters.AdapterTokenStore; -import org.keycloak.adapters.spi.AuthChallenge; -import org.keycloak.adapters.spi.AuthOutcome; -import org.keycloak.adapters.spi.HttpFacade; +import org.keycloak.adapters.KeycloakConfigResolver; import org.keycloak.adapters.KeycloakDeployment; import org.keycloak.adapters.KeycloakDeploymentBuilder; import org.keycloak.adapters.NodesRegistrationManagement; import org.keycloak.adapters.PreAuthActionsHandler; import org.keycloak.adapters.RefreshableKeycloakSecurityContext; +import org.keycloak.adapters.spi.AuthChallenge; +import org.keycloak.adapters.spi.AuthOutcome; +import org.keycloak.adapters.spi.HttpFacade; +import org.keycloak.constants.AdapterConstants; import org.keycloak.enums.TokenStore; import javax.servlet.ServletContext; @@ -49,7 +50,6 @@ import java.io.IOException; import java.io.InputStream; import java.util.logging.Level; import java.util.logging.Logger; -import org.keycloak.adapters.KeycloakConfigResolver; /** * Keycloak authentication valve diff --git a/adapters/oidc/tomcat/tomcat-core/src/main/java/org/keycloak/adapters/tomcat/CatalinaCookieTokenStore.java b/adapters/oidc/tomcat/tomcat-core/src/main/java/org/keycloak/adapters/tomcat/CatalinaCookieTokenStore.java index 3f1f3ff555..d2b6474539 100755 --- a/adapters/oidc/tomcat/tomcat-core/src/main/java/org/keycloak/adapters/tomcat/CatalinaCookieTokenStore.java +++ b/adapters/oidc/tomcat/tomcat-core/src/main/java/org/keycloak/adapters/tomcat/CatalinaCookieTokenStore.java @@ -17,9 +17,6 @@ package org.keycloak.adapters.tomcat; -import java.util.Set; -import java.util.logging.Logger; - import org.apache.catalina.connector.Request; import org.apache.catalina.realm.GenericPrincipal; import org.keycloak.KeycloakPrincipal; @@ -27,11 +24,14 @@ import org.keycloak.KeycloakSecurityContext; import org.keycloak.adapters.AdapterTokenStore; import org.keycloak.adapters.AdapterUtils; import org.keycloak.adapters.CookieTokenStore; -import org.keycloak.adapters.spi.HttpFacade; import org.keycloak.adapters.KeycloakDeployment; import org.keycloak.adapters.OidcKeycloakAccount; import org.keycloak.adapters.RefreshableKeycloakSecurityContext; import org.keycloak.adapters.RequestAuthenticator; +import org.keycloak.adapters.spi.HttpFacade; + +import java.util.Set; +import java.util.logging.Logger; /** * @author Marek Posolda diff --git a/adapters/oidc/tomcat/tomcat-core/src/main/java/org/keycloak/adapters/tomcat/CatalinaRequestAuthenticator.java b/adapters/oidc/tomcat/tomcat-core/src/main/java/org/keycloak/adapters/tomcat/CatalinaRequestAuthenticator.java index d85d8f3aa8..cbb69bd8c3 100755 --- a/adapters/oidc/tomcat/tomcat-core/src/main/java/org/keycloak/adapters/tomcat/CatalinaRequestAuthenticator.java +++ b/adapters/oidc/tomcat/tomcat-core/src/main/java/org/keycloak/adapters/tomcat/CatalinaRequestAuthenticator.java @@ -28,13 +28,12 @@ import org.keycloak.adapters.OidcKeycloakAccount; import org.keycloak.adapters.RefreshableKeycloakSecurityContext; import org.keycloak.adapters.RequestAuthenticator; +import javax.servlet.http.HttpSession; import java.security.Principal; import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; -import javax.servlet.http.HttpSession; - /** * @author Davide Ungari * @version $Revision: 1 $ diff --git a/adapters/oidc/tomcat/tomcat6/src/main/java/org/keycloak/adapters/tomcat/KeycloakAuthenticatorValve.java b/adapters/oidc/tomcat/tomcat6/src/main/java/org/keycloak/adapters/tomcat/KeycloakAuthenticatorValve.java index 22c8da00f3..b9f4ab8323 100755 --- a/adapters/oidc/tomcat/tomcat6/src/main/java/org/keycloak/adapters/tomcat/KeycloakAuthenticatorValve.java +++ b/adapters/oidc/tomcat/tomcat6/src/main/java/org/keycloak/adapters/tomcat/KeycloakAuthenticatorValve.java @@ -23,8 +23,6 @@ import org.apache.catalina.connector.Response; import org.apache.catalina.core.StandardContext; import org.apache.catalina.deploy.LoginConfig; import org.apache.catalina.realm.GenericPrincipal; -import org.keycloak.adapters.AdapterTokenStore; -import org.keycloak.adapters.KeycloakDeployment; import javax.servlet.ServletException; import javax.servlet.http.HttpServletResponse; diff --git a/adapters/oidc/tomcat/tomcat7/src/main/java/org/keycloak/adapters/tomcat/KeycloakAuthenticatorValve.java b/adapters/oidc/tomcat/tomcat7/src/main/java/org/keycloak/adapters/tomcat/KeycloakAuthenticatorValve.java index bd2967c1d5..18195e354a 100755 --- a/adapters/oidc/tomcat/tomcat7/src/main/java/org/keycloak/adapters/tomcat/KeycloakAuthenticatorValve.java +++ b/adapters/oidc/tomcat/tomcat7/src/main/java/org/keycloak/adapters/tomcat/KeycloakAuthenticatorValve.java @@ -22,8 +22,6 @@ import org.apache.catalina.connector.Response; import org.apache.catalina.core.StandardContext; import org.apache.catalina.deploy.LoginConfig; import org.apache.catalina.realm.GenericPrincipal; -import org.keycloak.adapters.AdapterTokenStore; -import org.keycloak.adapters.KeycloakDeployment; import javax.servlet.ServletException; import javax.servlet.http.HttpServletResponse; diff --git a/adapters/oidc/tomcat/tomcat8/src/main/java/org/keycloak/adapters/tomcat/KeycloakAuthenticatorValve.java b/adapters/oidc/tomcat/tomcat8/src/main/java/org/keycloak/adapters/tomcat/KeycloakAuthenticatorValve.java index 248327174f..6a68dd3b8b 100755 --- a/adapters/oidc/tomcat/tomcat8/src/main/java/org/keycloak/adapters/tomcat/KeycloakAuthenticatorValve.java +++ b/adapters/oidc/tomcat/tomcat8/src/main/java/org/keycloak/adapters/tomcat/KeycloakAuthenticatorValve.java @@ -19,20 +19,15 @@ package org.keycloak.adapters.tomcat; import org.apache.catalina.authenticator.FormAuthenticator; import org.apache.catalina.connector.Request; -import org.apache.catalina.connector.Response; import org.apache.catalina.core.StandardContext; import org.apache.catalina.realm.GenericPrincipal; -import org.apache.tomcat.util.ExceptionUtils; import org.apache.tomcat.util.descriptor.web.LoginConfig; import org.keycloak.adapters.AdapterTokenStore; import org.keycloak.adapters.KeycloakDeployment; import org.keycloak.adapters.spi.HttpFacade; -import javax.servlet.RequestDispatcher; -import javax.servlet.ServletException; import javax.servlet.http.HttpServletResponse; import java.io.IOException; -import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.security.Principal; import java.util.List; diff --git a/adapters/oidc/undertow/src/main/java/org/keycloak/adapters/undertow/AbstractUndertowKeycloakAuthMech.java b/adapters/oidc/undertow/src/main/java/org/keycloak/adapters/undertow/AbstractUndertowKeycloakAuthMech.java index d8c9b13d4b..e65d9226f0 100755 --- a/adapters/oidc/undertow/src/main/java/org/keycloak/adapters/undertow/AbstractUndertowKeycloakAuthMech.java +++ b/adapters/oidc/undertow/src/main/java/org/keycloak/adapters/undertow/AbstractUndertowKeycloakAuthMech.java @@ -27,12 +27,12 @@ import io.undertow.util.StatusCodes; import org.keycloak.KeycloakSecurityContext; import org.keycloak.adapters.AdapterDeploymentContext; import org.keycloak.adapters.AdapterTokenStore; -import org.keycloak.adapters.spi.AuthChallenge; -import org.keycloak.adapters.spi.AuthOutcome; -import org.keycloak.adapters.spi.HttpFacade; import org.keycloak.adapters.KeycloakDeployment; import org.keycloak.adapters.RefreshableKeycloakSecurityContext; import org.keycloak.adapters.RequestAuthenticator; +import org.keycloak.adapters.spi.AuthChallenge; +import org.keycloak.adapters.spi.AuthOutcome; +import org.keycloak.adapters.spi.HttpFacade; import org.keycloak.enums.TokenStore; /** diff --git a/adapters/oidc/undertow/src/main/java/org/keycloak/adapters/undertow/AbstractUndertowRequestAuthenticator.java b/adapters/oidc/undertow/src/main/java/org/keycloak/adapters/undertow/AbstractUndertowRequestAuthenticator.java index 9c4296cedd..8e2da9388b 100755 --- a/adapters/oidc/undertow/src/main/java/org/keycloak/adapters/undertow/AbstractUndertowRequestAuthenticator.java +++ b/adapters/oidc/undertow/src/main/java/org/keycloak/adapters/undertow/AbstractUndertowRequestAuthenticator.java @@ -20,14 +20,13 @@ import io.undertow.security.api.SecurityContext; import io.undertow.server.HttpServerExchange; import io.undertow.server.session.Session; import io.undertow.util.Sessions; - import org.keycloak.KeycloakPrincipal; import org.keycloak.adapters.AdapterTokenStore; -import org.keycloak.adapters.spi.HttpFacade; import org.keycloak.adapters.KeycloakDeployment; import org.keycloak.adapters.OAuthRequestAuthenticator; import org.keycloak.adapters.RefreshableKeycloakSecurityContext; import org.keycloak.adapters.RequestAuthenticator; +import org.keycloak.adapters.spi.HttpFacade; /** * @author Bill Burke diff --git a/adapters/oidc/undertow/src/main/java/org/keycloak/adapters/undertow/ServletKeycloakAuthMech.java b/adapters/oidc/undertow/src/main/java/org/keycloak/adapters/undertow/ServletKeycloakAuthMech.java index ab14cf3e53..6e076568e4 100755 --- a/adapters/oidc/undertow/src/main/java/org/keycloak/adapters/undertow/ServletKeycloakAuthMech.java +++ b/adapters/oidc/undertow/src/main/java/org/keycloak/adapters/undertow/ServletKeycloakAuthMech.java @@ -24,10 +24,10 @@ import io.undertow.util.Headers; import org.jboss.logging.Logger; import org.keycloak.adapters.AdapterDeploymentContext; import org.keycloak.adapters.AdapterTokenStore; -import org.keycloak.adapters.spi.HttpFacade; import org.keycloak.adapters.KeycloakDeployment; import org.keycloak.adapters.NodesRegistrationManagement; import org.keycloak.adapters.RequestAuthenticator; +import org.keycloak.adapters.spi.HttpFacade; import org.keycloak.enums.TokenStore; import javax.servlet.RequestDispatcher; diff --git a/adapters/oidc/undertow/src/main/java/org/keycloak/adapters/undertow/ServletRequestAuthenticator.java b/adapters/oidc/undertow/src/main/java/org/keycloak/adapters/undertow/ServletRequestAuthenticator.java index 716e346102..7f23b3bbd7 100755 --- a/adapters/oidc/undertow/src/main/java/org/keycloak/adapters/undertow/ServletRequestAuthenticator.java +++ b/adapters/oidc/undertow/src/main/java/org/keycloak/adapters/undertow/ServletRequestAuthenticator.java @@ -22,10 +22,10 @@ import io.undertow.servlet.handlers.ServletRequestContext; import org.keycloak.KeycloakPrincipal; import org.keycloak.KeycloakSecurityContext; import org.keycloak.adapters.AdapterTokenStore; -import org.keycloak.adapters.spi.HttpFacade; import org.keycloak.adapters.KeycloakDeployment; import org.keycloak.adapters.OAuthRequestAuthenticator; import org.keycloak.adapters.RefreshableKeycloakSecurityContext; +import org.keycloak.adapters.spi.HttpFacade; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; diff --git a/adapters/oidc/undertow/src/main/java/org/keycloak/adapters/undertow/ServletSessionTokenStore.java b/adapters/oidc/undertow/src/main/java/org/keycloak/adapters/undertow/ServletSessionTokenStore.java index 5db3eadca3..ef6081a21a 100755 --- a/adapters/oidc/undertow/src/main/java/org/keycloak/adapters/undertow/ServletSessionTokenStore.java +++ b/adapters/oidc/undertow/src/main/java/org/keycloak/adapters/undertow/ServletSessionTokenStore.java @@ -17,9 +17,6 @@ package org.keycloak.adapters.undertow; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; - import io.undertow.security.api.SecurityContext; import io.undertow.server.HttpServerExchange; import io.undertow.servlet.handlers.ServletRequestContext; @@ -31,6 +28,9 @@ import org.keycloak.adapters.OidcKeycloakAccount; import org.keycloak.adapters.RefreshableKeycloakSecurityContext; import org.keycloak.adapters.RequestAuthenticator; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; + /** * Per-request object. Storage of tokens in servlet HTTP session. * diff --git a/adapters/oidc/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowCookieTokenStore.java b/adapters/oidc/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowCookieTokenStore.java index a585d8d912..d3556c8a53 100755 --- a/adapters/oidc/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowCookieTokenStore.java +++ b/adapters/oidc/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowCookieTokenStore.java @@ -22,11 +22,11 @@ import org.jboss.logging.Logger; import org.keycloak.KeycloakPrincipal; import org.keycloak.adapters.AdapterTokenStore; import org.keycloak.adapters.CookieTokenStore; -import org.keycloak.adapters.spi.HttpFacade; import org.keycloak.adapters.KeycloakDeployment; import org.keycloak.adapters.OidcKeycloakAccount; import org.keycloak.adapters.RefreshableKeycloakSecurityContext; import org.keycloak.adapters.RequestAuthenticator; +import org.keycloak.adapters.spi.HttpFacade; /** * Per-request object. Storage of tokens in cookie diff --git a/adapters/oidc/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowNodesRegistrationManagementWrapper.java b/adapters/oidc/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowNodesRegistrationManagementWrapper.java index 4532a08a44..6978ea5493 100644 --- a/adapters/oidc/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowNodesRegistrationManagementWrapper.java +++ b/adapters/oidc/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowNodesRegistrationManagementWrapper.java @@ -17,11 +17,11 @@ package org.keycloak.adapters.undertow; +import org.keycloak.adapters.NodesRegistrationManagement; + import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; -import org.keycloak.adapters.NodesRegistrationManagement; - /** * @author Marek Posolda */ diff --git a/adapters/oidc/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowRequestAuthenticator.java b/adapters/oidc/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowRequestAuthenticator.java index 7e2da666e3..26f3583783 100755 --- a/adapters/oidc/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowRequestAuthenticator.java +++ b/adapters/oidc/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowRequestAuthenticator.java @@ -21,9 +21,9 @@ import io.undertow.security.api.SecurityContext; import io.undertow.server.HttpServerExchange; import org.keycloak.KeycloakPrincipal; import org.keycloak.adapters.AdapterTokenStore; -import org.keycloak.adapters.spi.HttpFacade; import org.keycloak.adapters.KeycloakDeployment; import org.keycloak.adapters.RefreshableKeycloakSecurityContext; +import org.keycloak.adapters.spi.HttpFacade; /** * @author Bill Burke diff --git a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakAdapterConfigService.java b/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakAdapterConfigService.java index 5d15b70aaf..5978361e6b 100755 --- a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakAdapterConfigService.java +++ b/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakAdapterConfigService.java @@ -17,16 +17,16 @@ package org.keycloak.subsystem.wf8.extension; +import org.jboss.as.server.deployment.DeploymentUnit; +import org.jboss.as.web.common.WarMetaData; import org.jboss.dmr.ModelNode; import org.jboss.dmr.Property; +import org.jboss.metadata.web.jboss.JBossWebMetaData; import java.util.HashMap; import java.util.Map; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADDRESS; -import org.jboss.as.server.deployment.DeploymentUnit; -import org.jboss.as.web.common.WarMetaData; -import org.jboss.metadata.web.jboss.JBossWebMetaData; /** * This service keeps track of the entire Keycloak management model so as to provide diff --git a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakExtension.java b/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakExtension.java index 572e5a1009..b1959103c1 100755 --- a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakExtension.java +++ b/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakExtension.java @@ -18,7 +18,6 @@ package org.keycloak.subsystem.wf8.extension; import org.jboss.as.controller.Extension; import org.jboss.as.controller.ExtensionContext; -import org.jboss.as.controller.ModelVersion; import org.jboss.as.controller.PathElement; import org.jboss.as.controller.ResourceDefinition; import org.jboss.as.controller.SubsystemRegistration; diff --git a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakSubsystemAdd.java b/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakSubsystemAdd.java index 52994f461d..1f895a05e4 100755 --- a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakSubsystemAdd.java +++ b/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakSubsystemAdd.java @@ -22,10 +22,9 @@ import org.jboss.as.controller.OperationContext; import org.jboss.as.controller.ServiceVerificationHandler; import org.jboss.as.server.AbstractDeploymentChainStep; import org.jboss.as.server.DeploymentProcessorTarget; +import org.jboss.as.server.deployment.DeploymentUnitProcessor; import org.jboss.as.server.deployment.Phase; import org.jboss.dmr.ModelNode; - -import org.jboss.as.server.deployment.DeploymentUnitProcessor; import org.jboss.msc.service.ServiceController; import java.util.List; diff --git a/adapters/oidc/wildfly/wildfly-adapter/src/main/java/org/keycloak/adapters/wildfly/WildflyRequestAuthenticator.java b/adapters/oidc/wildfly/wildfly-adapter/src/main/java/org/keycloak/adapters/wildfly/WildflyRequestAuthenticator.java index 1faa387ebd..c87b138081 100755 --- a/adapters/oidc/wildfly/wildfly-adapter/src/main/java/org/keycloak/adapters/wildfly/WildflyRequestAuthenticator.java +++ b/adapters/oidc/wildfly/wildfly-adapter/src/main/java/org/keycloak/adapters/wildfly/WildflyRequestAuthenticator.java @@ -26,8 +26,8 @@ import org.jboss.security.SecurityContextAssociation; import org.jboss.security.SimpleGroup; import org.jboss.security.SimplePrincipal; import org.keycloak.adapters.AdapterTokenStore; -import org.keycloak.adapters.spi.HttpFacade; import org.keycloak.adapters.KeycloakDeployment; +import org.keycloak.adapters.spi.HttpFacade; import org.keycloak.adapters.undertow.KeycloakUndertowAccount; import org.keycloak.adapters.undertow.ServletRequestAuthenticator; diff --git a/adapters/oidc/wildfly/wildfly-subsystem/src/main/java/org/keycloak/subsystem/adapter/extension/KeycloakAdapterConfigService.java b/adapters/oidc/wildfly/wildfly-subsystem/src/main/java/org/keycloak/subsystem/adapter/extension/KeycloakAdapterConfigService.java index 86c9e7e401..b9b3ce380e 100755 --- a/adapters/oidc/wildfly/wildfly-subsystem/src/main/java/org/keycloak/subsystem/adapter/extension/KeycloakAdapterConfigService.java +++ b/adapters/oidc/wildfly/wildfly-subsystem/src/main/java/org/keycloak/subsystem/adapter/extension/KeycloakAdapterConfigService.java @@ -17,16 +17,16 @@ package org.keycloak.subsystem.adapter.extension; +import org.jboss.as.server.deployment.DeploymentUnit; +import org.jboss.as.web.common.WarMetaData; import org.jboss.dmr.ModelNode; import org.jboss.dmr.Property; +import org.jboss.metadata.web.jboss.JBossWebMetaData; import java.util.HashMap; import java.util.Map; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADDRESS; -import org.jboss.as.server.deployment.DeploymentUnit; -import org.jboss.as.web.common.WarMetaData; -import org.jboss.metadata.web.jboss.JBossWebMetaData; /** * This service keeps track of the entire Keycloak management model so as to provide diff --git a/adapters/oidc/wildfly/wildfly-subsystem/src/main/java/org/keycloak/subsystem/adapter/extension/KeycloakSubsystemAdd.java b/adapters/oidc/wildfly/wildfly-subsystem/src/main/java/org/keycloak/subsystem/adapter/extension/KeycloakSubsystemAdd.java index 90ba4b942a..8fbee2bd58 100755 --- a/adapters/oidc/wildfly/wildfly-subsystem/src/main/java/org/keycloak/subsystem/adapter/extension/KeycloakSubsystemAdd.java +++ b/adapters/oidc/wildfly/wildfly-subsystem/src/main/java/org/keycloak/subsystem/adapter/extension/KeycloakSubsystemAdd.java @@ -21,11 +21,10 @@ import org.jboss.as.controller.AbstractBoottimeAddStepHandler; import org.jboss.as.controller.OperationContext; import org.jboss.as.server.AbstractDeploymentChainStep; import org.jboss.as.server.DeploymentProcessorTarget; +import org.jboss.as.server.deployment.DeploymentUnitProcessor; import org.jboss.as.server.deployment.Phase; import org.jboss.dmr.ModelNode; -import org.jboss.as.server.deployment.DeploymentUnitProcessor; - /** * The Keycloak subsystem add update handler. * diff --git a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeycloakSamlExtension.java b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeycloakSamlExtension.java index 93616b223e..3383587a08 100755 --- a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeycloakSamlExtension.java +++ b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeycloakSamlExtension.java @@ -20,7 +20,6 @@ import org.jboss.as.controller.Extension; import org.jboss.as.controller.ExtensionContext; import org.jboss.as.controller.ModelVersion; import org.jboss.as.controller.PathElement; -import org.jboss.as.controller.ResourceDefinition; import org.jboss.as.controller.SubsystemRegistration; import org.jboss.as.controller.descriptions.StandardResourceDescriptionResolver; import org.jboss.as.controller.parsing.ExtensionParsingContext; diff --git a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/xml/FormattingXMLStreamWriter.java b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/xml/FormattingXMLStreamWriter.java index af298e9b4b..0d566597b3 100644 --- a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/xml/FormattingXMLStreamWriter.java +++ b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/xml/FormattingXMLStreamWriter.java @@ -19,14 +19,13 @@ package org.keycloak.subsystem.saml.as7.xml; import org.jboss.staxmapper.XMLExtendedStreamWriter; -import java.lang.reflect.UndeclaredThrowableException; -import java.util.ArrayDeque; -import java.util.Iterator; - import javax.xml.namespace.NamespaceContext; import javax.xml.stream.XMLStreamConstants; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; +import java.lang.reflect.UndeclaredThrowableException; +import java.util.ArrayDeque; +import java.util.Iterator; /** * An XML stream writer which nicely formats the XML for configuration files. diff --git a/adapters/saml/core/src/main/java/org/keycloak/adapters/saml/DefaultSamlDeployment.java b/adapters/saml/core/src/main/java/org/keycloak/adapters/saml/DefaultSamlDeployment.java index 9e12f48e16..ee753ade11 100755 --- a/adapters/saml/core/src/main/java/org/keycloak/adapters/saml/DefaultSamlDeployment.java +++ b/adapters/saml/core/src/main/java/org/keycloak/adapters/saml/DefaultSamlDeployment.java @@ -17,14 +17,14 @@ package org.keycloak.adapters.saml; +import org.keycloak.common.enums.SslRequired; +import org.keycloak.saml.SignatureAlgorithm; + import java.security.KeyPair; import java.security.PrivateKey; import java.security.PublicKey; import java.util.Set; -import org.keycloak.common.enums.SslRequired; -import org.keycloak.saml.SignatureAlgorithm; - /** * @author Bill Burke * @version $Revision: 1 $ diff --git a/adapters/saml/core/src/main/java/org/keycloak/adapters/saml/config/IDP.java b/adapters/saml/core/src/main/java/org/keycloak/adapters/saml/config/IDP.java index 7502e5d03f..3960b464b3 100755 --- a/adapters/saml/core/src/main/java/org/keycloak/adapters/saml/config/IDP.java +++ b/adapters/saml/core/src/main/java/org/keycloak/adapters/saml/config/IDP.java @@ -17,8 +17,6 @@ package org.keycloak.adapters.saml.config; -import org.keycloak.adapters.saml.SamlDeployment; - import java.io.Serializable; import java.util.List; diff --git a/adapters/saml/core/src/main/java/org/keycloak/adapters/saml/config/parsers/DeploymentBuilder.java b/adapters/saml/core/src/main/java/org/keycloak/adapters/saml/config/parsers/DeploymentBuilder.java index e5a6ead98e..9dfc3e3629 100755 --- a/adapters/saml/core/src/main/java/org/keycloak/adapters/saml/config/parsers/DeploymentBuilder.java +++ b/adapters/saml/core/src/main/java/org/keycloak/adapters/saml/config/parsers/DeploymentBuilder.java @@ -23,9 +23,9 @@ import org.keycloak.adapters.saml.config.Key; import org.keycloak.adapters.saml.config.KeycloakSamlAdapter; import org.keycloak.adapters.saml.config.SP; import org.keycloak.common.enums.SslRequired; +import org.keycloak.common.util.PemUtils; import org.keycloak.saml.SignatureAlgorithm; import org.keycloak.saml.common.exceptions.ParsingException; -import org.keycloak.common.util.PemUtils; import java.io.File; import java.io.FileInputStream; diff --git a/adapters/saml/core/src/main/java/org/keycloak/adapters/saml/config/parsers/SPXmlParser.java b/adapters/saml/core/src/main/java/org/keycloak/adapters/saml/config/parsers/SPXmlParser.java index 0816c7343e..3eeb1f74c7 100755 --- a/adapters/saml/core/src/main/java/org/keycloak/adapters/saml/config/parsers/SPXmlParser.java +++ b/adapters/saml/core/src/main/java/org/keycloak/adapters/saml/config/parsers/SPXmlParser.java @@ -17,16 +17,6 @@ package org.keycloak.adapters.saml.config.parsers; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLEventReader; -import javax.xml.stream.events.EndElement; -import javax.xml.stream.events.StartElement; -import javax.xml.stream.events.XMLEvent; - import org.keycloak.adapters.saml.config.IDP; import org.keycloak.adapters.saml.config.Key; import org.keycloak.adapters.saml.config.SP; @@ -35,6 +25,15 @@ import org.keycloak.saml.common.exceptions.ParsingException; import org.keycloak.saml.common.parsers.AbstractParser; import org.keycloak.saml.common.util.StaxParserUtil; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLEventReader; +import javax.xml.stream.events.EndElement; +import javax.xml.stream.events.StartElement; +import javax.xml.stream.events.XMLEvent; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + /** * @author Bill Burke * @version $Revision: 1 $ diff --git a/adapters/saml/core/src/main/java/org/keycloak/adapters/saml/profile/SamlInvocationContext.java b/adapters/saml/core/src/main/java/org/keycloak/adapters/saml/profile/SamlInvocationContext.java index 9cfceee732..43c33dce53 100644 --- a/adapters/saml/core/src/main/java/org/keycloak/adapters/saml/profile/SamlInvocationContext.java +++ b/adapters/saml/core/src/main/java/org/keycloak/adapters/saml/profile/SamlInvocationContext.java @@ -17,10 +17,6 @@ package org.keycloak.adapters.saml.profile; -import org.keycloak.adapters.saml.SamlDeployment; -import org.keycloak.adapters.saml.SamlSessionStore; -import org.keycloak.adapters.spi.HttpFacade; - /** * @author Pedro Igor */ diff --git a/adapters/saml/core/src/test/java/org/keycloak/test/adapters/saml/XmlParserTest.java b/adapters/saml/core/src/test/java/org/keycloak/test/adapters/saml/XmlParserTest.java index 16a04c204f..ba01d7548c 100755 --- a/adapters/saml/core/src/test/java/org/keycloak/test/adapters/saml/XmlParserTest.java +++ b/adapters/saml/core/src/test/java/org/keycloak/test/adapters/saml/XmlParserTest.java @@ -27,8 +27,6 @@ import org.keycloak.adapters.saml.config.parsers.KeycloakSamlAdapterXMLParser; import org.keycloak.saml.common.util.StaxParserUtil; import javax.xml.XMLConstants; -import javax.xml.stream.XMLEventReader; -import javax.xml.transform.stax.StAXSource; import javax.xml.transform.stream.StreamSource; import javax.xml.validation.Schema; import javax.xml.validation.SchemaFactory; diff --git a/adapters/saml/jetty/jetty-core/src/main/java/org/keycloak/adapters/saml/jetty/AbstractSamlAuthenticator.java b/adapters/saml/jetty/jetty-core/src/main/java/org/keycloak/adapters/saml/jetty/AbstractSamlAuthenticator.java index 4ef67f81e6..ec2d1ab08b 100755 --- a/adapters/saml/jetty/jetty-core/src/main/java/org/keycloak/adapters/saml/jetty/AbstractSamlAuthenticator.java +++ b/adapters/saml/jetty/jetty-core/src/main/java/org/keycloak/adapters/saml/jetty/AbstractSamlAuthenticator.java @@ -30,7 +30,17 @@ import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.UserIdentity; import org.eclipse.jetty.server.handler.ContextHandler; import org.jboss.logging.Logger; +import org.keycloak.adapters.jetty.spi.JettyHttpFacade; +import org.keycloak.adapters.jetty.spi.JettyUserSessionManagement; +import org.keycloak.adapters.saml.AdapterConstants; +import org.keycloak.adapters.saml.SamlAuthenticator; +import org.keycloak.adapters.saml.SamlConfigResolver; +import org.keycloak.adapters.saml.SamlDeployment; +import org.keycloak.adapters.saml.SamlDeploymentContext; +import org.keycloak.adapters.saml.SamlSession; import org.keycloak.adapters.saml.SamlSessionStore; +import org.keycloak.adapters.saml.config.parsers.DeploymentBuilder; +import org.keycloak.adapters.saml.config.parsers.ResourceLoader; import org.keycloak.adapters.saml.profile.SamlAuthenticationHandler; import org.keycloak.adapters.saml.profile.webbrowsersso.BrowserHandler; import org.keycloak.adapters.saml.profile.webbrowsersso.SamlEndpoint; @@ -40,16 +50,6 @@ import org.keycloak.adapters.spi.AuthOutcome; import org.keycloak.adapters.spi.HttpFacade; import org.keycloak.adapters.spi.InMemorySessionIdMapper; import org.keycloak.adapters.spi.SessionIdMapper; -import org.keycloak.adapters.jetty.spi.JettyHttpFacade; -import org.keycloak.adapters.jetty.spi.JettyUserSessionManagement; -import org.keycloak.adapters.saml.AdapterConstants; -import org.keycloak.adapters.saml.SamlAuthenticator; -import org.keycloak.adapters.saml.SamlConfigResolver; -import org.keycloak.adapters.saml.SamlDeployment; -import org.keycloak.adapters.saml.SamlDeploymentContext; -import org.keycloak.adapters.saml.SamlSession; -import org.keycloak.adapters.saml.config.parsers.DeploymentBuilder; -import org.keycloak.adapters.saml.config.parsers.ResourceLoader; import org.keycloak.saml.common.exceptions.ParsingException; import javax.security.auth.Subject; diff --git a/adapters/saml/jetty/jetty-core/src/main/java/org/keycloak/adapters/saml/jetty/JettySamlSessionStore.java b/adapters/saml/jetty/jetty-core/src/main/java/org/keycloak/adapters/saml/jetty/JettySamlSessionStore.java index 1ccfc671bc..0a96e6401e 100755 --- a/adapters/saml/jetty/jetty-core/src/main/java/org/keycloak/adapters/saml/jetty/JettySamlSessionStore.java +++ b/adapters/saml/jetty/jetty-core/src/main/java/org/keycloak/adapters/saml/jetty/JettySamlSessionStore.java @@ -19,18 +19,17 @@ package org.keycloak.adapters.saml.jetty; import org.eclipse.jetty.server.Request; import org.jboss.logging.Logger; +import org.keycloak.adapters.jetty.spi.JettyUserSessionManagement; import org.keycloak.adapters.saml.SamlDeployment; +import org.keycloak.adapters.saml.SamlSession; +import org.keycloak.adapters.saml.SamlSessionStore; import org.keycloak.adapters.saml.SamlUtil; import org.keycloak.adapters.spi.AdapterSessionStore; import org.keycloak.adapters.spi.HttpFacade; import org.keycloak.adapters.spi.SessionIdMapper; -import org.keycloak.adapters.jetty.spi.JettyUserSessionManagement; -import org.keycloak.adapters.saml.SamlSession; -import org.keycloak.adapters.saml.SamlSessionStore; import org.keycloak.common.util.KeycloakUriBuilder; import javax.servlet.http.HttpSession; - import java.util.LinkedList; import java.util.List; import java.util.Set; diff --git a/adapters/saml/jetty/jetty8.1/src/main/java/org/keycloak/adapters/saml/jetty/JettyAdapterSessionStore.java b/adapters/saml/jetty/jetty8.1/src/main/java/org/keycloak/adapters/saml/jetty/JettyAdapterSessionStore.java index 49d6600cc2..c93a1ae5fa 100755 --- a/adapters/saml/jetty/jetty8.1/src/main/java/org/keycloak/adapters/saml/jetty/JettyAdapterSessionStore.java +++ b/adapters/saml/jetty/jetty8.1/src/main/java/org/keycloak/adapters/saml/jetty/JettyAdapterSessionStore.java @@ -20,8 +20,8 @@ package org.keycloak.adapters.saml.jetty; import org.eclipse.jetty.security.authentication.FormAuthenticator; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.util.MultiMap; -import org.keycloak.adapters.spi.AdapterSessionStore; import org.keycloak.adapters.jetty.spi.JettyHttpFacade; +import org.keycloak.adapters.spi.AdapterSessionStore; import org.keycloak.common.util.MultivaluedHashMap; import javax.servlet.http.HttpSession; diff --git a/adapters/saml/jetty/jetty8.1/src/main/java/org/keycloak/adapters/saml/jetty/KeycloakSamlAuthenticator.java b/adapters/saml/jetty/jetty8.1/src/main/java/org/keycloak/adapters/saml/jetty/KeycloakSamlAuthenticator.java index 870f986fd1..85aaecffd1 100755 --- a/adapters/saml/jetty/jetty8.1/src/main/java/org/keycloak/adapters/saml/jetty/KeycloakSamlAuthenticator.java +++ b/adapters/saml/jetty/jetty8.1/src/main/java/org/keycloak/adapters/saml/jetty/KeycloakSamlAuthenticator.java @@ -17,13 +17,12 @@ package org.keycloak.adapters.saml.jetty; -import org.bouncycastle.cert.ocsp.Req; import org.eclipse.jetty.server.AbstractHttpConnection; import org.eclipse.jetty.server.Authentication; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.UserIdentity; -import org.keycloak.adapters.spi.AdapterSessionStore; import org.keycloak.adapters.saml.SamlDeployment; +import org.keycloak.adapters.spi.AdapterSessionStore; import javax.servlet.ServletRequest; diff --git a/adapters/saml/jetty/jetty9.1/src/main/java/org/keycloak/adapters/saml/jetty/JettyAdapterSessionStore.java b/adapters/saml/jetty/jetty9.1/src/main/java/org/keycloak/adapters/saml/jetty/JettyAdapterSessionStore.java index 2dc254b27c..13f82f7608 100755 --- a/adapters/saml/jetty/jetty9.1/src/main/java/org/keycloak/adapters/saml/jetty/JettyAdapterSessionStore.java +++ b/adapters/saml/jetty/jetty9.1/src/main/java/org/keycloak/adapters/saml/jetty/JettyAdapterSessionStore.java @@ -21,8 +21,8 @@ import org.eclipse.jetty.http.HttpMethod; import org.eclipse.jetty.security.authentication.FormAuthenticator; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.util.MultiMap; -import org.keycloak.adapters.spi.AdapterSessionStore; import org.keycloak.adapters.jetty.spi.JettyHttpFacade; +import org.keycloak.adapters.spi.AdapterSessionStore; import org.keycloak.common.util.MultivaluedHashMap; import javax.servlet.http.HttpSession; diff --git a/adapters/saml/jetty/jetty9.1/src/main/java/org/keycloak/adapters/saml/jetty/KeycloakSamlAuthenticator.java b/adapters/saml/jetty/jetty9.1/src/main/java/org/keycloak/adapters/saml/jetty/KeycloakSamlAuthenticator.java index 8696801f9b..bb56306b5d 100755 --- a/adapters/saml/jetty/jetty9.1/src/main/java/org/keycloak/adapters/saml/jetty/KeycloakSamlAuthenticator.java +++ b/adapters/saml/jetty/jetty9.1/src/main/java/org/keycloak/adapters/saml/jetty/KeycloakSamlAuthenticator.java @@ -17,14 +17,13 @@ package org.keycloak.adapters.saml.jetty; -import org.bouncycastle.cert.ocsp.Req; import org.eclipse.jetty.server.Authentication; import org.eclipse.jetty.server.HttpChannel; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.UserIdentity; import org.keycloak.adapters.jetty.spi.JettyUserSessionManagement; -import org.keycloak.adapters.spi.AdapterSessionStore; import org.keycloak.adapters.saml.SamlDeployment; +import org.keycloak.adapters.spi.AdapterSessionStore; import org.keycloak.adapters.spi.HttpFacade; import javax.servlet.ServletRequest; diff --git a/adapters/saml/jetty/jetty9.2/src/main/java/org/keycloak/adapters/saml/jetty/JettyAdapterSessionStore.java b/adapters/saml/jetty/jetty9.2/src/main/java/org/keycloak/adapters/saml/jetty/JettyAdapterSessionStore.java index cd50fbf82e..8fe7b0152c 100755 --- a/adapters/saml/jetty/jetty9.2/src/main/java/org/keycloak/adapters/saml/jetty/JettyAdapterSessionStore.java +++ b/adapters/saml/jetty/jetty9.2/src/main/java/org/keycloak/adapters/saml/jetty/JettyAdapterSessionStore.java @@ -21,8 +21,8 @@ import org.eclipse.jetty.http.HttpMethod; import org.eclipse.jetty.security.authentication.FormAuthenticator; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.util.MultiMap; -import org.keycloak.adapters.spi.AdapterSessionStore; import org.keycloak.adapters.jetty.spi.JettyHttpFacade; +import org.keycloak.adapters.spi.AdapterSessionStore; import org.keycloak.common.util.MultivaluedHashMap; import javax.servlet.http.HttpSession; diff --git a/adapters/saml/jetty/jetty9.2/src/main/java/org/keycloak/adapters/saml/jetty/KeycloakSamlAuthenticator.java b/adapters/saml/jetty/jetty9.2/src/main/java/org/keycloak/adapters/saml/jetty/KeycloakSamlAuthenticator.java index 3491ab29aa..4f79b35711 100755 --- a/adapters/saml/jetty/jetty9.2/src/main/java/org/keycloak/adapters/saml/jetty/KeycloakSamlAuthenticator.java +++ b/adapters/saml/jetty/jetty9.2/src/main/java/org/keycloak/adapters/saml/jetty/KeycloakSamlAuthenticator.java @@ -22,8 +22,8 @@ import org.eclipse.jetty.server.HttpChannel; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.UserIdentity; import org.keycloak.adapters.jetty.spi.JettyUserSessionManagement; -import org.keycloak.adapters.spi.AdapterSessionStore; import org.keycloak.adapters.saml.SamlDeployment; +import org.keycloak.adapters.spi.AdapterSessionStore; import org.keycloak.adapters.spi.HttpFacade; import javax.servlet.ServletRequest; diff --git a/adapters/saml/jetty/jetty9.3/src/main/java/org/keycloak/adapters/saml/jetty/JettyAdapterSessionStore.java b/adapters/saml/jetty/jetty9.3/src/main/java/org/keycloak/adapters/saml/jetty/JettyAdapterSessionStore.java index 22590865dc..17246056c6 100644 --- a/adapters/saml/jetty/jetty9.3/src/main/java/org/keycloak/adapters/saml/jetty/JettyAdapterSessionStore.java +++ b/adapters/saml/jetty/jetty9.3/src/main/java/org/keycloak/adapters/saml/jetty/JettyAdapterSessionStore.java @@ -17,12 +17,11 @@ package org.keycloak.adapters.saml.jetty; -import org.eclipse.jetty.http.HttpMethod; import org.eclipse.jetty.security.authentication.FormAuthenticator; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.util.MultiMap; -import org.keycloak.adapters.spi.AdapterSessionStore; import org.keycloak.adapters.jetty.spi.JettyHttpFacade; +import org.keycloak.adapters.spi.AdapterSessionStore; import org.keycloak.common.util.MultivaluedHashMap; import javax.servlet.http.HttpSession; diff --git a/adapters/saml/jetty/jetty9.3/src/main/java/org/keycloak/adapters/saml/jetty/KeycloakSamlAuthenticator.java b/adapters/saml/jetty/jetty9.3/src/main/java/org/keycloak/adapters/saml/jetty/KeycloakSamlAuthenticator.java index 0d4268fc99..91d320c918 100644 --- a/adapters/saml/jetty/jetty9.3/src/main/java/org/keycloak/adapters/saml/jetty/KeycloakSamlAuthenticator.java +++ b/adapters/saml/jetty/jetty9.3/src/main/java/org/keycloak/adapters/saml/jetty/KeycloakSamlAuthenticator.java @@ -18,12 +18,11 @@ package org.keycloak.adapters.saml.jetty; import org.eclipse.jetty.server.Authentication; -import org.eclipse.jetty.server.HttpChannel; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.UserIdentity; import org.keycloak.adapters.jetty.spi.JettyUserSessionManagement; -import org.keycloak.adapters.spi.AdapterSessionStore; import org.keycloak.adapters.saml.SamlDeployment; +import org.keycloak.adapters.spi.AdapterSessionStore; import org.keycloak.adapters.spi.HttpFacade; import javax.servlet.ServletRequest; diff --git a/adapters/saml/servlet-filter/src/main/java/org/keycloak/adapters/saml/servlet/FilterSamlSessionStore.java b/adapters/saml/servlet-filter/src/main/java/org/keycloak/adapters/saml/servlet/FilterSamlSessionStore.java index 3d6d6e3125..ee24c88cf5 100755 --- a/adapters/saml/servlet-filter/src/main/java/org/keycloak/adapters/saml/servlet/FilterSamlSessionStore.java +++ b/adapters/saml/servlet-filter/src/main/java/org/keycloak/adapters/saml/servlet/FilterSamlSessionStore.java @@ -18,19 +18,18 @@ package org.keycloak.adapters.saml.servlet; import org.jboss.logging.Logger; +import org.keycloak.adapters.saml.SamlSession; +import org.keycloak.adapters.saml.SamlSessionStore; import org.keycloak.adapters.saml.SamlUtil; +import org.keycloak.adapters.servlet.FilterSessionStore; import org.keycloak.adapters.spi.HttpFacade; import org.keycloak.adapters.spi.KeycloakAccount; import org.keycloak.adapters.spi.SessionIdMapper; -import org.keycloak.adapters.saml.SamlSession; -import org.keycloak.adapters.saml.SamlSessionStore; -import org.keycloak.adapters.servlet.FilterSessionStore; import org.keycloak.common.util.KeycloakUriBuilder; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequestWrapper; import javax.servlet.http.HttpSession; - import java.util.LinkedList; import java.util.List; import java.util.Set; diff --git a/adapters/saml/servlet-filter/src/main/java/org/keycloak/adapters/saml/servlet/SamlFilter.java b/adapters/saml/servlet-filter/src/main/java/org/keycloak/adapters/saml/servlet/SamlFilter.java index 8bd7389395..5747de01b7 100755 --- a/adapters/saml/servlet-filter/src/main/java/org/keycloak/adapters/saml/servlet/SamlFilter.java +++ b/adapters/saml/servlet-filter/src/main/java/org/keycloak/adapters/saml/servlet/SamlFilter.java @@ -17,24 +17,6 @@ package org.keycloak.adapters.saml.servlet; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.util.logging.Level; -import java.util.logging.Logger; - -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.RequestDispatcher; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletRequestWrapper; -import javax.servlet.http.HttpServletResponse; - import org.keycloak.adapters.saml.DefaultSamlDeployment; import org.keycloak.adapters.saml.SamlAuthenticator; import org.keycloak.adapters.saml.SamlDeployment; @@ -54,6 +36,23 @@ import org.keycloak.adapters.spi.InMemorySessionIdMapper; import org.keycloak.adapters.spi.SessionIdMapper; import org.keycloak.saml.common.exceptions.ParsingException; +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletRequestWrapper; +import javax.servlet.http.HttpServletResponse; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.logging.Level; +import java.util.logging.Logger; + /** * @author Bill Burke * @version $Revision: 1 $ diff --git a/adapters/saml/tomcat/tomcat-core/src/main/java/org/keycloak/adapters/saml/AbstractSamlAuthenticatorValve.java b/adapters/saml/tomcat/tomcat-core/src/main/java/org/keycloak/adapters/saml/AbstractSamlAuthenticatorValve.java index aa75439d11..eb6b9cce88 100755 --- a/adapters/saml/tomcat/tomcat-core/src/main/java/org/keycloak/adapters/saml/AbstractSamlAuthenticatorValve.java +++ b/adapters/saml/tomcat/tomcat-core/src/main/java/org/keycloak/adapters/saml/AbstractSamlAuthenticatorValve.java @@ -24,13 +24,13 @@ import org.apache.catalina.LifecycleListener; import org.apache.catalina.authenticator.FormAuthenticator; import org.apache.catalina.connector.Request; import org.apache.catalina.connector.Response; +import org.keycloak.adapters.saml.config.parsers.DeploymentBuilder; +import org.keycloak.adapters.saml.config.parsers.ResourceLoader; import org.keycloak.adapters.spi.AuthChallenge; import org.keycloak.adapters.spi.AuthOutcome; import org.keycloak.adapters.spi.HttpFacade; import org.keycloak.adapters.spi.InMemorySessionIdMapper; import org.keycloak.adapters.spi.SessionIdMapper; -import org.keycloak.adapters.saml.config.parsers.DeploymentBuilder; -import org.keycloak.adapters.saml.config.parsers.ResourceLoader; import org.keycloak.adapters.tomcat.CatalinaHttpFacade; import org.keycloak.adapters.tomcat.CatalinaUserSessionManagement; import org.keycloak.adapters.tomcat.GenericPrincipalFactory; diff --git a/adapters/saml/tomcat/tomcat-core/src/main/java/org/keycloak/adapters/saml/CatalinaSamlEndpoint.java b/adapters/saml/tomcat/tomcat-core/src/main/java/org/keycloak/adapters/saml/CatalinaSamlEndpoint.java index af12fbdcd0..36c94a2cf6 100755 --- a/adapters/saml/tomcat/tomcat-core/src/main/java/org/keycloak/adapters/saml/CatalinaSamlEndpoint.java +++ b/adapters/saml/tomcat/tomcat-core/src/main/java/org/keycloak/adapters/saml/CatalinaSamlEndpoint.java @@ -18,7 +18,6 @@ package org.keycloak.adapters.saml; import org.keycloak.adapters.saml.profile.SamlAuthenticationHandler; -import org.keycloak.adapters.saml.profile.webbrowsersso.BrowserHandler; import org.keycloak.adapters.saml.profile.webbrowsersso.SamlEndpoint; import org.keycloak.adapters.spi.HttpFacade; diff --git a/adapters/saml/tomcat/tomcat8/src/main/java/org/keycloak/adapters/saml/tomcat/SamlAuthenticatorValve.java b/adapters/saml/tomcat/tomcat8/src/main/java/org/keycloak/adapters/saml/tomcat/SamlAuthenticatorValve.java index 5d221e69fd..eef8c6a0ba 100755 --- a/adapters/saml/tomcat/tomcat8/src/main/java/org/keycloak/adapters/saml/tomcat/SamlAuthenticatorValve.java +++ b/adapters/saml/tomcat/tomcat8/src/main/java/org/keycloak/adapters/saml/tomcat/SamlAuthenticatorValve.java @@ -23,7 +23,6 @@ import org.apache.catalina.core.StandardContext; import org.apache.catalina.realm.GenericPrincipal; import org.apache.tomcat.util.descriptor.web.LoginConfig; import org.keycloak.adapters.saml.AbstractSamlAuthenticatorValve; -import org.keycloak.adapters.saml.CatalinaSamlSessionStore; import org.keycloak.adapters.saml.SamlDeployment; import org.keycloak.adapters.saml.SamlSessionStore; import org.keycloak.adapters.spi.HttpFacade; diff --git a/adapters/saml/undertow/src/main/java/org/keycloak/adapters/saml/undertow/AbstractSamlAuthMech.java b/adapters/saml/undertow/src/main/java/org/keycloak/adapters/saml/undertow/AbstractSamlAuthMech.java index c447af2f2a..614a83957e 100755 --- a/adapters/saml/undertow/src/main/java/org/keycloak/adapters/saml/undertow/AbstractSamlAuthMech.java +++ b/adapters/saml/undertow/src/main/java/org/keycloak/adapters/saml/undertow/AbstractSamlAuthMech.java @@ -16,6 +16,14 @@ */ package org.keycloak.adapters.saml.undertow; +import io.undertow.security.api.AuthenticationMechanism; +import io.undertow.security.api.NotificationReceiver; +import io.undertow.security.api.SecurityContext; +import io.undertow.security.api.SecurityNotification; +import io.undertow.server.HttpServerExchange; +import io.undertow.util.AttachmentKey; +import io.undertow.util.Headers; +import io.undertow.util.StatusCodes; import org.keycloak.adapters.saml.SamlAuthenticator; import org.keycloak.adapters.saml.SamlDeployment; import org.keycloak.adapters.saml.SamlDeploymentContext; @@ -26,15 +34,6 @@ import org.keycloak.adapters.spi.HttpFacade; import org.keycloak.adapters.undertow.UndertowHttpFacade; import org.keycloak.adapters.undertow.UndertowUserSessionManagement; -import io.undertow.security.api.AuthenticationMechanism; -import io.undertow.security.api.NotificationReceiver; -import io.undertow.security.api.SecurityContext; -import io.undertow.security.api.SecurityNotification; -import io.undertow.server.HttpServerExchange; -import io.undertow.util.AttachmentKey; -import io.undertow.util.Headers; -import io.undertow.util.StatusCodes; - /** * Abstract base class for a Keycloak-enabled Undertow AuthenticationMechanism. * diff --git a/adapters/saml/undertow/src/main/java/org/keycloak/adapters/saml/undertow/ServletSamlAuthMech.java b/adapters/saml/undertow/src/main/java/org/keycloak/adapters/saml/undertow/ServletSamlAuthMech.java index 7d3f4875c5..88181712d8 100755 --- a/adapters/saml/undertow/src/main/java/org/keycloak/adapters/saml/undertow/ServletSamlAuthMech.java +++ b/adapters/saml/undertow/src/main/java/org/keycloak/adapters/saml/undertow/ServletSamlAuthMech.java @@ -21,12 +21,12 @@ import io.undertow.security.api.SecurityContext; import io.undertow.server.HttpServerExchange; import io.undertow.servlet.handlers.ServletRequestContext; import io.undertow.util.Headers; -import org.keycloak.adapters.spi.HttpFacade; -import org.keycloak.adapters.spi.InMemorySessionIdMapper; -import org.keycloak.adapters.spi.SessionIdMapper; import org.keycloak.adapters.saml.SamlDeployment; import org.keycloak.adapters.saml.SamlDeploymentContext; import org.keycloak.adapters.saml.SamlSessionStore; +import org.keycloak.adapters.spi.HttpFacade; +import org.keycloak.adapters.spi.InMemorySessionIdMapper; +import org.keycloak.adapters.spi.SessionIdMapper; import org.keycloak.adapters.undertow.ServletHttpFacade; import org.keycloak.adapters.undertow.UndertowHttpFacade; import org.keycloak.adapters.undertow.UndertowUserSessionManagement; diff --git a/adapters/saml/undertow/src/main/java/org/keycloak/adapters/saml/undertow/ServletSamlSessionStore.java b/adapters/saml/undertow/src/main/java/org/keycloak/adapters/saml/undertow/ServletSamlSessionStore.java index 76e6452be4..72acda50a9 100755 --- a/adapters/saml/undertow/src/main/java/org/keycloak/adapters/saml/undertow/ServletSamlSessionStore.java +++ b/adapters/saml/undertow/src/main/java/org/keycloak/adapters/saml/undertow/ServletSamlSessionStore.java @@ -25,10 +25,10 @@ import io.undertow.servlet.handlers.ServletRequestContext; import io.undertow.servlet.spec.HttpSessionImpl; import org.jboss.logging.Logger; import org.keycloak.adapters.saml.SamlDeployment; -import org.keycloak.adapters.saml.SamlUtil; -import org.keycloak.adapters.spi.SessionIdMapper; import org.keycloak.adapters.saml.SamlSession; import org.keycloak.adapters.saml.SamlSessionStore; +import org.keycloak.adapters.saml.SamlUtil; +import org.keycloak.adapters.spi.SessionIdMapper; import org.keycloak.adapters.undertow.ChangeSessionId; import org.keycloak.adapters.undertow.SavedRequest; import org.keycloak.adapters.undertow.ServletHttpFacade; diff --git a/adapters/saml/undertow/src/main/java/org/keycloak/adapters/saml/undertow/UndertowSamlAuthenticator.java b/adapters/saml/undertow/src/main/java/org/keycloak/adapters/saml/undertow/UndertowSamlAuthenticator.java index 2a09ee169b..40fa1d6bad 100755 --- a/adapters/saml/undertow/src/main/java/org/keycloak/adapters/saml/undertow/UndertowSamlAuthenticator.java +++ b/adapters/saml/undertow/src/main/java/org/keycloak/adapters/saml/undertow/UndertowSamlAuthenticator.java @@ -19,14 +19,13 @@ package org.keycloak.adapters.saml.undertow; import io.undertow.security.api.SecurityContext; import io.undertow.security.idm.Account; -import org.keycloak.adapters.saml.profile.SamlAuthenticationHandler; -import org.keycloak.adapters.saml.profile.webbrowsersso.BrowserHandler; -import org.keycloak.adapters.saml.profile.webbrowsersso.SamlEndpoint; -import org.keycloak.adapters.spi.HttpFacade; import org.keycloak.adapters.saml.SamlAuthenticator; import org.keycloak.adapters.saml.SamlDeployment; import org.keycloak.adapters.saml.SamlSession; import org.keycloak.adapters.saml.SamlSessionStore; +import org.keycloak.adapters.saml.profile.SamlAuthenticationHandler; +import org.keycloak.adapters.saml.profile.webbrowsersso.BrowserHandler; +import org.keycloak.adapters.spi.HttpFacade; import java.security.Principal; import java.util.Set; diff --git a/adapters/saml/undertow/src/main/java/org/keycloak/adapters/saml/undertow/UndertowSamlEndpoint.java b/adapters/saml/undertow/src/main/java/org/keycloak/adapters/saml/undertow/UndertowSamlEndpoint.java index ee48f1bbb4..3f5cc1a649 100755 --- a/adapters/saml/undertow/src/main/java/org/keycloak/adapters/saml/undertow/UndertowSamlEndpoint.java +++ b/adapters/saml/undertow/src/main/java/org/keycloak/adapters/saml/undertow/UndertowSamlEndpoint.java @@ -17,7 +17,6 @@ package org.keycloak.adapters.saml.undertow; -import io.undertow.server.HttpHandler; import org.keycloak.adapters.saml.SamlAuthenticator; import org.keycloak.adapters.saml.SamlDeployment; import org.keycloak.adapters.saml.SamlSession; diff --git a/adapters/saml/wildfly/wildfly-adapter/src/main/java/org/keycloak/adapters/saml/wildfly/WildflySamlAuthMech.java b/adapters/saml/wildfly/wildfly-adapter/src/main/java/org/keycloak/adapters/saml/wildfly/WildflySamlAuthMech.java index b0825ce619..bdf06063b7 100755 --- a/adapters/saml/wildfly/wildfly-adapter/src/main/java/org/keycloak/adapters/saml/wildfly/WildflySamlAuthMech.java +++ b/adapters/saml/wildfly/wildfly-adapter/src/main/java/org/keycloak/adapters/saml/wildfly/WildflySamlAuthMech.java @@ -19,11 +19,11 @@ package org.keycloak.adapters.saml.wildfly; import io.undertow.security.api.SecurityContext; import io.undertow.server.HttpServerExchange; -import org.keycloak.adapters.spi.HttpFacade; import org.keycloak.adapters.saml.SamlDeployment; import org.keycloak.adapters.saml.SamlDeploymentContext; import org.keycloak.adapters.saml.SamlSessionStore; import org.keycloak.adapters.saml.undertow.ServletSamlAuthMech; +import org.keycloak.adapters.spi.HttpFacade; import org.keycloak.adapters.undertow.UndertowUserSessionManagement; /** diff --git a/adapters/saml/wildfly/wildfly-adapter/src/main/java/org/keycloak/adapters/saml/wildfly/WildflySamlSessionStore.java b/adapters/saml/wildfly/wildfly-adapter/src/main/java/org/keycloak/adapters/saml/wildfly/WildflySamlSessionStore.java index 9456140d1e..b4c213af6a 100755 --- a/adapters/saml/wildfly/wildfly-adapter/src/main/java/org/keycloak/adapters/saml/wildfly/WildflySamlSessionStore.java +++ b/adapters/saml/wildfly/wildfly-adapter/src/main/java/org/keycloak/adapters/saml/wildfly/WildflySamlSessionStore.java @@ -20,9 +20,9 @@ package org.keycloak.adapters.saml.wildfly; import io.undertow.security.api.SecurityContext; import io.undertow.server.HttpServerExchange; import org.keycloak.adapters.saml.SamlDeployment; -import org.keycloak.adapters.spi.SessionIdMapper; import org.keycloak.adapters.saml.SamlSession; import org.keycloak.adapters.saml.undertow.ServletSamlSessionStore; +import org.keycloak.adapters.spi.SessionIdMapper; import org.keycloak.adapters.undertow.UndertowUserSessionManagement; /** diff --git a/adapters/saml/wildfly/wildfly-subsystem/src/main/java/org/keycloak/subsystem/adapter/saml/extension/KeycloakSamlExtension.java b/adapters/saml/wildfly/wildfly-subsystem/src/main/java/org/keycloak/subsystem/adapter/saml/extension/KeycloakSamlExtension.java index a18e0b2923..a14e3d587f 100755 --- a/adapters/saml/wildfly/wildfly-subsystem/src/main/java/org/keycloak/subsystem/adapter/saml/extension/KeycloakSamlExtension.java +++ b/adapters/saml/wildfly/wildfly-subsystem/src/main/java/org/keycloak/subsystem/adapter/saml/extension/KeycloakSamlExtension.java @@ -20,7 +20,6 @@ import org.jboss.as.controller.Extension; import org.jboss.as.controller.ExtensionContext; import org.jboss.as.controller.ModelVersion; import org.jboss.as.controller.PathElement; -import org.jboss.as.controller.ResourceDefinition; import org.jboss.as.controller.SubsystemRegistration; import org.jboss.as.controller.descriptions.StandardResourceDescriptionResolver; import org.jboss.as.controller.parsing.ExtensionParsingContext; diff --git a/adapters/saml/wildfly/wildfly-subsystem/src/main/java/org/keycloak/subsystem/adapter/saml/extension/KeycloakSubsystemParser.java b/adapters/saml/wildfly/wildfly-subsystem/src/main/java/org/keycloak/subsystem/adapter/saml/extension/KeycloakSubsystemParser.java index c6a2ae0086..f938402108 100755 --- a/adapters/saml/wildfly/wildfly-subsystem/src/main/java/org/keycloak/subsystem/adapter/saml/extension/KeycloakSubsystemParser.java +++ b/adapters/saml/wildfly/wildfly-subsystem/src/main/java/org/keycloak/subsystem/adapter/saml/extension/KeycloakSubsystemParser.java @@ -32,9 +32,7 @@ import org.jboss.staxmapper.XMLExtendedStreamWriter; import javax.xml.stream.XMLStreamConstants; import javax.xml.stream.XMLStreamException; -import java.util.Arrays; import java.util.Collections; -import java.util.HashSet; import java.util.LinkedList; import java.util.List; diff --git a/adapters/saml/wildfly/wildfly-subsystem/src/main/java/org/keycloak/subsystem/adapter/saml/extension/SecureDeploymentDefinition.java b/adapters/saml/wildfly/wildfly-subsystem/src/main/java/org/keycloak/subsystem/adapter/saml/extension/SecureDeploymentDefinition.java index c4c0f6b16a..15bf36e31d 100644 --- a/adapters/saml/wildfly/wildfly-subsystem/src/main/java/org/keycloak/subsystem/adapter/saml/extension/SecureDeploymentDefinition.java +++ b/adapters/saml/wildfly/wildfly-subsystem/src/main/java/org/keycloak/subsystem/adapter/saml/extension/SecureDeploymentDefinition.java @@ -16,15 +16,12 @@ */ package org.keycloak.subsystem.adapter.saml.extension; -import org.jboss.as.controller.*; +import org.jboss.as.controller.PathElement; +import org.jboss.as.controller.ReloadRequiredRemoveStepHandler; +import org.jboss.as.controller.SimpleResourceDefinition; import org.jboss.as.controller.operations.common.GenericSubsystemDescribeHandler; import org.jboss.as.controller.registry.ManagementResourceRegistration; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.List; - /** * Defines attributes and operations for a secure-deployment. */ diff --git a/adapters/spi/tomcat-adapter-spi/src/main/java/org/keycloak/adapters/tomcat/CatalinaUserSessionManagementWrapper.java b/adapters/spi/tomcat-adapter-spi/src/main/java/org/keycloak/adapters/tomcat/CatalinaUserSessionManagementWrapper.java index e9781af951..18e5b43070 100755 --- a/adapters/spi/tomcat-adapter-spi/src/main/java/org/keycloak/adapters/tomcat/CatalinaUserSessionManagementWrapper.java +++ b/adapters/spi/tomcat-adapter-spi/src/main/java/org/keycloak/adapters/tomcat/CatalinaUserSessionManagementWrapper.java @@ -17,11 +17,11 @@ package org.keycloak.adapters.tomcat; -import java.util.List; - import org.apache.catalina.Manager; import org.keycloak.adapters.spi.UserSessionManagement; +import java.util.List; + /** * @author Marek Posolda */ diff --git a/adapters/spi/undertow-adapter-spi/src/main/java/org/keycloak/adapters/undertow/ChangeSessionId.java b/adapters/spi/undertow-adapter-spi/src/main/java/org/keycloak/adapters/undertow/ChangeSessionId.java index 95fdc15f17..24eef7e0dd 100755 --- a/adapters/spi/undertow-adapter-spi/src/main/java/org/keycloak/adapters/undertow/ChangeSessionId.java +++ b/adapters/spi/undertow-adapter-spi/src/main/java/org/keycloak/adapters/undertow/ChangeSessionId.java @@ -19,8 +19,6 @@ package org.keycloak.adapters.undertow; import io.undertow.server.HttpServerExchange; import io.undertow.server.session.Session; -import io.undertow.server.session.SessionConfig; -import io.undertow.server.session.SessionManager; import io.undertow.servlet.api.DeploymentInfo; import io.undertow.servlet.handlers.ServletRequestContext; import io.undertow.servlet.spec.HttpSessionImpl; diff --git a/adapters/spi/undertow-adapter-spi/src/main/java/org/keycloak/adapters/undertow/ServletHttpFacade.java b/adapters/spi/undertow-adapter-spi/src/main/java/org/keycloak/adapters/undertow/ServletHttpFacade.java index c42b43bd2c..fbcd6d3219 100755 --- a/adapters/spi/undertow-adapter-spi/src/main/java/org/keycloak/adapters/undertow/ServletHttpFacade.java +++ b/adapters/spi/undertow-adapter-spi/src/main/java/org/keycloak/adapters/undertow/ServletHttpFacade.java @@ -20,12 +20,10 @@ package org.keycloak.adapters.undertow; import io.undertow.server.HttpServerExchange; import io.undertow.servlet.handlers.ServletRequestContext; import org.keycloak.adapters.spi.AuthenticationError; -import org.keycloak.adapters.spi.HttpFacade; import org.keycloak.adapters.spi.LogoutError; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import java.io.IOException; /** * @author Bill Burke diff --git a/adapters/spi/undertow-adapter-spi/src/main/java/org/keycloak/adapters/undertow/SessionManagementBridge.java b/adapters/spi/undertow-adapter-spi/src/main/java/org/keycloak/adapters/undertow/SessionManagementBridge.java index 7ca752e186..fcde53737b 100755 --- a/adapters/spi/undertow-adapter-spi/src/main/java/org/keycloak/adapters/undertow/SessionManagementBridge.java +++ b/adapters/spi/undertow-adapter-spi/src/main/java/org/keycloak/adapters/undertow/SessionManagementBridge.java @@ -17,10 +17,8 @@ package org.keycloak.adapters.undertow; import io.undertow.server.session.SessionManager; -import io.undertow.servlet.api.DeploymentInfo; import org.keycloak.adapters.spi.UserSessionManagement; -import java.lang.reflect.Method; import java.util.List; /** diff --git a/authz/client/src/main/java/org/keycloak/authorization/client/AuthorizationDeniedException.java b/authz/client/src/main/java/org/keycloak/authorization/client/AuthorizationDeniedException.java index ffab2b5ec3..8c706b3848 100644 --- a/authz/client/src/main/java/org/keycloak/authorization/client/AuthorizationDeniedException.java +++ b/authz/client/src/main/java/org/keycloak/authorization/client/AuthorizationDeniedException.java @@ -17,8 +17,6 @@ */ package org.keycloak.authorization.client; -import org.keycloak.authorization.client.util.HttpResponseException; - /** * @author Pedro Igor */ diff --git a/authz/client/src/main/java/org/keycloak/authorization/client/representation/PermissionRequest.java b/authz/client/src/main/java/org/keycloak/authorization/client/representation/PermissionRequest.java index bc9037e355..39518fc73c 100644 --- a/authz/client/src/main/java/org/keycloak/authorization/client/representation/PermissionRequest.java +++ b/authz/client/src/main/java/org/keycloak/authorization/client/representation/PermissionRequest.java @@ -19,8 +19,6 @@ package org.keycloak.authorization.client.representation; import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Arrays; -import java.util.HashSet; import java.util.Set; /** diff --git a/authz/client/src/main/java/org/keycloak/authorization/client/resource/AuthorizationResource.java b/authz/client/src/main/java/org/keycloak/authorization/client/resource/AuthorizationResource.java index 49b6d2da3e..9a03e5c2e6 100644 --- a/authz/client/src/main/java/org/keycloak/authorization/client/resource/AuthorizationResource.java +++ b/authz/client/src/main/java/org/keycloak/authorization/client/resource/AuthorizationResource.java @@ -25,8 +25,6 @@ import org.keycloak.authorization.client.util.Http; import org.keycloak.authorization.client.util.HttpResponseException; import org.keycloak.util.JsonSerialization; -import java.io.IOException; - /** * @author Pedro Igor */ diff --git a/authz/policy/common/src/main/java/org/keycloak/authorization/policy/provider/role/RolePolicyProvider.java b/authz/policy/common/src/main/java/org/keycloak/authorization/policy/provider/role/RolePolicyProvider.java index c8a99fe7c1..9fb9787f4b 100644 --- a/authz/policy/common/src/main/java/org/keycloak/authorization/policy/provider/role/RolePolicyProvider.java +++ b/authz/policy/common/src/main/java/org/keycloak/authorization/policy/provider/role/RolePolicyProvider.java @@ -21,7 +21,6 @@ import org.keycloak.authorization.AuthorizationProvider; import org.keycloak.authorization.identity.Identity; import org.keycloak.authorization.model.Policy; import org.keycloak.authorization.policy.evaluation.Evaluation; -import org.keycloak.authorization.policy.evaluation.EvaluationContext; import org.keycloak.authorization.policy.provider.PolicyProvider; import org.keycloak.models.ClientModel; import org.keycloak.models.RealmModel; diff --git a/authz/policy/common/src/main/java/org/keycloak/authorization/policy/provider/time/TimePolicyProvider.java b/authz/policy/common/src/main/java/org/keycloak/authorization/policy/provider/time/TimePolicyProvider.java index 3205cc5143..84ba1a2889 100644 --- a/authz/policy/common/src/main/java/org/keycloak/authorization/policy/provider/time/TimePolicyProvider.java +++ b/authz/policy/common/src/main/java/org/keycloak/authorization/policy/provider/time/TimePolicyProvider.java @@ -25,8 +25,6 @@ import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; -import static com.sun.corba.se.spi.activation.IIOP_CLEAR_TEXT.value; - /** * @author Pedro Igor */ diff --git a/common/src/main/java/org/keycloak/common/util/CertificateUtils.java b/common/src/main/java/org/keycloak/common/util/CertificateUtils.java index 6730db2996..9d3e76f5a0 100755 --- a/common/src/main/java/org/keycloak/common/util/CertificateUtils.java +++ b/common/src/main/java/org/keycloak/common/util/CertificateUtils.java @@ -17,14 +17,6 @@ package org.keycloak.common.util; -import java.math.BigInteger; -import java.security.KeyPair; -import java.security.PrivateKey; -import java.security.SecureRandom; -import java.security.cert.X509Certificate; -import java.util.Calendar; -import java.util.Date; - import org.bouncycastle.asn1.ASN1Sequence; import org.bouncycastle.asn1.oiw.OIWObjectIdentifiers; import org.bouncycastle.asn1.x500.X500Name; @@ -49,6 +41,14 @@ import org.bouncycastle.operator.bc.BcDigestCalculatorProvider; import org.bouncycastle.operator.bc.BcRSAContentSignerBuilder; import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder; +import java.math.BigInteger; +import java.security.KeyPair; +import java.security.PrivateKey; +import java.security.SecureRandom; +import java.security.cert.X509Certificate; +import java.util.Calendar; +import java.util.Date; + /** * The Class CertificateUtils provides utility functions for generation of V1 and V3 {@link java.security.cert.X509Certificate} * diff --git a/common/src/main/java/org/keycloak/common/util/ConcurrentMultivaluedHashMap.java b/common/src/main/java/org/keycloak/common/util/ConcurrentMultivaluedHashMap.java index 56226e0241..c092c6f9d1 100755 --- a/common/src/main/java/org/keycloak/common/util/ConcurrentMultivaluedHashMap.java +++ b/common/src/main/java/org/keycloak/common/util/ConcurrentMultivaluedHashMap.java @@ -17,9 +17,7 @@ package org.keycloak.common.util; -import java.util.ArrayList; import java.util.Collection; -import java.util.HashMap; import java.util.List; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.CopyOnWriteArrayList; diff --git a/common/src/main/java/org/keycloak/common/util/KerberosJdkProvider.java b/common/src/main/java/org/keycloak/common/util/KerberosJdkProvider.java index ffd42f7bbc..f84f4d906d 100644 --- a/common/src/main/java/org/keycloak/common/util/KerberosJdkProvider.java +++ b/common/src/main/java/org/keycloak/common/util/KerberosJdkProvider.java @@ -17,6 +17,16 @@ package org.keycloak.common.util; +import org.ietf.jgss.GSSCredential; +import org.ietf.jgss.GSSManager; +import org.ietf.jgss.GSSName; +import org.keycloak.common.constants.KerberosConstants; + +import javax.security.auth.Subject; +import javax.security.auth.kerberos.KerberosPrincipal; +import javax.security.auth.kerberos.KerberosTicket; +import javax.security.auth.login.AppConfigurationEntry; +import javax.security.auth.login.Configuration; import java.io.File; import java.lang.reflect.Method; import java.net.MalformedURLException; @@ -27,17 +37,6 @@ import java.util.Iterator; import java.util.Map; import java.util.Set; -import javax.security.auth.Subject; -import javax.security.auth.kerberos.KerberosPrincipal; -import javax.security.auth.kerberos.KerberosTicket; -import javax.security.auth.login.AppConfigurationEntry; -import javax.security.auth.login.Configuration; - -import org.ietf.jgss.GSSCredential; -import org.ietf.jgss.GSSManager; -import org.ietf.jgss.GSSName; -import org.keycloak.common.constants.KerberosConstants; - /** * Provides abstraction to handle differences between various JDK vendors (Sun, IBM) * diff --git a/common/src/main/java/org/keycloak/common/util/KerberosSerializationUtils.java b/common/src/main/java/org/keycloak/common/util/KerberosSerializationUtils.java index 17a11e492e..32db75ad85 100644 --- a/common/src/main/java/org/keycloak/common/util/KerberosSerializationUtils.java +++ b/common/src/main/java/org/keycloak/common/util/KerberosSerializationUtils.java @@ -17,6 +17,9 @@ package org.keycloak.common.util; +import org.ietf.jgss.GSSCredential; + +import javax.security.auth.kerberos.KerberosTicket; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -25,13 +28,6 @@ import java.io.ObjectInputStream; import java.io.ObjectOutput; import java.io.ObjectOutputStream; import java.io.Serializable; -import java.util.Iterator; -import java.util.Set; - -import javax.security.auth.Subject; -import javax.security.auth.kerberos.KerberosTicket; - -import org.ietf.jgss.GSSCredential; /** * Provides serialization/deserialization of kerberos {@link org.ietf.jgss.GSSCredential}, so it can be transmitted from auth-server to the application diff --git a/common/src/main/java/org/keycloak/common/util/KeystoreUtil.java b/common/src/main/java/org/keycloak/common/util/KeystoreUtil.java index 4515c96bd4..88ecd1942f 100755 --- a/common/src/main/java/org/keycloak/common/util/KeystoreUtil.java +++ b/common/src/main/java/org/keycloak/common/util/KeystoreUtil.java @@ -17,14 +17,14 @@ package org.keycloak.common.util; +import org.keycloak.common.constants.GenericConstants; + import java.io.File; import java.io.FileInputStream; import java.io.InputStream; import java.security.KeyStore; import java.security.PrivateKey; -import org.keycloak.common.constants.GenericConstants; - /** * @author Bill Burke * @version $Revision: 1 $ diff --git a/core/src/main/java/org/keycloak/KeycloakSecurityContext.java b/core/src/main/java/org/keycloak/KeycloakSecurityContext.java index 68ac957860..33e8c324ee 100755 --- a/core/src/main/java/org/keycloak/KeycloakSecurityContext.java +++ b/core/src/main/java/org/keycloak/KeycloakSecurityContext.java @@ -17,9 +17,9 @@ package org.keycloak; +import org.keycloak.common.util.Base64Url; import org.keycloak.representations.AccessToken; import org.keycloak.representations.IDToken; -import org.keycloak.common.util.Base64Url; import org.keycloak.util.JsonSerialization; import java.io.IOException; diff --git a/core/src/main/java/org/keycloak/jose/jwk/JSONWebKeySet.java b/core/src/main/java/org/keycloak/jose/jwk/JSONWebKeySet.java index 4dccf068c4..1949c57eef 100644 --- a/core/src/main/java/org/keycloak/jose/jwk/JSONWebKeySet.java +++ b/core/src/main/java/org/keycloak/jose/jwk/JSONWebKeySet.java @@ -18,7 +18,6 @@ package org.keycloak.jose.jwk; import com.fasterxml.jackson.annotation.JsonProperty; -import org.keycloak.jose.jwk.JWK; /** * @author Stian Thorgersen diff --git a/core/src/main/java/org/keycloak/jose/jws/JWSBuilder.java b/core/src/main/java/org/keycloak/jose/jws/JWSBuilder.java index 68ee65d9b3..a17050e5ac 100755 --- a/core/src/main/java/org/keycloak/jose/jws/JWSBuilder.java +++ b/core/src/main/java/org/keycloak/jose/jws/JWSBuilder.java @@ -17,9 +17,9 @@ package org.keycloak.jose.jws; +import org.keycloak.common.util.Base64Url; import org.keycloak.jose.jws.crypto.HMACProvider; import org.keycloak.jose.jws.crypto.RSAProvider; -import org.keycloak.common.util.Base64Url; import org.keycloak.util.JsonSerialization; import javax.crypto.SecretKey; diff --git a/core/src/main/java/org/keycloak/jose/jws/crypto/HMACProvider.java b/core/src/main/java/org/keycloak/jose/jws/crypto/HMACProvider.java index 02212b9cd9..c2ebc26dbf 100755 --- a/core/src/main/java/org/keycloak/jose/jws/crypto/HMACProvider.java +++ b/core/src/main/java/org/keycloak/jose/jws/crypto/HMACProvider.java @@ -18,9 +18,9 @@ package org.keycloak.jose.jws.crypto; +import org.keycloak.common.util.Base64Url; import org.keycloak.jose.jws.Algorithm; import org.keycloak.jose.jws.JWSInput; -import org.keycloak.common.util.Base64Url; import javax.crypto.Mac; import javax.crypto.SecretKey; diff --git a/core/src/main/java/org/keycloak/jose/jws/crypto/HashProvider.java b/core/src/main/java/org/keycloak/jose/jws/crypto/HashProvider.java index c8fa714841..fcdc2a4915 100644 --- a/core/src/main/java/org/keycloak/jose/jws/crypto/HashProvider.java +++ b/core/src/main/java/org/keycloak/jose/jws/crypto/HashProvider.java @@ -17,12 +17,12 @@ package org.keycloak.jose.jws.crypto; -import java.security.MessageDigest; -import java.util.Arrays; - import org.keycloak.common.util.Base64Url; import org.keycloak.jose.jws.Algorithm; +import java.security.MessageDigest; +import java.util.Arrays; + /** * @author Marek Posolda */ diff --git a/core/src/main/java/org/keycloak/jose/jws/crypto/RSAProvider.java b/core/src/main/java/org/keycloak/jose/jws/crypto/RSAProvider.java index b10da01a44..97036954a1 100755 --- a/core/src/main/java/org/keycloak/jose/jws/crypto/RSAProvider.java +++ b/core/src/main/java/org/keycloak/jose/jws/crypto/RSAProvider.java @@ -18,9 +18,9 @@ package org.keycloak.jose.jws.crypto; +import org.keycloak.common.util.PemUtils; import org.keycloak.jose.jws.Algorithm; import org.keycloak.jose.jws.JWSInput; -import org.keycloak.common.util.PemUtils; import java.security.PrivateKey; import java.security.PublicKey; diff --git a/core/src/main/java/org/keycloak/representations/JsonWebToken.java b/core/src/main/java/org/keycloak/representations/JsonWebToken.java index f40405b561..e499271998 100755 --- a/core/src/main/java/org/keycloak/representations/JsonWebToken.java +++ b/core/src/main/java/org/keycloak/representations/JsonWebToken.java @@ -23,9 +23,9 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import org.keycloak.common.util.Time; import org.keycloak.json.StringOrArrayDeserializer; import org.keycloak.json.StringOrArraySerializer; -import org.keycloak.common.util.Time; import java.io.Serializable; import java.util.HashMap; diff --git a/core/src/main/java/org/keycloak/representations/UserInfo.java b/core/src/main/java/org/keycloak/representations/UserInfo.java index 784971889f..267696e3f9 100755 --- a/core/src/main/java/org/keycloak/representations/UserInfo.java +++ b/core/src/main/java/org/keycloak/representations/UserInfo.java @@ -16,9 +16,6 @@ */ package org.keycloak.representations; -import java.util.HashMap; -import java.util.Map; - import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -28,6 +25,9 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; import org.keycloak.json.StringOrArrayDeserializer; import org.keycloak.json.StringOrArraySerializer; +import java.util.HashMap; +import java.util.Map; + /** * @author pedroigor */ diff --git a/core/src/main/java/org/keycloak/representations/idm/ComponentRepresentation.java b/core/src/main/java/org/keycloak/representations/idm/ComponentRepresentation.java index bbc4a42b97..2fac965c8f 100755 --- a/core/src/main/java/org/keycloak/representations/idm/ComponentRepresentation.java +++ b/core/src/main/java/org/keycloak/representations/idm/ComponentRepresentation.java @@ -19,9 +19,6 @@ package org.keycloak.representations.idm; import org.keycloak.common.util.MultivaluedHashMap; -import java.util.List; -import java.util.Map; - /** * @author Marek Posolda */ diff --git a/core/src/main/java/org/keycloak/representations/idm/ComponentTypeRepresentation.java b/core/src/main/java/org/keycloak/representations/idm/ComponentTypeRepresentation.java index 8ba0da6e41..76ba16d034 100644 --- a/core/src/main/java/org/keycloak/representations/idm/ComponentTypeRepresentation.java +++ b/core/src/main/java/org/keycloak/representations/idm/ComponentTypeRepresentation.java @@ -17,10 +17,7 @@ package org.keycloak.representations.idm; -import java.util.HashMap; -import java.util.LinkedList; import java.util.List; -import java.util.Map; /** * @author Marek Posolda diff --git a/core/src/main/java/org/keycloak/representations/idm/CredentialRepresentation.java b/core/src/main/java/org/keycloak/representations/idm/CredentialRepresentation.java index f48d726dd7..d597cf32aa 100755 --- a/core/src/main/java/org/keycloak/representations/idm/CredentialRepresentation.java +++ b/core/src/main/java/org/keycloak/representations/idm/CredentialRepresentation.java @@ -19,8 +19,6 @@ package org.keycloak.representations.idm; import org.keycloak.common.util.MultivaluedHashMap; -import java.util.Map; - /** * @author Bill Burke * @version $Revision: 1 $ diff --git a/core/src/main/java/org/keycloak/representations/idm/GroupRepresentation.java b/core/src/main/java/org/keycloak/representations/idm/GroupRepresentation.java index 3baa22f0f9..180db64677 100755 --- a/core/src/main/java/org/keycloak/representations/idm/GroupRepresentation.java +++ b/core/src/main/java/org/keycloak/representations/idm/GroupRepresentation.java @@ -17,8 +17,6 @@ package org.keycloak.representations.idm; -import com.fasterxml.jackson.annotation.JsonIgnore; - import java.util.Arrays; import java.util.HashMap; import java.util.List; diff --git a/core/src/main/java/org/keycloak/representations/idm/PartialImportRepresentation.java b/core/src/main/java/org/keycloak/representations/idm/PartialImportRepresentation.java index 520c1306c9..5e17e9d3bf 100644 --- a/core/src/main/java/org/keycloak/representations/idm/PartialImportRepresentation.java +++ b/core/src/main/java/org/keycloak/representations/idm/PartialImportRepresentation.java @@ -17,9 +17,10 @@ package org.keycloak.representations.idm; -import java.util.List; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.List; + /** * Used for partial import of users, groups, clients, roles, and identity providers. * diff --git a/core/src/main/java/org/keycloak/representations/idm/PublishedRealmRepresentation.java b/core/src/main/java/org/keycloak/representations/idm/PublishedRealmRepresentation.java index 72eb5505e8..ceb2fe92b5 100755 --- a/core/src/main/java/org/keycloak/representations/idm/PublishedRealmRepresentation.java +++ b/core/src/main/java/org/keycloak/representations/idm/PublishedRealmRepresentation.java @@ -17,9 +17,9 @@ package org.keycloak.representations.idm; -import org.bouncycastle.openssl.PEMWriter; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; +import org.bouncycastle.openssl.PEMWriter; import org.keycloak.common.util.PemUtils; import java.io.IOException; diff --git a/core/src/main/java/org/keycloak/representations/idm/RealmRepresentation.java b/core/src/main/java/org/keycloak/representations/idm/RealmRepresentation.java index 89e0c0181f..776aa0e005 100755 --- a/core/src/main/java/org/keycloak/representations/idm/RealmRepresentation.java +++ b/core/src/main/java/org/keycloak/representations/idm/RealmRepresentation.java @@ -20,7 +20,12 @@ package org.keycloak.representations.idm; import com.fasterxml.jackson.annotation.JsonIgnore; import org.keycloak.common.util.MultivaluedHashMap; -import java.util.*; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; /** * @author Bill Burke diff --git a/core/src/main/java/org/keycloak/representations/idm/UserSessionRepresentation.java b/core/src/main/java/org/keycloak/representations/idm/UserSessionRepresentation.java index f8178764d4..66206046fe 100755 --- a/core/src/main/java/org/keycloak/representations/idm/UserSessionRepresentation.java +++ b/core/src/main/java/org/keycloak/representations/idm/UserSessionRepresentation.java @@ -18,9 +18,7 @@ package org.keycloak.representations.idm; import java.util.HashMap; -import java.util.HashSet; import java.util.Map; -import java.util.Set; /** * @author Bill Burke diff --git a/core/src/main/java/org/keycloak/representations/idm/authorization/ResourceRepresentation.java b/core/src/main/java/org/keycloak/representations/idm/authorization/ResourceRepresentation.java index c89a2d6305..8f3c7957ef 100644 --- a/core/src/main/java/org/keycloak/representations/idm/authorization/ResourceRepresentation.java +++ b/core/src/main/java/org/keycloak/representations/idm/authorization/ResourceRepresentation.java @@ -20,7 +20,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.net.URI; -import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Set; diff --git a/core/src/main/java/org/keycloak/util/JWKSUtils.java b/core/src/main/java/org/keycloak/util/JWKSUtils.java index 72ffe91c86..dbf6cd38ea 100644 --- a/core/src/main/java/org/keycloak/util/JWKSUtils.java +++ b/core/src/main/java/org/keycloak/util/JWKSUtils.java @@ -17,14 +17,14 @@ package org.keycloak.util; -import java.security.PublicKey; -import java.util.HashMap; -import java.util.Map; - import org.keycloak.jose.jwk.JSONWebKeySet; import org.keycloak.jose.jwk.JWK; import org.keycloak.jose.jwk.JWKParser; +import java.security.PublicKey; +import java.util.HashMap; +import java.util.Map; + /** * @author Marek Posolda */ diff --git a/core/src/main/java/org/keycloak/util/SystemPropertiesJsonParserFactory.java b/core/src/main/java/org/keycloak/util/SystemPropertiesJsonParserFactory.java index 0d786f2c9c..10481fb28f 100644 --- a/core/src/main/java/org/keycloak/util/SystemPropertiesJsonParserFactory.java +++ b/core/src/main/java/org/keycloak/util/SystemPropertiesJsonParserFactory.java @@ -17,11 +17,6 @@ package org.keycloak.util; -import java.io.IOException; -import java.io.InputStream; -import java.io.Reader; -import java.util.Properties; - import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.io.IOContext; import com.fasterxml.jackson.core.util.JsonParserDelegate; @@ -29,6 +24,11 @@ import com.fasterxml.jackson.databind.MappingJsonFactory; import org.keycloak.common.util.StringPropertyReplacer; import org.keycloak.common.util.SystemEnvProperties; +import java.io.IOException; +import java.io.InputStream; +import java.io.Reader; +import java.util.Properties; + /** * Provides replacing of system properties for parsed values * diff --git a/core/src/main/java/org/keycloak/util/TokenUtil.java b/core/src/main/java/org/keycloak/util/TokenUtil.java index f649b5ee49..5226c6b1b3 100644 --- a/core/src/main/java/org/keycloak/util/TokenUtil.java +++ b/core/src/main/java/org/keycloak/util/TokenUtil.java @@ -17,13 +17,13 @@ package org.keycloak.util; -import java.io.IOException; - import org.keycloak.OAuth2Constants; import org.keycloak.jose.jws.JWSInput; import org.keycloak.jose.jws.JWSInputException; import org.keycloak.representations.RefreshToken; +import java.io.IOException; + /** * @author Marek Posolda */ diff --git a/core/src/test/java/org/keycloak/AtHashTest.java b/core/src/test/java/org/keycloak/AtHashTest.java index 7015e7a93b..1d3cc54e9d 100644 --- a/core/src/test/java/org/keycloak/AtHashTest.java +++ b/core/src/test/java/org/keycloak/AtHashTest.java @@ -17,14 +17,14 @@ package org.keycloak; -import java.security.Security; - import org.bouncycastle.jce.provider.BouncyCastleProvider; import org.junit.Assert; import org.junit.Test; import org.keycloak.jose.jws.Algorithm; import org.keycloak.jose.jws.crypto.HashProvider; +import java.security.Security; + /** * See "at_hash" in OIDC specification * diff --git a/core/src/test/java/org/keycloak/RSAVerifierTest.java b/core/src/test/java/org/keycloak/RSAVerifierTest.java index 366d7b7930..58e1f38d73 100755 --- a/core/src/test/java/org/keycloak/RSAVerifierTest.java +++ b/core/src/test/java/org/keycloak/RSAVerifierTest.java @@ -25,9 +25,9 @@ import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import org.keycloak.common.VerificationException; +import org.keycloak.common.util.Time; import org.keycloak.jose.jws.JWSBuilder; import org.keycloak.representations.AccessToken; -import org.keycloak.common.util.Time; import org.keycloak.util.TokenUtil; import javax.security.auth.x500.X500Principal; diff --git a/core/src/test/java/org/keycloak/jose/JsonWebTokenTest.java b/core/src/test/java/org/keycloak/jose/JsonWebTokenTest.java index bb1de6abf0..addd6f30ab 100644 --- a/core/src/test/java/org/keycloak/jose/JsonWebTokenTest.java +++ b/core/src/test/java/org/keycloak/jose/JsonWebTokenTest.java @@ -23,7 +23,8 @@ import org.keycloak.util.JsonSerialization; import java.io.IOException; -import static org.junit.Assert.*; +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertTrue; /** * Created by st on 20.08.15. diff --git a/examples/admin-client/src/main/webapp/index.jsp b/examples/admin-client/src/main/webapp/index.jsp index b52246b8a5..d2c1b440e6 100644 --- a/examples/admin-client/src/main/webapp/index.jsp +++ b/examples/admin-client/src/main/webapp/index.jsp @@ -1,7 +1,7 @@ <%@ page import="org.keycloak.admin.client.Keycloak" %> <%@ page import="org.keycloak.admin.client.resource.ClientsResource" %> -<%@ page import="org.keycloak.representations.idm.ClientRepresentation" %> <%@ page import="org.keycloak.common.util.UriUtils" %> +<%@ page import="org.keycloak.representations.idm.ClientRepresentation" %> <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %> <%@ page session="false" %> diff --git a/examples/authz/hello-world-authz-service/src/main/webapp/index.jsp b/examples/authz/hello-world-authz-service/src/main/webapp/index.jsp index 75f3d6f0f2..0aea6b0452 100644 --- a/examples/authz/hello-world-authz-service/src/main/webapp/index.jsp +++ b/examples/authz/hello-world-authz-service/src/main/webapp/index.jsp @@ -16,9 +16,9 @@ ~ --%> <%@page import="org.keycloak.AuthorizationContext" %> +<%@ page import="org.keycloak.KeycloakSecurityContext" %> <%@ page import="org.keycloak.common.util.KeycloakUriBuilder" %> <%@ page import="org.keycloak.constants.ServiceUrlConstants" %> -<%@ page import="org.keycloak.KeycloakSecurityContext" %> <%@ page import="org.keycloak.representations.idm.authorization.Permission" %> <% diff --git a/examples/authz/photoz/photoz-authz-policy/src/main/resources/META-INF/kmodule.xml b/examples/authz/photoz/photoz-authz-policy/src/main/resources/META-INF/kmodule.xml index 84bacd5624..842128732c 100644 --- a/examples/authz/photoz/photoz-authz-policy/src/main/resources/META-INF/kmodule.xml +++ b/examples/authz/photoz/photoz-authz-policy/src/main/resources/META-INF/kmodule.xml @@ -1,6 +1,6 @@ - + diff --git a/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/album/AlbumService.java b/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/album/AlbumService.java index d0e9c2d5c5..7dd6b244a1 100644 --- a/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/album/AlbumService.java +++ b/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/album/AlbumService.java @@ -11,10 +11,8 @@ import org.keycloak.example.photoz.util.Transaction; import org.keycloak.representations.adapters.config.AdapterConfig; import org.keycloak.util.JsonSerialization; -import javax.ejb.Stateless; import javax.inject.Inject; import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; import javax.persistence.Query; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.Consumes; diff --git a/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/album/ProfileService.java b/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/album/ProfileService.java index f7b55cbc33..92e300dec5 100644 --- a/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/album/ProfileService.java +++ b/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/album/ProfileService.java @@ -17,17 +17,14 @@ */ package org.keycloak.example.photoz.album; -import javax.ejb.Stateless; import javax.inject.Inject; import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.Context; import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; import java.security.Principal; import java.util.List; diff --git a/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/util/Transaction.java b/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/util/Transaction.java index a3caa780a8..6f5d5ec229 100644 --- a/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/util/Transaction.java +++ b/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/util/Transaction.java @@ -20,7 +20,6 @@ import javax.interceptor.InterceptorBinding; import java.lang.annotation.Retention; import java.lang.annotation.Target; -import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.TYPE; import static java.lang.annotation.RetentionPolicy.RUNTIME; diff --git a/examples/basic-auth/src/main/java/org/keycloak/example/basicauth/BasicAuthService.java b/examples/basic-auth/src/main/java/org/keycloak/example/basicauth/BasicAuthService.java index 233e2789a2..f5f56a54ba 100644 --- a/examples/basic-auth/src/main/java/org/keycloak/example/basicauth/BasicAuthService.java +++ b/examples/basic-auth/src/main/java/org/keycloak/example/basicauth/BasicAuthService.java @@ -21,10 +21,7 @@ import org.jboss.resteasy.annotations.cache.NoCache; import javax.ws.rs.GET; import javax.ws.rs.Path; -import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; -import java.util.ArrayList; -import java.util.List; /** * @author Bill Burke diff --git a/examples/demo-template/admin-access-app/src/main/java/org/keycloak/example/AdminClient.java b/examples/demo-template/admin-access-app/src/main/java/org/keycloak/example/AdminClient.java index 11c9b04abc..75703f8c71 100755 --- a/examples/demo-template/admin-access-app/src/main/java/org/keycloak/example/AdminClient.java +++ b/examples/demo-template/admin-access-app/src/main/java/org/keycloak/example/AdminClient.java @@ -27,12 +27,12 @@ import org.apache.http.client.methods.HttpPost; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.message.BasicNameValuePair; import org.keycloak.OAuth2Constants; +import org.keycloak.common.util.KeycloakUriBuilder; +import org.keycloak.common.util.UriUtils; import org.keycloak.constants.ServiceUrlConstants; import org.keycloak.representations.AccessTokenResponse; import org.keycloak.representations.idm.RoleRepresentation; import org.keycloak.util.JsonSerialization; -import org.keycloak.common.util.KeycloakUriBuilder; -import org.keycloak.common.util.UriUtils; import javax.servlet.http.HttpServletRequest; import java.io.ByteArrayOutputStream; diff --git a/examples/demo-template/angular2-product-app/src/main/webapp/app/app.component.ts b/examples/demo-template/angular2-product-app/src/main/webapp/app/app.component.ts index d43e25740d..a6955e71f1 100644 --- a/examples/demo-template/angular2-product-app/src/main/webapp/app/app.component.ts +++ b/examples/demo-template/angular2-product-app/src/main/webapp/app/app.component.ts @@ -1,10 +1,8 @@ -import { Component } from '@angular/core'; -import { Http, Headers, RequestOptions, Response } from '@angular/http'; - -import { Observable } from 'rxjs/Observable'; -import 'rxjs/add/operator/map'; - -import { KeycloakService } from './keycloak.service'; +import {Component} from "@angular/core"; +import {Http, Headers, RequestOptions, Response} from "@angular/http"; +import {Observable} from "rxjs/Observable"; +import "rxjs/add/operator/map"; +import {KeycloakService} from "./keycloak.service"; @Component({ selector: 'my-app', diff --git a/examples/demo-template/angular2-product-app/src/main/webapp/app/app.module.ts b/examples/demo-template/angular2-product-app/src/main/webapp/app/app.module.ts index f345fa3ea6..6d2891f935 100644 --- a/examples/demo-template/angular2-product-app/src/main/webapp/app/app.module.ts +++ b/examples/demo-template/angular2-product-app/src/main/webapp/app/app.module.ts @@ -1,8 +1,8 @@ -import { NgModule } from '@angular/core'; -import { BrowserModule } from '@angular/platform-browser'; -import { HttpModule } from '@angular/http'; -import { KeycloakService } from './keycloak.service'; -import { AppComponent } from './app.component'; +import {NgModule} from "@angular/core"; +import {BrowserModule} from "@angular/platform-browser"; +import {HttpModule} from "@angular/http"; +import {KeycloakService} from "./keycloak.service"; +import {AppComponent} from "./app.component"; @NgModule({ imports: [ diff --git a/examples/demo-template/angular2-product-app/src/main/webapp/app/keycloak.service.ts b/examples/demo-template/angular2-product-app/src/main/webapp/app/keycloak.service.ts index 33fc28357e..aba14a61c2 100644 --- a/examples/demo-template/angular2-product-app/src/main/webapp/app/keycloak.service.ts +++ b/examples/demo-template/angular2-product-app/src/main/webapp/app/keycloak.service.ts @@ -1,4 +1,4 @@ -import { Injectable } from '@angular/core'; +import {Injectable} from "@angular/core"; declare var Keycloak: any; diff --git a/examples/demo-template/angular2-product-app/src/main/webapp/app/main.ts b/examples/demo-template/angular2-product-app/src/main/webapp/app/main.ts index 6bf99bfc91..352f12b694 100644 --- a/examples/demo-template/angular2-product-app/src/main/webapp/app/main.ts +++ b/examples/demo-template/angular2-product-app/src/main/webapp/app/main.ts @@ -1,7 +1,6 @@ -import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; -import { AppModule } from './app.module'; - -import {KeycloakService} from './keycloak.service'; +import {platformBrowserDynamic} from "@angular/platform-browser-dynamic"; +import {AppModule} from "./app.module"; +import {KeycloakService} from "./keycloak.service"; KeycloakService.init() .then(() => { diff --git a/examples/demo-template/customer-app-filter/src/main/webapp/customers/view.jsp b/examples/demo-template/customer-app-filter/src/main/webapp/customers/view.jsp index c2e66f1612..d86b062ab3 100755 --- a/examples/demo-template/customer-app-filter/src/main/webapp/customers/view.jsp +++ b/examples/demo-template/customer-app-filter/src/main/webapp/customers/view.jsp @@ -1,9 +1,9 @@ <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %> +<%@ page import="org.keycloak.common.util.KeycloakUriBuilder" %> <%@ page import="org.keycloak.constants.ServiceUrlConstants" %> <%@ page import="org.keycloak.example.CustomerDatabaseClient" %> <%@ page import="org.keycloak.representations.IDToken" %> -<%@ page import="org.keycloak.common.util.KeycloakUriBuilder" %> <%@ page session="false" %> diff --git a/examples/demo-template/customer-app/src/main/webapp/customers/session.jsp b/examples/demo-template/customer-app/src/main/webapp/customers/session.jsp index 79aafdb249..7ef032ac79 100755 --- a/examples/demo-template/customer-app/src/main/webapp/customers/session.jsp +++ b/examples/demo-template/customer-app/src/main/webapp/customers/session.jsp @@ -1,15 +1,13 @@ <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %> -<%@ page import="org.keycloak.constants.ServiceUrlConstants" %> -<%@ page import="org.keycloak.example.CustomerDatabaseClient" %> -<%@ page import="org.keycloak.representations.IDToken" %> <%@ page import="org.keycloak.common.util.HostUtils" %> +<%@ page import="org.keycloak.example.CustomerDatabaseClient" %> - - Customer Session Page - - -

Your hostname: <%= HostUtils.getHostName() %>

+ + Customer Session Page + + +

Your hostname: <%= HostUtils.getHostName() %>

Your session ID: <%= request.getSession().getId() %>

You visited this page <%= CustomerDatabaseClient.increaseAndGetCounter(request) %> times.



diff --git a/examples/demo-template/customer-app/src/main/webapp/customers/view.jsp b/examples/demo-template/customer-app/src/main/webapp/customers/view.jsp index 55d19e7e3b..424faea734 100755 --- a/examples/demo-template/customer-app/src/main/webapp/customers/view.jsp +++ b/examples/demo-template/customer-app/src/main/webapp/customers/view.jsp @@ -1,9 +1,9 @@ <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %> +<%@ page import="org.keycloak.common.util.KeycloakUriBuilder" %> <%@ page import="org.keycloak.constants.ServiceUrlConstants" %> <%@ page import="org.keycloak.example.CustomerDatabaseClient" %> <%@ page import="org.keycloak.representations.IDToken" %> -<%@ page import="org.keycloak.common.util.KeycloakUriBuilder" %> <%@ page session="false" %> diff --git a/examples/demo-template/database-service/src/main/java/org/keycloak/example/oauth/CustomerService.java b/examples/demo-template/database-service/src/main/java/org/keycloak/example/oauth/CustomerService.java index 3920cc4021..d2b193eb60 100755 --- a/examples/demo-template/database-service/src/main/java/org/keycloak/example/oauth/CustomerService.java +++ b/examples/demo-template/database-service/src/main/java/org/keycloak/example/oauth/CustomerService.java @@ -26,7 +26,6 @@ import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.Context; - import java.util.ArrayList; import java.util.List; diff --git a/examples/demo-template/offline-access-app/src/main/java/org/keycloak/example/OfflineAccessPortalServlet.java b/examples/demo-template/offline-access-app/src/main/java/org/keycloak/example/OfflineAccessPortalServlet.java index c4e4215df5..3783c1248c 100755 --- a/examples/demo-template/offline-access-app/src/main/java/org/keycloak/example/OfflineAccessPortalServlet.java +++ b/examples/demo-template/offline-access-app/src/main/java/org/keycloak/example/OfflineAccessPortalServlet.java @@ -17,37 +17,36 @@ package org.keycloak.example; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.List; - -import javax.security.cert.X509Certificate; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.DefaultHttpClient; import org.keycloak.KeycloakSecurityContext; import org.keycloak.adapters.AdapterDeploymentContext; -import org.keycloak.adapters.spi.AuthenticationError; -import org.keycloak.adapters.spi.HttpFacade; import org.keycloak.adapters.KeycloakDeployment; import org.keycloak.adapters.RefreshableKeycloakSecurityContext; import org.keycloak.adapters.ServerRequest; +import org.keycloak.adapters.spi.AuthenticationError; +import org.keycloak.adapters.spi.HttpFacade; import org.keycloak.adapters.spi.LogoutError; +import org.keycloak.common.util.StreamUtil; +import org.keycloak.common.util.Time; +import org.keycloak.common.util.UriUtils; import org.keycloak.jose.jws.JWSInputException; import org.keycloak.representations.AccessTokenResponse; import org.keycloak.representations.RefreshToken; import org.keycloak.util.JsonSerialization; import org.keycloak.util.TokenUtil; -import org.keycloak.common.util.StreamUtil; -import org.keycloak.common.util.Time; -import org.keycloak.common.util.UriUtils; + +import javax.security.cert.X509Certificate; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; /** * @author Marek Posolda diff --git a/examples/demo-template/offline-access-app/src/main/java/org/keycloak/example/OfflineExampleUris.java b/examples/demo-template/offline-access-app/src/main/java/org/keycloak/example/OfflineExampleUris.java index 27e7313a0b..b8b4abd9a0 100644 --- a/examples/demo-template/offline-access-app/src/main/java/org/keycloak/example/OfflineExampleUris.java +++ b/examples/demo-template/offline-access-app/src/main/java/org/keycloak/example/OfflineExampleUris.java @@ -17,8 +17,8 @@ package org.keycloak.example; -import org.keycloak.constants.ServiceUrlConstants; import org.keycloak.common.util.KeycloakUriBuilder; +import org.keycloak.constants.ServiceUrlConstants; /** * @author Marek Posolda diff --git a/examples/demo-template/offline-access-app/src/main/java/org/keycloak/example/RefreshTokenDAO.java b/examples/demo-template/offline-access-app/src/main/java/org/keycloak/example/RefreshTokenDAO.java index 0fcef4acd3..e4c627799d 100644 --- a/examples/demo-template/offline-access-app/src/main/java/org/keycloak/example/RefreshTokenDAO.java +++ b/examples/demo-template/offline-access-app/src/main/java/org/keycloak/example/RefreshTokenDAO.java @@ -17,6 +17,8 @@ package org.keycloak.example; +import org.keycloak.common.util.StreamUtil; + import java.io.BufferedWriter; import java.io.FileInputStream; import java.io.FileNotFoundException; @@ -24,8 +26,6 @@ import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; -import org.keycloak.common.util.StreamUtil; - /** * Very simple DAO, which stores/loads just one token per whole application into file in tmp directory. Useful just for example purposes. * In real environment, token should be stored in database. diff --git a/examples/demo-template/product-app/src/main/webapp/products/view.jsp b/examples/demo-template/product-app/src/main/webapp/products/view.jsp index 29b750a154..b0a1592f10 100755 --- a/examples/demo-template/product-app/src/main/webapp/products/view.jsp +++ b/examples/demo-template/product-app/src/main/webapp/products/view.jsp @@ -1,8 +1,8 @@ <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> +<%@ page import="org.keycloak.common.util.KeycloakUriBuilder" %> <%@ page import="org.keycloak.constants.ServiceUrlConstants" %> <%@ page import="org.keycloak.example.oauth.ProductDatabaseClient" %> -<%@ page import="org.keycloak.common.util.KeycloakUriBuilder" %> <%@ page session="false" %> diff --git a/examples/demo-template/service-account/src/main/java/org/keycloak/example/ProductServiceAccountServlet.java b/examples/demo-template/service-account/src/main/java/org/keycloak/example/ProductServiceAccountServlet.java index 72ffd4959b..78aeebef3b 100644 --- a/examples/demo-template/service-account/src/main/java/org/keycloak/example/ProductServiceAccountServlet.java +++ b/examples/demo-template/service-account/src/main/java/org/keycloak/example/ProductServiceAccountServlet.java @@ -17,19 +17,6 @@ package org.keycloak.example; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.NameValuePair; @@ -40,17 +27,28 @@ import org.apache.http.client.methods.HttpPost; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.message.BasicNameValuePair; import org.keycloak.OAuth2Constants; -import org.keycloak.RSATokenVerifier; -import org.keycloak.adapters.rotation.AdapterRSATokenVerifier; -import org.keycloak.common.VerificationException; import org.keycloak.adapters.KeycloakDeployment; import org.keycloak.adapters.KeycloakDeploymentBuilder; import org.keycloak.adapters.ServerRequest; import org.keycloak.adapters.authentication.ClientCredentialsProviderUtils; +import org.keycloak.adapters.rotation.AdapterRSATokenVerifier; +import org.keycloak.common.VerificationException; +import org.keycloak.common.util.UriUtils; import org.keycloak.representations.AccessToken; import org.keycloak.representations.AccessTokenResponse; import org.keycloak.util.JsonSerialization; -import org.keycloak.common.util.UriUtils; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * @author Marek Posolda diff --git a/examples/demo-template/service-account/src/main/webapp/WEB-INF/page.jsp b/examples/demo-template/service-account/src/main/webapp/WEB-INF/page.jsp index 8ca1201ea6..5c76e639e0 100644 --- a/examples/demo-template/service-account/src/main/webapp/WEB-INF/page.jsp +++ b/examples/demo-template/service-account/src/main/webapp/WEB-INF/page.jsp @@ -1,9 +1,9 @@ <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %> -<%@ page import="org.keycloak.example.ProductServiceAccountServlet" %> -<%@ page import="org.keycloak.representations.AccessToken" %> <%@ page import="org.keycloak.common.constants.ServiceAccountConstants" %> <%@ page import="org.keycloak.common.util.Time" %> +<%@ page import="org.keycloak.example.ProductServiceAccountServlet" %> +<%@ page import="org.keycloak.representations.AccessToken" %> Service account portal diff --git a/examples/demo-template/third-party/src/main/java/org/keycloak/example/oauth/ProductDatabaseClient.java b/examples/demo-template/third-party/src/main/java/org/keycloak/example/oauth/ProductDatabaseClient.java index 11f9559f6e..f5076d6ddd 100755 --- a/examples/demo-template/third-party/src/main/java/org/keycloak/example/oauth/ProductDatabaseClient.java +++ b/examples/demo-template/third-party/src/main/java/org/keycloak/example/oauth/ProductDatabaseClient.java @@ -24,10 +24,10 @@ import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.DefaultHttpClient; import org.keycloak.KeycloakSecurityContext; import org.keycloak.adapters.ServerRequest; +import org.keycloak.common.util.UriUtils; import org.keycloak.representations.AccessTokenResponse; import org.keycloak.servlet.ServletOAuthClient; import org.keycloak.util.JsonSerialization; -import org.keycloak.common.util.UriUtils; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; diff --git a/examples/fuse/camel/src/main/java/org/keycloak/example/CamelHelloProcessor.java b/examples/fuse/camel/src/main/java/org/keycloak/example/CamelHelloProcessor.java index 52259cba93..ba0d852fbc 100644 --- a/examples/fuse/camel/src/main/java/org/keycloak/example/CamelHelloProcessor.java +++ b/examples/fuse/camel/src/main/java/org/keycloak/example/CamelHelloProcessor.java @@ -17,13 +17,13 @@ package org.keycloak.example; -import javax.servlet.http.HttpServletRequest; - import org.apache.camel.Exchange; import org.apache.camel.Processor; import org.keycloak.KeycloakPrincipal; import org.keycloak.representations.AccessToken; +import javax.servlet.http.HttpServletRequest; + /** * @author Marek Posolda */ diff --git a/examples/fuse/camel/src/main/resources/OSGI-INF/blueprint/blueprint.xml b/examples/fuse/camel/src/main/resources/OSGI-INF/blueprint/blueprint.xml index 56550d681a..698fdd05cf 100644 --- a/examples/fuse/camel/src/main/resources/OSGI-INF/blueprint/blueprint.xml +++ b/examples/fuse/camel/src/main/resources/OSGI-INF/blueprint/blueprint.xml @@ -18,7 +18,6 @@ diff --git a/examples/fuse/customer-app-fuse/src/main/java/org/keycloak/example/CamelClient.java b/examples/fuse/customer-app-fuse/src/main/java/org/keycloak/example/CamelClient.java index db7f797f8d..00499e0bd9 100644 --- a/examples/fuse/customer-app-fuse/src/main/java/org/keycloak/example/CamelClient.java +++ b/examples/fuse/customer-app-fuse/src/main/java/org/keycloak/example/CamelClient.java @@ -17,13 +17,6 @@ package org.keycloak.example; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; - -import javax.servlet.http.HttpServletRequest; - import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; @@ -31,6 +24,12 @@ import org.apache.http.client.methods.HttpGet; import org.keycloak.KeycloakSecurityContext; import org.keycloak.adapters.HttpClientBuilder; +import javax.servlet.http.HttpServletRequest; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; + /** * @author Marek Posolda */ diff --git a/examples/fuse/customer-app-fuse/src/main/java/org/keycloak/example/CxfRsClient.java b/examples/fuse/customer-app-fuse/src/main/java/org/keycloak/example/CxfRsClient.java index 3a920f233f..8c54a82cca 100644 --- a/examples/fuse/customer-app-fuse/src/main/java/org/keycloak/example/CxfRsClient.java +++ b/examples/fuse/customer-app-fuse/src/main/java/org/keycloak/example/CxfRsClient.java @@ -17,22 +17,21 @@ package org.keycloak.example; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.List; - -import javax.servlet.http.HttpServletRequest; - import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpGet; import org.keycloak.KeycloakSecurityContext; import org.keycloak.adapters.HttpClientBuilder; +import org.keycloak.common.util.UriUtils; import org.keycloak.representations.IDToken; import org.keycloak.util.JsonSerialization; -import org.keycloak.common.util.UriUtils; + +import javax.servlet.http.HttpServletRequest; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; /** * @author Bill Burke diff --git a/examples/fuse/customer-app-fuse/src/main/webapp/customers/camel.jsp b/examples/fuse/customer-app-fuse/src/main/webapp/customers/camel.jsp index 6b7c5913b6..938b6e69be 100755 --- a/examples/fuse/customer-app-fuse/src/main/webapp/customers/camel.jsp +++ b/examples/fuse/customer-app-fuse/src/main/webapp/customers/camel.jsp @@ -1,15 +1,13 @@ <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %> -<%@ page import="org.keycloak.constants.ServiceUrlConstants" %> <%@ page import="org.keycloak.example.CamelClient" %> -<%@ page import="org.keycloak.representations.IDToken" %> - - Camel page - - -

You will receive info from camel endpoint. Endpoint is accessible just for user with admin role

-

Response from camel: <%= CamelClient.sendRequest(request) %>

+ + Camel page + + +

You will receive info from camel endpoint. Endpoint is accessible just for user with admin role

+

Response from camel: <%= CamelClient.sendRequest(request) %>



\ No newline at end of file diff --git a/examples/fuse/customer-app-fuse/src/main/webapp/customers/cxf-rs.jsp b/examples/fuse/customer-app-fuse/src/main/webapp/customers/cxf-rs.jsp index f1b63d7a01..b9e2f319b8 100755 --- a/examples/fuse/customer-app-fuse/src/main/webapp/customers/cxf-rs.jsp +++ b/examples/fuse/customer-app-fuse/src/main/webapp/customers/cxf-rs.jsp @@ -1,9 +1,9 @@ <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %> +<%@ page import="org.keycloak.common.util.KeycloakUriBuilder" %> <%@ page import="org.keycloak.constants.ServiceUrlConstants" %> <%@ page import="org.keycloak.example.CxfRsClient" %> <%@ page import="org.keycloak.representations.IDToken" %> -<%@ page import="org.keycloak.common.util.KeycloakUriBuilder" %> <%@ page session="false" %> diff --git a/examples/fuse/cxf-jaxrs/src/main/java/org/keycloak/example/rs/CxfCustomerService.java b/examples/fuse/cxf-jaxrs/src/main/java/org/keycloak/example/rs/CxfCustomerService.java index a0ad78d889..184391fe0d 100644 --- a/examples/fuse/cxf-jaxrs/src/main/java/org/keycloak/example/rs/CxfCustomerService.java +++ b/examples/fuse/cxf-jaxrs/src/main/java/org/keycloak/example/rs/CxfCustomerService.java @@ -17,12 +17,11 @@ package org.keycloak.example.rs; -import java.util.ArrayList; -import java.util.List; - import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; +import java.util.ArrayList; +import java.util.List; /** * @author Bill Burke diff --git a/examples/fuse/cxf-jaxws/src/main/java/org/keycloak/example/ws/Product.java b/examples/fuse/cxf-jaxws/src/main/java/org/keycloak/example/ws/Product.java index 9028e35dcc..90023bae34 100644 --- a/examples/fuse/cxf-jaxws/src/main/java/org/keycloak/example/ws/Product.java +++ b/examples/fuse/cxf-jaxws/src/main/java/org/keycloak/example/ws/Product.java @@ -17,6 +17,8 @@ package org.keycloak.example.ws; +import org.keycloak.example.ws.types.ObjectFactory; + import javax.jws.WebMethod; import javax.jws.WebParam; import javax.jws.WebService; @@ -24,8 +26,6 @@ import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.ws.RequestWrapper; import javax.xml.ws.ResponseWrapper; -import org.keycloak.example.ws.types.ObjectFactory; - @WebService @XmlSeeAlso({ObjectFactory.class}) public interface Product { diff --git a/examples/fuse/cxf-jaxws/src/main/resources/META-INF/spring/beans.xml b/examples/fuse/cxf-jaxws/src/main/resources/META-INF/spring/beans.xml index 8a808c623c..4f9af70ab9 100644 --- a/examples/fuse/cxf-jaxws/src/main/resources/META-INF/spring/beans.xml +++ b/examples/fuse/cxf-jaxws/src/main/resources/META-INF/spring/beans.xml @@ -21,10 +21,9 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration" - xsi:schemaLocation=" - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd - http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd + http://cxf.apache.org/transports/http-jetty/configuration http://cxf.apache.org/schemas/configuration/http-jetty.xsd"> diff --git a/examples/fuse/product-app-fuse/src/main/java/org/keycloak/example/ProductPortalServlet.java b/examples/fuse/product-app-fuse/src/main/java/org/keycloak/example/ProductPortalServlet.java index 4b96f3bd1b..15ca868c27 100644 --- a/examples/fuse/product-app-fuse/src/main/java/org/keycloak/example/ProductPortalServlet.java +++ b/examples/fuse/product-app-fuse/src/main/java/org/keycloak/example/ProductPortalServlet.java @@ -17,28 +17,27 @@ package org.keycloak.example; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import org.apache.cxf.endpoint.Client; +import org.apache.cxf.frontend.ClientProxy; +import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; +import org.apache.cxf.message.Message; +import org.keycloak.KeycloakSecurityContext; +import org.keycloak.common.util.KeycloakUriBuilder; +import org.keycloak.constants.ServiceUrlConstants; +import org.keycloak.example.ws.Product; +import org.keycloak.example.ws.UnknownProductFault; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.xml.ws.WebServiceException; - -import org.apache.cxf.endpoint.Client; -import org.apache.cxf.frontend.ClientProxy; -import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; -import org.apache.cxf.message.Message; -import org.keycloak.KeycloakSecurityContext; -import org.keycloak.constants.ServiceUrlConstants; -import org.keycloak.example.ws.Product; -import org.keycloak.example.ws.UnknownProductFault; -import org.keycloak.common.util.KeycloakUriBuilder; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * Servlet for receiving informations about products from backend JAXWS service diff --git a/examples/kerberos/src/main/java/org/keycloak/example/kerberos/GSSCredentialsClient.java b/examples/kerberos/src/main/java/org/keycloak/example/kerberos/GSSCredentialsClient.java index ef8ba512d4..7a9f3e2084 100644 --- a/examples/kerberos/src/main/java/org/keycloak/example/kerberos/GSSCredentialsClient.java +++ b/examples/kerberos/src/main/java/org/keycloak/example/kerberos/GSSCredentialsClient.java @@ -17,7 +17,11 @@ package org.keycloak.example.kerberos; -import java.util.Hashtable; +import org.ietf.jgss.GSSCredential; +import org.keycloak.KeycloakPrincipal; +import org.keycloak.common.constants.KerberosConstants; +import org.keycloak.common.util.KerberosSerializationUtils; +import org.keycloak.representations.AccessToken; import javax.naming.Context; import javax.naming.NamingException; @@ -26,12 +30,7 @@ import javax.naming.directory.DirContext; import javax.naming.directory.InitialDirContext; import javax.security.sasl.Sasl; import javax.servlet.http.HttpServletRequest; - -import org.ietf.jgss.GSSCredential; -import org.keycloak.KeycloakPrincipal; -import org.keycloak.common.constants.KerberosConstants; -import org.keycloak.representations.AccessToken; -import org.keycloak.common.util.KerberosSerializationUtils; +import java.util.Hashtable; /** * Sample client able to authenticate against ApacheDS LDAP server with Krb5 GSS Credential. diff --git a/examples/kerberos/src/main/webapp/index.jsp b/examples/kerberos/src/main/webapp/index.jsp index e680d93d07..5bb95b0c68 100644 --- a/examples/kerberos/src/main/webapp/index.jsp +++ b/examples/kerberos/src/main/webapp/index.jsp @@ -1,9 +1,8 @@ <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %> -<%@ page import="org.keycloak.constants.ServiceUrlConstants" %> <%@ page import="org.keycloak.common.util.KeycloakUriBuilder" %> +<%@ page import="org.keycloak.constants.ServiceUrlConstants" %> <%@ page import="org.keycloak.example.kerberos.GSSCredentialsClient" %> -<%@ page import="org.keycloak.example.kerberos.GSSCredentialsClient.LDAPUser" %> <%@ page session="false" %> -<%@ page import="org.keycloak.constants.ServiceUrlConstants" %> -<%@ page import="org.keycloak.common.util.KeycloakUriBuilder" %> <%@ page import="org.keycloak.KeycloakSecurityContext" %> -<%@ page import="org.keycloak.representations.IDToken" %> +<%@ page import="org.keycloak.common.util.KeycloakUriBuilder" %> +<%@ page import="org.keycloak.constants.ServiceUrlConstants" %> <%@ page import="org.keycloak.representations.AccessToken" %> <%@ page import="org.keycloak.representations.AccessToken.Access" %> +<%@ page import="org.keycloak.representations.IDToken" %> <%@ page import="java.util.Map" %> <%@ page session="false" %> diff --git a/examples/multi-tenant/src/main/java/org/keycloak/example/multitenant/control/PathBasedKeycloakConfigResolver.java b/examples/multi-tenant/src/main/java/org/keycloak/example/multitenant/control/PathBasedKeycloakConfigResolver.java index 2883ee8a86..904da96408 100755 --- a/examples/multi-tenant/src/main/java/org/keycloak/example/multitenant/control/PathBasedKeycloakConfigResolver.java +++ b/examples/multi-tenant/src/main/java/org/keycloak/example/multitenant/control/PathBasedKeycloakConfigResolver.java @@ -16,15 +16,15 @@ */ package org.keycloak.example.multitenant.control; -import java.io.InputStream; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - import org.keycloak.adapters.KeycloakConfigResolver; import org.keycloak.adapters.KeycloakDeployment; import org.keycloak.adapters.KeycloakDeploymentBuilder; import org.keycloak.adapters.OIDCHttpFacade; +import java.io.InputStream; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + /** * * @author Juraci Paixão Kröhling diff --git a/examples/providers/authenticator/src/main/java/org/keycloak/examples/authenticator/SecretQuestionCredentialProvider.java b/examples/providers/authenticator/src/main/java/org/keycloak/examples/authenticator/SecretQuestionCredentialProvider.java index 520aeb0080..151fa0158d 100644 --- a/examples/providers/authenticator/src/main/java/org/keycloak/examples/authenticator/SecretQuestionCredentialProvider.java +++ b/examples/providers/authenticator/src/main/java/org/keycloak/examples/authenticator/SecretQuestionCredentialProvider.java @@ -22,7 +22,6 @@ import org.keycloak.credential.CredentialInputUpdater; import org.keycloak.credential.CredentialInputValidator; import org.keycloak.credential.CredentialModel; import org.keycloak.credential.CredentialProvider; -import org.keycloak.credential.PasswordCredentialProvider; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; import org.keycloak.models.UserCredentialModel; diff --git a/examples/providers/authenticator/src/main/java/org/keycloak/examples/authenticator/SecretQuestionRequiredAction.java b/examples/providers/authenticator/src/main/java/org/keycloak/examples/authenticator/SecretQuestionRequiredAction.java index a1a65459e7..cc1425e742 100755 --- a/examples/providers/authenticator/src/main/java/org/keycloak/examples/authenticator/SecretQuestionRequiredAction.java +++ b/examples/providers/authenticator/src/main/java/org/keycloak/examples/authenticator/SecretQuestionRequiredAction.java @@ -20,7 +20,6 @@ package org.keycloak.examples.authenticator; import org.keycloak.authentication.RequiredActionContext; import org.keycloak.authentication.RequiredActionProvider; import org.keycloak.models.UserCredentialModel; -import org.keycloak.models.UserCredentialValueModel; import javax.ws.rs.core.Response; diff --git a/examples/providers/domain-extension/src/main/java/org/keycloak/examples/domainextension/jpa/ExampleJpaEntityProvider.java b/examples/providers/domain-extension/src/main/java/org/keycloak/examples/domainextension/jpa/ExampleJpaEntityProvider.java index b6529fd707..fe22b27a7d 100644 --- a/examples/providers/domain-extension/src/main/java/org/keycloak/examples/domainextension/jpa/ExampleJpaEntityProvider.java +++ b/examples/providers/domain-extension/src/main/java/org/keycloak/examples/domainextension/jpa/ExampleJpaEntityProvider.java @@ -17,11 +17,11 @@ package org.keycloak.examples.domainextension.jpa; +import org.keycloak.connections.jpa.entityprovider.JpaEntityProvider; + import java.util.Collections; import java.util.List; -import org.keycloak.connections.jpa.entityprovider.JpaEntityProvider; - /** * @author Erik Mulder * diff --git a/examples/providers/domain-extension/src/main/java/org/keycloak/examples/domainextension/rest/CompanyResource.java b/examples/providers/domain-extension/src/main/java/org/keycloak/examples/domainextension/rest/CompanyResource.java index ba98978239..7f9d7aaaa0 100644 --- a/examples/providers/domain-extension/src/main/java/org/keycloak/examples/domainextension/rest/CompanyResource.java +++ b/examples/providers/domain-extension/src/main/java/org/keycloak/examples/domainextension/rest/CompanyResource.java @@ -1,6 +1,9 @@ package org.keycloak.examples.domainextension.rest; -import java.util.List; +import org.jboss.resteasy.annotations.cache.NoCache; +import org.keycloak.examples.domainextension.CompanyRepresentation; +import org.keycloak.examples.domainextension.spi.ExampleService; +import org.keycloak.models.KeycloakSession; import javax.ws.rs.Consumes; import javax.ws.rs.GET; @@ -10,11 +13,7 @@ import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; - -import org.jboss.resteasy.annotations.cache.NoCache; -import org.keycloak.examples.domainextension.CompanyRepresentation; -import org.keycloak.examples.domainextension.spi.ExampleService; -import org.keycloak.models.KeycloakSession; +import java.util.List; public class CompanyResource { diff --git a/examples/providers/domain-extension/src/main/java/org/keycloak/examples/domainextension/rest/ExampleRestResource.java b/examples/providers/domain-extension/src/main/java/org/keycloak/examples/domainextension/rest/ExampleRestResource.java index db774cf382..df642f5fbd 100644 --- a/examples/providers/domain-extension/src/main/java/org/keycloak/examples/domainextension/rest/ExampleRestResource.java +++ b/examples/providers/domain-extension/src/main/java/org/keycloak/examples/domainextension/rest/ExampleRestResource.java @@ -1,14 +1,13 @@ package org.keycloak.examples.domainextension.rest; -import javax.ws.rs.ForbiddenException; -import javax.ws.rs.NotAuthorizedException; -import javax.ws.rs.Path; - - import org.keycloak.models.KeycloakSession; import org.keycloak.services.managers.AppAuthManager; import org.keycloak.services.managers.AuthenticationManager; +import javax.ws.rs.ForbiddenException; +import javax.ws.rs.NotAuthorizedException; +import javax.ws.rs.Path; + public class ExampleRestResource { private final KeycloakSession session; diff --git a/examples/providers/domain-extension/src/main/java/org/keycloak/examples/domainextension/spi/ExampleService.java b/examples/providers/domain-extension/src/main/java/org/keycloak/examples/domainextension/spi/ExampleService.java index 7f41327102..78ecc15154 100644 --- a/examples/providers/domain-extension/src/main/java/org/keycloak/examples/domainextension/spi/ExampleService.java +++ b/examples/providers/domain-extension/src/main/java/org/keycloak/examples/domainextension/spi/ExampleService.java @@ -17,11 +17,11 @@ package org.keycloak.examples.domainextension.spi; -import java.util.List; - import org.keycloak.examples.domainextension.CompanyRepresentation; import org.keycloak.provider.Provider; +import java.util.List; + public interface ExampleService extends Provider { List listCompanies(); diff --git a/examples/providers/domain-extension/src/main/java/org/keycloak/examples/domainextension/spi/impl/ExampleServiceImpl.java b/examples/providers/domain-extension/src/main/java/org/keycloak/examples/domainextension/spi/impl/ExampleServiceImpl.java index 49cc228103..8863a9bec3 100644 --- a/examples/providers/domain-extension/src/main/java/org/keycloak/examples/domainextension/spi/impl/ExampleServiceImpl.java +++ b/examples/providers/domain-extension/src/main/java/org/keycloak/examples/domainextension/spi/impl/ExampleServiceImpl.java @@ -17,19 +17,18 @@ package org.keycloak.examples.domainextension.spi.impl; -import java.util.LinkedList; -import java.util.List; - -import javax.persistence.EntityManager; - import org.keycloak.connections.jpa.JpaConnectionProvider; -import org.keycloak.examples.domainextension.jpa.Company; import org.keycloak.examples.domainextension.CompanyRepresentation; +import org.keycloak.examples.domainextension.jpa.Company; import org.keycloak.examples.domainextension.spi.ExampleService; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; import org.keycloak.models.utils.KeycloakModelUtils; +import javax.persistence.EntityManager; +import java.util.LinkedList; +import java.util.List; + public class ExampleServiceImpl implements ExampleService { private final KeycloakSession session; diff --git a/examples/providers/event-listener-sysout/src/main/java/org/keycloak/examples/providers/events/SysoutEventListenerProvider.java b/examples/providers/event-listener-sysout/src/main/java/org/keycloak/examples/providers/events/SysoutEventListenerProvider.java index 74208589a5..91d2a3067d 100755 --- a/examples/providers/event-listener-sysout/src/main/java/org/keycloak/examples/providers/events/SysoutEventListenerProvider.java +++ b/examples/providers/event-listener-sysout/src/main/java/org/keycloak/examples/providers/events/SysoutEventListenerProvider.java @@ -17,11 +17,11 @@ package org.keycloak.examples.providers.events; -import org.keycloak.events.admin.AdminEvent; -import org.keycloak.events.admin.OperationType; import org.keycloak.events.Event; import org.keycloak.events.EventListenerProvider; import org.keycloak.events.EventType; +import org.keycloak.events.admin.AdminEvent; +import org.keycloak.events.admin.OperationType; import java.util.Map; import java.util.Set; diff --git a/examples/providers/event-store-mem/src/main/java/org/keycloak/examples/providers/events/MemAdminEventQuery.java b/examples/providers/event-store-mem/src/main/java/org/keycloak/examples/providers/events/MemAdminEventQuery.java index 168c709ef1..7736fb7d0f 100755 --- a/examples/providers/event-store-mem/src/main/java/org/keycloak/examples/providers/events/MemAdminEventQuery.java +++ b/examples/providers/event-store-mem/src/main/java/org/keycloak/examples/providers/events/MemAdminEventQuery.java @@ -17,17 +17,17 @@ package org.keycloak.examples.providers.events; +import org.keycloak.events.admin.AdminEvent; +import org.keycloak.events.admin.AdminEventQuery; +import org.keycloak.events.admin.OperationType; +import org.keycloak.events.admin.ResourceType; + import java.util.Collections; import java.util.Date; import java.util.Iterator; import java.util.List; import java.util.regex.Pattern; -import org.keycloak.events.admin.AdminEvent; -import org.keycloak.events.admin.AdminEventQuery; -import org.keycloak.events.admin.OperationType; -import org.keycloak.events.admin.ResourceType; - /** * @author Giriraj Sharma */ diff --git a/examples/providers/event-store-mem/src/main/java/org/keycloak/examples/providers/events/MemEventStoreProvider.java b/examples/providers/event-store-mem/src/main/java/org/keycloak/examples/providers/events/MemEventStoreProvider.java index 3df4e06e2f..b06f7ad00f 100755 --- a/examples/providers/event-store-mem/src/main/java/org/keycloak/examples/providers/events/MemEventStoreProvider.java +++ b/examples/providers/event-store-mem/src/main/java/org/keycloak/examples/providers/events/MemEventStoreProvider.java @@ -17,13 +17,13 @@ package org.keycloak.examples.providers.events; -import org.keycloak.events.admin.AdminEvent; -import org.keycloak.events.admin.AdminEventQuery; -import org.keycloak.events.admin.OperationType; import org.keycloak.events.Event; import org.keycloak.events.EventQuery; import org.keycloak.events.EventStoreProvider; import org.keycloak.events.EventType; +import org.keycloak.events.admin.AdminEvent; +import org.keycloak.events.admin.AdminEventQuery; +import org.keycloak.events.admin.OperationType; import java.util.Iterator; import java.util.LinkedList; diff --git a/examples/providers/federation-provider/src/main/java/org/keycloak/examples/federation/properties/ClasspathPropertiesFederationProvider.java b/examples/providers/federation-provider/src/main/java/org/keycloak/examples/federation/properties/ClasspathPropertiesFederationProvider.java index ee57104793..2a0597ccdb 100755 --- a/examples/providers/federation-provider/src/main/java/org/keycloak/examples/federation/properties/ClasspathPropertiesFederationProvider.java +++ b/examples/providers/federation-provider/src/main/java/org/keycloak/examples/federation/properties/ClasspathPropertiesFederationProvider.java @@ -20,7 +20,6 @@ package org.keycloak.examples.federation.properties; import org.keycloak.credential.CredentialInput; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; -import org.keycloak.models.UserCredentialModel; import org.keycloak.models.UserFederationProviderModel; import org.keycloak.models.UserModel; diff --git a/examples/providers/federation-provider/src/main/java/org/keycloak/examples/federation/properties/FilePropertiesFederationProvider.java b/examples/providers/federation-provider/src/main/java/org/keycloak/examples/federation/properties/FilePropertiesFederationProvider.java index bc506843f8..aac080ba88 100755 --- a/examples/providers/federation-provider/src/main/java/org/keycloak/examples/federation/properties/FilePropertiesFederationProvider.java +++ b/examples/providers/federation-provider/src/main/java/org/keycloak/examples/federation/properties/FilePropertiesFederationProvider.java @@ -20,7 +20,6 @@ package org.keycloak.examples.federation.properties; import org.keycloak.credential.CredentialInput; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; -import org.keycloak.models.UserCredentialModel; import org.keycloak.models.UserFederationProviderModel; import org.keycloak.models.UserModel; diff --git a/examples/providers/federation-provider/src/main/java/org/keycloak/examples/federation/properties/ReadonlyUserModelProxy.java b/examples/providers/federation-provider/src/main/java/org/keycloak/examples/federation/properties/ReadonlyUserModelProxy.java index 5a1e0df059..453c5aefeb 100755 --- a/examples/providers/federation-provider/src/main/java/org/keycloak/examples/federation/properties/ReadonlyUserModelProxy.java +++ b/examples/providers/federation-provider/src/main/java/org/keycloak/examples/federation/properties/ReadonlyUserModelProxy.java @@ -17,8 +17,6 @@ package org.keycloak.examples.federation.properties; -import org.keycloak.models.UserCredentialModel; -import org.keycloak.models.UserCredentialValueModel; import org.keycloak.models.UserModel; import org.keycloak.models.utils.UserModelDelegate; diff --git a/examples/providers/federation-provider/src/main/java/org/keycloak/examples/federation/properties/WritableUserModelProxy.java b/examples/providers/federation-provider/src/main/java/org/keycloak/examples/federation/properties/WritableUserModelProxy.java index e294f82dd3..c133675684 100755 --- a/examples/providers/federation-provider/src/main/java/org/keycloak/examples/federation/properties/WritableUserModelProxy.java +++ b/examples/providers/federation-provider/src/main/java/org/keycloak/examples/federation/properties/WritableUserModelProxy.java @@ -17,8 +17,6 @@ package org.keycloak.examples.federation.properties; -import org.keycloak.models.UserCredentialModel; -import org.keycloak.models.UserCredentialValueModel; import org.keycloak.models.UserModel; import org.keycloak.models.utils.UserModelDelegate; diff --git a/examples/providers/user-storage-jpa/src/main/java/org/keycloak/examples/storage/user/EjbExampleUserStorageProviderFactory.java b/examples/providers/user-storage-jpa/src/main/java/org/keycloak/examples/storage/user/EjbExampleUserStorageProviderFactory.java index 1e16100478..2881c87d13 100644 --- a/examples/providers/user-storage-jpa/src/main/java/org/keycloak/examples/storage/user/EjbExampleUserStorageProviderFactory.java +++ b/examples/providers/user-storage-jpa/src/main/java/org/keycloak/examples/storage/user/EjbExampleUserStorageProviderFactory.java @@ -17,16 +17,11 @@ package org.keycloak.examples.storage.user; import org.jboss.logging.Logger; -import org.keycloak.Config; import org.keycloak.component.ComponentModel; import org.keycloak.models.KeycloakSession; -import org.keycloak.models.KeycloakSessionFactory; -import org.keycloak.provider.ProviderConfigProperty; import org.keycloak.storage.UserStorageProviderFactory; import javax.naming.InitialContext; -import java.util.LinkedList; -import java.util.List; /** * @author Bill Burke diff --git a/examples/providers/user-storage-jpa/src/main/java/org/keycloak/examples/storage/user/UserAdapter.java b/examples/providers/user-storage-jpa/src/main/java/org/keycloak/examples/storage/user/UserAdapter.java index 8c8bcd6025..edb98f80db 100644 --- a/examples/providers/user-storage-jpa/src/main/java/org/keycloak/examples/storage/user/UserAdapter.java +++ b/examples/providers/user-storage-jpa/src/main/java/org/keycloak/examples/storage/user/UserAdapter.java @@ -21,7 +21,6 @@ import org.keycloak.common.util.MultivaluedHashMap; import org.keycloak.component.ComponentModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; -import org.keycloak.models.UserCredentialModel; import org.keycloak.storage.StorageId; import org.keycloak.storage.adapter.AbstractUserAdapterFederatedStorage; diff --git a/federation/kerberos/src/main/java/org/keycloak/federation/kerberos/CommonKerberosConfig.java b/federation/kerberos/src/main/java/org/keycloak/federation/kerberos/CommonKerberosConfig.java index 4d3bf62e12..7e3d6e70a2 100644 --- a/federation/kerberos/src/main/java/org/keycloak/federation/kerberos/CommonKerberosConfig.java +++ b/federation/kerberos/src/main/java/org/keycloak/federation/kerberos/CommonKerberosConfig.java @@ -17,10 +17,10 @@ package org.keycloak.federation.kerberos; -import java.util.Map; - -import org.keycloak.models.UserFederationProviderModel; import org.keycloak.common.constants.KerberosConstants; +import org.keycloak.models.UserFederationProviderModel; + +import java.util.Map; /** * Common configuration useful for all providers diff --git a/federation/kerberos/src/main/java/org/keycloak/federation/kerberos/KerberosFederationProvider.java b/federation/kerberos/src/main/java/org/keycloak/federation/kerberos/KerberosFederationProvider.java index 2d0b4b2f20..9d82655a27 100755 --- a/federation/kerberos/src/main/java/org/keycloak/federation/kerberos/KerberosFederationProvider.java +++ b/federation/kerberos/src/main/java/org/keycloak/federation/kerberos/KerberosFederationProvider.java @@ -17,15 +17,8 @@ package org.keycloak.federation.kerberos; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - import org.jboss.logging.Logger; +import org.keycloak.common.constants.KerberosConstants; import org.keycloak.credential.CredentialInput; import org.keycloak.credential.CredentialModel; import org.keycloak.federation.kerberos.impl.KerberosUsernamePasswordAuthenticator; @@ -37,13 +30,17 @@ import org.keycloak.models.ModelReadOnlyException; import org.keycloak.models.RealmModel; import org.keycloak.models.RoleModel; import org.keycloak.models.UserCredentialModel; -import org.keycloak.models.UserCredentialValueModel; import org.keycloak.models.UserFederationProvider; import org.keycloak.models.UserFederationProviderModel; import org.keycloak.models.UserModel; -import org.keycloak.common.constants.KerberosConstants; import org.keycloak.services.managers.UserManager; -import org.keycloak.storage.adapter.AbstractUserAdapter; + +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; /** * @author Marek Posolda diff --git a/federation/kerberos/src/main/java/org/keycloak/federation/kerberos/KerberosFederationProviderFactory.java b/federation/kerberos/src/main/java/org/keycloak/federation/kerberos/KerberosFederationProviderFactory.java index f016835c01..3e713df00b 100755 --- a/federation/kerberos/src/main/java/org/keycloak/federation/kerberos/KerberosFederationProviderFactory.java +++ b/federation/kerberos/src/main/java/org/keycloak/federation/kerberos/KerberosFederationProviderFactory.java @@ -17,10 +17,6 @@ package org.keycloak.federation.kerberos; -import java.util.Collections; -import java.util.Date; -import java.util.Set; - import org.jboss.logging.Logger; import org.keycloak.Config; import org.keycloak.federation.kerberos.impl.KerberosServerSubjectAuthenticator; @@ -33,6 +29,10 @@ import org.keycloak.models.UserFederationProviderFactory; import org.keycloak.models.UserFederationProviderModel; import org.keycloak.models.UserFederationSyncResult; +import java.util.Collections; +import java.util.Date; +import java.util.Set; + /** * Factory for standalone Kerberos federation provider. Standalone means that it's not backed by LDAP. For Kerberos backed by LDAP (like MS AD or ApacheDS environment) * you should rather use LDAP Federation Provider. diff --git a/federation/kerberos/src/main/java/org/keycloak/federation/kerberos/ReadOnlyKerberosUserModelDelegate.java b/federation/kerberos/src/main/java/org/keycloak/federation/kerberos/ReadOnlyKerberosUserModelDelegate.java index 2a4e3b161f..8e64b3dfc4 100644 --- a/federation/kerberos/src/main/java/org/keycloak/federation/kerberos/ReadOnlyKerberosUserModelDelegate.java +++ b/federation/kerberos/src/main/java/org/keycloak/federation/kerberos/ReadOnlyKerberosUserModelDelegate.java @@ -17,8 +17,6 @@ package org.keycloak.federation.kerberos; -import org.keycloak.models.ModelReadOnlyException; -import org.keycloak.models.UserCredentialModel; import org.keycloak.models.UserModel; import org.keycloak.models.utils.UserModelDelegate; diff --git a/federation/kerberos/src/main/java/org/keycloak/federation/kerberos/impl/KerberosServerSubjectAuthenticator.java b/federation/kerberos/src/main/java/org/keycloak/federation/kerberos/impl/KerberosServerSubjectAuthenticator.java index aeaa07414c..4d509360e2 100644 --- a/federation/kerberos/src/main/java/org/keycloak/federation/kerberos/impl/KerberosServerSubjectAuthenticator.java +++ b/federation/kerberos/src/main/java/org/keycloak/federation/kerberos/impl/KerberosServerSubjectAuthenticator.java @@ -17,7 +17,9 @@ package org.keycloak.federation.kerberos.impl; -import java.io.IOException; +import org.jboss.logging.Logger; +import org.keycloak.common.util.KerberosJdkProvider; +import org.keycloak.federation.kerberos.CommonKerberosConfig; import javax.security.auth.Subject; import javax.security.auth.callback.Callback; @@ -26,10 +28,7 @@ import javax.security.auth.callback.UnsupportedCallbackException; import javax.security.auth.login.Configuration; import javax.security.auth.login.LoginContext; import javax.security.auth.login.LoginException; - -import org.jboss.logging.Logger; -import org.keycloak.common.util.KerberosJdkProvider; -import org.keycloak.federation.kerberos.CommonKerberosConfig; +import java.io.IOException; /** * @author Marek Posolda diff --git a/federation/kerberos/src/main/java/org/keycloak/federation/kerberos/impl/KerberosUsernamePasswordAuthenticator.java b/federation/kerberos/src/main/java/org/keycloak/federation/kerberos/impl/KerberosUsernamePasswordAuthenticator.java index 2254a6e87f..c36694c070 100644 --- a/federation/kerberos/src/main/java/org/keycloak/federation/kerberos/impl/KerberosUsernamePasswordAuthenticator.java +++ b/federation/kerberos/src/main/java/org/keycloak/federation/kerberos/impl/KerberosUsernamePasswordAuthenticator.java @@ -17,9 +17,10 @@ package org.keycloak.federation.kerberos.impl; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; +import org.jboss.logging.Logger; +import org.keycloak.common.util.KerberosJdkProvider; +import org.keycloak.federation.kerberos.CommonKerberosConfig; +import org.keycloak.models.ModelException; import javax.security.auth.Subject; import javax.security.auth.callback.Callback; @@ -27,15 +28,10 @@ import javax.security.auth.callback.CallbackHandler; import javax.security.auth.callback.NameCallback; import javax.security.auth.callback.PasswordCallback; import javax.security.auth.callback.UnsupportedCallbackException; -import javax.security.auth.login.AppConfigurationEntry; import javax.security.auth.login.Configuration; import javax.security.auth.login.LoginContext; import javax.security.auth.login.LoginException; - -import org.jboss.logging.Logger; -import org.keycloak.common.util.KerberosJdkProvider; -import org.keycloak.federation.kerberos.CommonKerberosConfig; -import org.keycloak.models.ModelException; +import java.io.IOException; /** * @author Marek Posolda diff --git a/federation/kerberos/src/main/java/org/keycloak/federation/kerberos/impl/SPNEGOAuthenticator.java b/federation/kerberos/src/main/java/org/keycloak/federation/kerberos/impl/SPNEGOAuthenticator.java index c2b928ec0e..51bf027689 100644 --- a/federation/kerberos/src/main/java/org/keycloak/federation/kerberos/impl/SPNEGOAuthenticator.java +++ b/federation/kerberos/src/main/java/org/keycloak/federation/kerberos/impl/SPNEGOAuthenticator.java @@ -17,25 +17,23 @@ package org.keycloak.federation.kerberos.impl; -import java.io.IOException; -import java.security.PrivilegedExceptionAction; -import java.util.Iterator; -import java.util.Set; - -import javax.security.auth.Subject; -import javax.security.auth.kerberos.KerberosTicket; - -import org.ietf.jgss.Oid; -import org.keycloak.common.constants.KerberosConstants; -import org.keycloak.common.util.Base64; import org.ietf.jgss.GSSContext; import org.ietf.jgss.GSSCredential; import org.ietf.jgss.GSSException; import org.ietf.jgss.GSSManager; +import org.ietf.jgss.Oid; import org.jboss.logging.Logger; -import org.keycloak.common.util.KerberosJdkProvider; -import org.keycloak.federation.kerberos.CommonKerberosConfig; +import org.keycloak.common.constants.KerberosConstants; +import org.keycloak.common.util.Base64; import org.keycloak.common.util.KerberosSerializationUtils; +import org.keycloak.federation.kerberos.CommonKerberosConfig; + +import javax.security.auth.Subject; +import javax.security.auth.kerberos.KerberosTicket; +import java.io.IOException; +import java.security.PrivilegedExceptionAction; +import java.util.Iterator; +import java.util.Set; /** * @author Marek Posolda diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/LDAPConfig.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/LDAPConfig.java index eb8eaaab27..7d32e6a122 100644 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/LDAPConfig.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/LDAPConfig.java @@ -17,17 +17,16 @@ package org.keycloak.federation.ldap; +import org.keycloak.models.LDAPConstants; +import org.keycloak.models.UserFederationProvider; + +import javax.naming.directory.SearchControls; import java.util.Collection; import java.util.HashSet; import java.util.Map; import java.util.Properties; import java.util.Set; -import javax.naming.directory.SearchControls; - -import org.keycloak.models.LDAPConstants; -import org.keycloak.models.UserFederationProvider; - /** * @author Marek Posolda * diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/LDAPFederationProvider.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/LDAPFederationProvider.java index d16deaf5b6..14c99a67be 100755 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/LDAPFederationProvider.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/LDAPFederationProvider.java @@ -18,8 +18,8 @@ package org.keycloak.federation.ldap; import org.jboss.logging.Logger; +import org.keycloak.common.constants.KerberosConstants; import org.keycloak.credential.CredentialInput; -import org.keycloak.credential.CredentialInputUpdater; import org.keycloak.credential.CredentialModel; import org.keycloak.federation.kerberos.impl.KerberosUsernamePasswordAuthenticator; import org.keycloak.federation.kerberos.impl.SPNEGOAuthenticator; @@ -32,6 +32,7 @@ import org.keycloak.federation.ldap.kerberos.LDAPProviderKerberosConfig; import org.keycloak.federation.ldap.mappers.LDAPFederationMapper; import org.keycloak.federation.ldap.mappers.LDAPMappersComparator; import org.keycloak.federation.ldap.mappers.PasswordUpdated; +import org.keycloak.mappers.UserFederationMapper; import org.keycloak.models.CredentialValidationOutput; import org.keycloak.models.GroupModel; import org.keycloak.models.KeycloakSession; @@ -42,17 +43,14 @@ import org.keycloak.models.ModelReadOnlyException; import org.keycloak.models.RealmModel; import org.keycloak.models.RoleModel; import org.keycloak.models.UserCredentialModel; -import org.keycloak.models.UserCredentialValueModel; -import org.keycloak.mappers.UserFederationMapper; import org.keycloak.models.UserFederationMapperModel; import org.keycloak.models.UserFederationProvider; import org.keycloak.models.UserFederationProviderModel; import org.keycloak.models.UserModel; -import org.keycloak.common.constants.KerberosConstants; import org.keycloak.services.managers.UserManager; +import javax.naming.AuthenticationException; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashMap; @@ -62,8 +60,6 @@ import java.util.List; import java.util.Map; import java.util.Set; -import javax.naming.AuthenticationException; - /** * @author Marek Posolda * @author Bill Burke diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/LDAPIdentityStoreRegistry.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/LDAPIdentityStoreRegistry.java index 86626187c8..7470d4375f 100644 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/LDAPIdentityStoreRegistry.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/LDAPIdentityStoreRegistry.java @@ -17,15 +17,15 @@ package org.keycloak.federation.ldap; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - import org.jboss.logging.Logger; import org.keycloak.federation.ldap.idm.store.ldap.LDAPIdentityStore; import org.keycloak.models.LDAPConstants; import org.keycloak.models.UserFederationProviderModel; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + /** * @author Marek Posolda */ diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/LDAPUtils.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/LDAPUtils.java index e406c11d3f..0c20366573 100755 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/LDAPUtils.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/LDAPUtils.java @@ -17,13 +17,6 @@ package org.keycloak.federation.ldap; -import java.util.Collection; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Set; - import org.keycloak.federation.ldap.idm.model.LDAPDn; import org.keycloak.federation.ldap.idm.model.LDAPObject; import org.keycloak.federation.ldap.idm.query.Condition; @@ -39,6 +32,13 @@ import org.keycloak.models.RealmModel; import org.keycloak.models.UserFederationMapperModel; import org.keycloak.models.UserModel; +import java.util.Collection; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; + /** * Allow to directly call some operations against LDAPIdentityStore. * diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/ReadonlyLDAPUserModelDelegate.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/ReadonlyLDAPUserModelDelegate.java index c71b26aef6..6a839b6698 100755 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/ReadonlyLDAPUserModelDelegate.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/ReadonlyLDAPUserModelDelegate.java @@ -18,7 +18,6 @@ package org.keycloak.federation.ldap; import org.keycloak.models.ModelReadOnlyException; -import org.keycloak.models.UserCredentialModel; import org.keycloak.models.UserModel; import org.keycloak.models.utils.UserModelDelegate; diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/WritableLDAPUserModelDelegate.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/WritableLDAPUserModelDelegate.java index 4644cd9f9b..7bc78014cf 100755 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/WritableLDAPUserModelDelegate.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/WritableLDAPUserModelDelegate.java @@ -19,8 +19,6 @@ package org.keycloak.federation.ldap; import org.jboss.logging.Logger; import org.keycloak.federation.ldap.idm.model.LDAPObject; -import org.keycloak.federation.ldap.idm.store.ldap.LDAPIdentityStore; -import org.keycloak.models.UserCredentialModel; import org.keycloak.models.UserModel; import org.keycloak.models.utils.UserModelDelegate; diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/model/LDAPDn.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/model/LDAPDn.java index b8401de615..bfbce5964a 100644 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/model/LDAPDn.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/model/LDAPDn.java @@ -17,13 +17,10 @@ package org.keycloak.federation.ldap.idm.model; +import javax.naming.ldap.Rdn; import java.util.Collection; import java.util.Deque; import java.util.LinkedList; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import javax.naming.ldap.Rdn; /** * @author Marek Posolda diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/model/LDAPObject.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/model/LDAPObject.java index c6447b25b9..0141a451f7 100644 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/model/LDAPObject.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/model/LDAPObject.java @@ -17,17 +17,16 @@ package org.keycloak.federation.ldap.idm.model; +import org.jboss.logging.Logger; + import java.util.Collection; import java.util.HashMap; -import java.util.Iterator; import java.util.LinkedHashSet; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; -import org.jboss.logging.Logger; - /** * @author Marek Posolda */ diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/query/internal/BetweenCondition.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/query/internal/BetweenCondition.java index 8bf26cbd6d..ba926e9310 100644 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/query/internal/BetweenCondition.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/query/internal/BetweenCondition.java @@ -17,10 +17,10 @@ package org.keycloak.federation.ldap.idm.query.internal; -import java.util.Date; - import org.keycloak.federation.ldap.idm.store.ldap.LDAPUtil; +import java.util.Date; + /** * @author Pedro Igor */ diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/query/internal/EqualCondition.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/query/internal/EqualCondition.java index 64d6fca038..115e11f4da 100644 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/query/internal/EqualCondition.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/query/internal/EqualCondition.java @@ -17,11 +17,11 @@ package org.keycloak.federation.ldap.idm.query.internal; -import java.util.Date; - import org.keycloak.federation.ldap.idm.store.ldap.LDAPUtil; import org.keycloak.models.LDAPConstants; +import java.util.Date; + /** * @author Pedro Igor */ diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/query/internal/GreaterThanCondition.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/query/internal/GreaterThanCondition.java index ac34e16d7a..3ef6535719 100644 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/query/internal/GreaterThanCondition.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/query/internal/GreaterThanCondition.java @@ -17,11 +17,10 @@ package org.keycloak.federation.ldap.idm.query.internal; -import java.util.Date; - -import org.keycloak.federation.ldap.idm.query.Condition; import org.keycloak.federation.ldap.idm.store.ldap.LDAPUtil; +import java.util.Date; + /** * @author Pedro Igor */ diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/query/internal/LDAPQuery.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/query/internal/LDAPQuery.java index 957ba33b3a..5a57f84f3d 100644 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/query/internal/LDAPQuery.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/query/internal/LDAPQuery.java @@ -17,15 +17,6 @@ package org.keycloak.federation.ldap.idm.query.internal; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; - -import javax.naming.directory.SearchControls; - import org.keycloak.federation.ldap.LDAPFederationProvider; import org.keycloak.federation.ldap.idm.model.LDAPObject; import org.keycloak.federation.ldap.idm.query.Condition; @@ -35,6 +26,14 @@ import org.keycloak.models.ModelDuplicateException; import org.keycloak.models.ModelException; import org.keycloak.models.UserFederationMapperModel; +import javax.naming.directory.SearchControls; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; + import static java.util.Collections.unmodifiableSet; /** diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/query/internal/LessThanCondition.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/query/internal/LessThanCondition.java index c11b642a95..e29b014125 100644 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/query/internal/LessThanCondition.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/query/internal/LessThanCondition.java @@ -17,11 +17,10 @@ package org.keycloak.federation.ldap.idm.query.internal; -import java.util.Date; - -import org.keycloak.federation.ldap.idm.query.Condition; import org.keycloak.federation.ldap.idm.store.ldap.LDAPUtil; +import java.util.Date; + /** * @author Pedro Igor */ diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/store/IdentityStore.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/store/IdentityStore.java index 5f39d9a674..c14f4f03ad 100644 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/store/IdentityStore.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/store/IdentityStore.java @@ -17,14 +17,13 @@ package org.keycloak.federation.ldap.idm.store; -import java.util.List; - -import javax.naming.AuthenticationException; - import org.keycloak.federation.ldap.LDAPConfig; import org.keycloak.federation.ldap.idm.model.LDAPObject; import org.keycloak.federation.ldap.idm.query.internal.LDAPQuery; +import javax.naming.AuthenticationException; +import java.util.List; + /** * IdentityStore representation providing minimal SPI * diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/store/ldap/LDAPIdentityStore.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/store/ldap/LDAPIdentityStore.java index 9a9b929839..367fb04d57 100644 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/store/ldap/LDAPIdentityStore.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/store/ldap/LDAPIdentityStore.java @@ -17,16 +17,16 @@ package org.keycloak.federation.ldap.idm.store.ldap; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Set; -import java.util.TreeSet; +import org.jboss.logging.Logger; +import org.keycloak.federation.ldap.LDAPConfig; +import org.keycloak.federation.ldap.idm.model.LDAPDn; +import org.keycloak.federation.ldap.idm.model.LDAPObject; +import org.keycloak.federation.ldap.idm.query.Condition; +import org.keycloak.federation.ldap.idm.query.internal.EqualCondition; +import org.keycloak.federation.ldap.idm.query.internal.LDAPQuery; +import org.keycloak.federation.ldap.idm.store.IdentityStore; +import org.keycloak.models.LDAPConstants; +import org.keycloak.models.ModelException; import javax.naming.AuthenticationException; import javax.naming.NamingEnumeration; @@ -39,17 +39,16 @@ import javax.naming.directory.DirContext; import javax.naming.directory.ModificationItem; import javax.naming.directory.SearchControls; import javax.naming.directory.SearchResult; - -import org.jboss.logging.Logger; -import org.keycloak.federation.ldap.LDAPConfig; -import org.keycloak.federation.ldap.idm.model.LDAPDn; -import org.keycloak.federation.ldap.idm.model.LDAPObject; -import org.keycloak.federation.ldap.idm.query.Condition; -import org.keycloak.federation.ldap.idm.query.internal.LDAPQuery; -import org.keycloak.federation.ldap.idm.query.internal.EqualCondition; -import org.keycloak.federation.ldap.idm.store.IdentityStore; -import org.keycloak.models.LDAPConstants; -import org.keycloak.models.ModelException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Set; +import java.util.TreeSet; /** * An IdentityStore implementation backed by an LDAP directory diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/store/ldap/LDAPOperationManager.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/store/ldap/LDAPOperationManager.java index 59b76beece..02cd122b21 100644 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/store/ldap/LDAPOperationManager.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/store/ldap/LDAPOperationManager.java @@ -17,17 +17,11 @@ package org.keycloak.federation.ldap.idm.store.ldap; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Hashtable; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.Set; +import org.jboss.logging.Logger; +import org.keycloak.federation.ldap.LDAPConfig; +import org.keycloak.federation.ldap.idm.query.internal.LDAPQuery; +import org.keycloak.models.LDAPConstants; +import org.keycloak.models.ModelException; import javax.naming.AuthenticationException; import javax.naming.Binding; @@ -46,12 +40,17 @@ import javax.naming.ldap.InitialLdapContext; import javax.naming.ldap.LdapContext; import javax.naming.ldap.PagedResultsControl; import javax.naming.ldap.PagedResultsResponseControl; - -import org.jboss.logging.Logger; -import org.keycloak.federation.ldap.LDAPConfig; -import org.keycloak.federation.ldap.idm.query.internal.LDAPQuery; -import org.keycloak.models.LDAPConstants; -import org.keycloak.models.ModelException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Hashtable; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; /** *

This class provides a set of operations to manage LDAP trees.

diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/store/ldap/LDAPUtil.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/store/ldap/LDAPUtil.java index 2c1cbbeeda..a60d4eb988 100644 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/store/ldap/LDAPUtil.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/idm/store/ldap/LDAPUtil.java @@ -17,12 +17,12 @@ package org.keycloak.federation.ldap.idm.store.ldap; +import org.keycloak.models.ModelException; + import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; -import org.keycloak.models.ModelException; - /** *

Utility class for working with LDAP.

* diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/kerberos/LDAPProviderKerberosConfig.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/kerberos/LDAPProviderKerberosConfig.java index 91df452aeb..71e219871b 100644 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/kerberos/LDAPProviderKerberosConfig.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/kerberos/LDAPProviderKerberosConfig.java @@ -17,8 +17,8 @@ package org.keycloak.federation.ldap.kerberos; -import org.keycloak.federation.kerberos.CommonKerberosConfig; import org.keycloak.common.constants.KerberosConstants; +import org.keycloak.federation.kerberos.CommonKerberosConfig; import org.keycloak.models.UserFederationProviderModel; /** diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/AbstractLDAPFederationMapper.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/AbstractLDAPFederationMapper.java index c998953ed2..8d203d6815 100644 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/AbstractLDAPFederationMapper.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/AbstractLDAPFederationMapper.java @@ -17,14 +17,10 @@ package org.keycloak.federation.ldap.mappers; -import java.util.Collections; -import java.util.List; - -import javax.naming.AuthenticationException; - import org.keycloak.federation.ldap.LDAPFederationProvider; import org.keycloak.federation.ldap.idm.model.LDAPObject; import org.keycloak.federation.ldap.idm.query.internal.LDAPQuery; +import org.keycloak.mappers.UserFederationMapper; import org.keycloak.models.GroupModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; @@ -32,7 +28,10 @@ import org.keycloak.models.UserFederationMapperModel; import org.keycloak.models.UserFederationProvider; import org.keycloak.models.UserFederationSyncResult; import org.keycloak.models.UserModel; -import org.keycloak.mappers.UserFederationMapper; + +import javax.naming.AuthenticationException; +import java.util.Collections; +import java.util.List; /** * Stateful per-request object diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/FullNameLDAPFederationMapper.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/FullNameLDAPFederationMapper.java index b94b5b497c..c2cabe412d 100644 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/FullNameLDAPFederationMapper.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/FullNameLDAPFederationMapper.java @@ -17,9 +17,6 @@ package org.keycloak.federation.ldap.mappers; -import java.util.HashSet; -import java.util.Set; - import org.keycloak.federation.ldap.LDAPFederationProvider; import org.keycloak.federation.ldap.idm.model.LDAPObject; import org.keycloak.federation.ldap.idm.query.Condition; @@ -31,6 +28,9 @@ import org.keycloak.models.UserFederationMapperModel; import org.keycloak.models.UserFederationProvider; import org.keycloak.models.UserModel; +import java.util.HashSet; +import java.util.Set; + /** * Mapper useful for the LDAP deployments when some attribute (usually CN) is mapped to full name of user * diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/FullNameLDAPFederationMapperFactory.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/FullNameLDAPFederationMapperFactory.java index 32826b2dda..4c5a534a74 100755 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/FullNameLDAPFederationMapperFactory.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/FullNameLDAPFederationMapperFactory.java @@ -17,11 +17,6 @@ package org.keycloak.federation.ldap.mappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - import org.keycloak.federation.ldap.LDAPConfig; import org.keycloak.federation.ldap.LDAPFederationProvider; import org.keycloak.mappers.FederationConfigValidationException; @@ -32,6 +27,11 @@ import org.keycloak.models.UserFederationProvider; import org.keycloak.models.UserFederationProviderModel; import org.keycloak.provider.ProviderConfigProperty; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + /** * @author Marek Posolda */ diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/HardcodedLDAPRoleMapper.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/HardcodedLDAPRoleMapper.java index 991ec91dcf..67e577eebe 100644 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/HardcodedLDAPRoleMapper.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/HardcodedLDAPRoleMapper.java @@ -17,8 +17,6 @@ package org.keycloak.federation.ldap.mappers; -import java.util.Set; - import org.jboss.logging.Logger; import org.keycloak.federation.ldap.LDAPFederationProvider; import org.keycloak.federation.ldap.idm.model.LDAPObject; @@ -32,6 +30,8 @@ import org.keycloak.models.UserModel; import org.keycloak.models.utils.KeycloakModelUtils; import org.keycloak.models.utils.UserModelDelegate; +import java.util.Set; + /** * @author Marek Posolda */ diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/HardcodedLDAPRoleMapperFactory.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/HardcodedLDAPRoleMapperFactory.java index 1ca93f5b2a..2f1170d11c 100644 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/HardcodedLDAPRoleMapperFactory.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/HardcodedLDAPRoleMapperFactory.java @@ -17,11 +17,6 @@ package org.keycloak.federation.ldap.mappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - import org.keycloak.federation.ldap.LDAPFederationProvider; import org.keycloak.mappers.FederationConfigValidationException; import org.keycloak.models.RealmModel; @@ -31,6 +26,11 @@ import org.keycloak.models.UserFederationProviderModel; import org.keycloak.models.utils.KeycloakModelUtils; import org.keycloak.provider.ProviderConfigProperty; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + /** * @author Marek Posolda */ diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/LDAPFederationMapper.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/LDAPFederationMapper.java index 0f35c511fd..52acbfb528 100644 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/LDAPFederationMapper.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/LDAPFederationMapper.java @@ -17,16 +17,16 @@ package org.keycloak.federation.ldap.mappers; -import javax.naming.AuthenticationException; - import org.keycloak.federation.ldap.LDAPFederationProvider; import org.keycloak.federation.ldap.idm.model.LDAPObject; import org.keycloak.federation.ldap.idm.query.internal.LDAPQuery; -import org.keycloak.models.RealmModel; import org.keycloak.mappers.UserFederationMapper; +import org.keycloak.models.RealmModel; import org.keycloak.models.UserFederationMapperModel; import org.keycloak.models.UserModel; +import javax.naming.AuthenticationException; + /** * @author Marek Posolda */ diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/LDAPFederationMapperBridge.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/LDAPFederationMapperBridge.java index b2a0baa4c1..1a3521af35 100644 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/LDAPFederationMapperBridge.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/LDAPFederationMapperBridge.java @@ -17,10 +17,6 @@ package org.keycloak.federation.ldap.mappers; -import java.util.List; - -import javax.naming.AuthenticationException; - import org.keycloak.federation.ldap.LDAPFederationProvider; import org.keycloak.federation.ldap.idm.model.LDAPObject; import org.keycloak.federation.ldap.idm.query.internal.LDAPQuery; @@ -32,6 +28,9 @@ import org.keycloak.models.UserFederationProvider; import org.keycloak.models.UserFederationSyncResult; import org.keycloak.models.UserModel; +import javax.naming.AuthenticationException; +import java.util.List; + /** * Sufficient if mapper implementation is stateless and doesn't need to "close" any state * diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/LDAPMappersComparator.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/LDAPMappersComparator.java index c5507e62c5..893cca765d 100644 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/LDAPMappersComparator.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/LDAPMappersComparator.java @@ -17,16 +17,16 @@ package org.keycloak.federation.ldap.mappers; +import org.keycloak.federation.ldap.LDAPConfig; +import org.keycloak.models.UserFederationMapperModel; +import org.keycloak.models.UserModel; + import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.Comparator; import java.util.List; -import org.keycloak.federation.ldap.LDAPConfig; -import org.keycloak.models.UserFederationMapperModel; -import org.keycloak.models.UserModel; - /** * TODO: Possibly add "priority" to UserFederationMapper instead of hardcoding behaviour * diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/UserAttributeLDAPFederationMapper.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/UserAttributeLDAPFederationMapper.java index b577326a0f..bc1041595e 100644 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/UserAttributeLDAPFederationMapper.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/UserAttributeLDAPFederationMapper.java @@ -17,16 +17,6 @@ package org.keycloak.federation.ldap.mappers; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - import org.jboss.logging.Logger; import org.keycloak.federation.ldap.LDAPFederationProvider; import org.keycloak.federation.ldap.idm.model.LDAPObject; @@ -45,6 +35,16 @@ import org.keycloak.models.utils.reflection.Property; import org.keycloak.models.utils.reflection.PropertyCriteria; import org.keycloak.models.utils.reflection.PropertyQueries; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + /** * @author Marek Posolda */ diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/UserAttributeLDAPFederationMapperFactory.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/UserAttributeLDAPFederationMapperFactory.java index b0a7faae4a..e0c0f8ec57 100755 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/UserAttributeLDAPFederationMapperFactory.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/UserAttributeLDAPFederationMapperFactory.java @@ -17,11 +17,6 @@ package org.keycloak.federation.ldap.mappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - import org.keycloak.federation.ldap.LDAPConfig; import org.keycloak.federation.ldap.LDAPFederationProvider; import org.keycloak.mappers.FederationConfigValidationException; @@ -31,6 +26,11 @@ import org.keycloak.models.UserFederationProvider; import org.keycloak.models.UserFederationProviderModel; import org.keycloak.provider.ProviderConfigProperty; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + /** * @author Marek Posolda */ diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/membership/CommonLDAPGroupMapperConfig.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/membership/CommonLDAPGroupMapperConfig.java index 9fe78ab34b..ea50569710 100644 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/membership/CommonLDAPGroupMapperConfig.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/membership/CommonLDAPGroupMapperConfig.java @@ -17,13 +17,13 @@ package org.keycloak.federation.ldap.mappers.membership; -import java.util.HashSet; -import java.util.Set; - import org.keycloak.models.LDAPConstants; import org.keycloak.models.ModelException; import org.keycloak.models.UserFederationMapperModel; +import java.util.HashSet; +import java.util.Set; + /** * @author Marek Posolda */ diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/membership/MembershipType.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/membership/MembershipType.java index d053b25e7a..4c9de3e785 100644 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/membership/MembershipType.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/membership/MembershipType.java @@ -17,13 +17,6 @@ package org.keycloak.federation.ldap.mappers.membership; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Set; - import org.keycloak.federation.ldap.LDAPConfig; import org.keycloak.federation.ldap.LDAPFederationProvider; import org.keycloak.federation.ldap.LDAPUtils; @@ -36,6 +29,13 @@ import org.keycloak.federation.ldap.mappers.membership.group.GroupLDAPFederation import org.keycloak.models.RealmModel; import org.keycloak.models.UserModel; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; + /** * @author Marek Posolda */ diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/membership/UserRolesRetrieveStrategy.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/membership/UserRolesRetrieveStrategy.java index a1d1a52d52..fe33e3b106 100644 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/membership/UserRolesRetrieveStrategy.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/membership/UserRolesRetrieveStrategy.java @@ -18,11 +18,6 @@ package org.keycloak.federation.ldap.mappers.membership; -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; -import java.util.Set; - import org.keycloak.federation.ldap.LDAPUtils; import org.keycloak.federation.ldap.idm.model.LDAPDn; import org.keycloak.federation.ldap.idm.model.LDAPObject; @@ -31,6 +26,11 @@ import org.keycloak.federation.ldap.idm.query.internal.LDAPQuery; import org.keycloak.federation.ldap.idm.query.internal.LDAPQueryConditionsBuilder; import org.keycloak.models.LDAPConstants; +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; + /** * Strategy for how to retrieve LDAP roles of user * diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/membership/group/GroupLDAPFederationMapper.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/membership/group/GroupLDAPFederationMapper.java index 8713de7d19..e27f3efd48 100644 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/membership/group/GroupLDAPFederationMapper.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/membership/group/GroupLDAPFederationMapper.java @@ -17,15 +17,6 @@ package org.keycloak.federation.ldap.mappers.membership.group; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Set; - import org.jboss.logging.Logger; import org.keycloak.federation.ldap.LDAPFederationProvider; import org.keycloak.federation.ldap.LDAPUtils; @@ -49,6 +40,15 @@ import org.keycloak.models.UserModel; import org.keycloak.models.utils.KeycloakModelUtils; import org.keycloak.models.utils.UserModelDelegate; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; + /** * @author Marek Posolda */ diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/membership/group/GroupLDAPFederationMapperFactory.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/membership/group/GroupLDAPFederationMapperFactory.java index 169875d0a6..a9c5056275 100644 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/membership/group/GroupLDAPFederationMapperFactory.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/membership/group/GroupLDAPFederationMapperFactory.java @@ -17,13 +17,6 @@ package org.keycloak.federation.ldap.mappers.membership.group; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - import org.keycloak.federation.ldap.LDAPConfig; import org.keycloak.federation.ldap.LDAPFederationProvider; import org.keycloak.federation.ldap.LDAPUtils; @@ -43,6 +36,13 @@ import org.keycloak.models.UserFederationProviderModel; import org.keycloak.provider.ProviderConfigProperty; import org.keycloak.representations.idm.UserFederationMapperSyncConfigRepresentation; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + /** * @author Marek Posolda */ diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/membership/group/GroupMapperConfig.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/membership/group/GroupMapperConfig.java index a1cf03d7dd..ae27a8806c 100644 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/membership/group/GroupMapperConfig.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/membership/group/GroupMapperConfig.java @@ -17,9 +17,6 @@ package org.keycloak.federation.ldap.mappers.membership.group; -import java.util.Collection; -import java.util.Collections; - import org.keycloak.federation.ldap.LDAPFederationProvider; import org.keycloak.federation.ldap.mappers.AbstractLDAPFederationMapper; import org.keycloak.federation.ldap.mappers.membership.CommonLDAPGroupMapperConfig; @@ -27,6 +24,9 @@ import org.keycloak.models.LDAPConstants; import org.keycloak.models.ModelException; import org.keycloak.models.UserFederationMapperModel; +import java.util.Collection; +import java.util.Collections; + /** * @author Marek Posolda */ diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/membership/role/RoleLDAPFederationMapper.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/membership/role/RoleLDAPFederationMapper.java index 9dbeec95cc..2a23001fcb 100644 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/membership/role/RoleLDAPFederationMapper.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/membership/role/RoleLDAPFederationMapper.java @@ -17,12 +17,6 @@ package org.keycloak.federation.ldap.mappers.membership.role; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - import org.jboss.logging.Logger; import org.keycloak.federation.ldap.LDAPFederationProvider; import org.keycloak.federation.ldap.LDAPUtils; @@ -46,6 +40,12 @@ import org.keycloak.models.UserModel; import org.keycloak.models.utils.KeycloakModelUtils; import org.keycloak.models.utils.UserModelDelegate; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + /** * Map realm roles or roles of particular client to LDAP groups * diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/membership/role/RoleLDAPFederationMapperFactory.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/membership/role/RoleLDAPFederationMapperFactory.java index 25a7ad1bc8..416e4b4c11 100644 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/membership/role/RoleLDAPFederationMapperFactory.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/membership/role/RoleLDAPFederationMapperFactory.java @@ -17,13 +17,6 @@ package org.keycloak.federation.ldap.mappers.membership.role; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - import org.keycloak.federation.ldap.LDAPConfig; import org.keycloak.federation.ldap.LDAPFederationProvider; import org.keycloak.federation.ldap.LDAPUtils; @@ -32,7 +25,6 @@ import org.keycloak.federation.ldap.mappers.AbstractLDAPFederationMapperFactory; import org.keycloak.federation.ldap.mappers.membership.LDAPGroupMapperMode; import org.keycloak.federation.ldap.mappers.membership.MembershipType; import org.keycloak.federation.ldap.mappers.membership.UserRolesRetrieveStrategy; -import org.keycloak.federation.ldap.mappers.membership.group.GroupMapperConfig; import org.keycloak.mappers.FederationConfigValidationException; import org.keycloak.models.LDAPConstants; import org.keycloak.models.RealmModel; @@ -42,6 +34,13 @@ import org.keycloak.models.UserFederationProviderModel; import org.keycloak.provider.ProviderConfigProperty; import org.keycloak.representations.idm.UserFederationMapperSyncConfigRepresentation; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + /** * @author Marek Posolda */ diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/membership/role/RoleMapperConfig.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/membership/role/RoleMapperConfig.java index f087274691..950d923839 100755 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/membership/role/RoleMapperConfig.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/membership/role/RoleMapperConfig.java @@ -17,14 +17,14 @@ package org.keycloak.federation.ldap.mappers.membership.role; -import java.util.Collection; - import org.keycloak.federation.ldap.LDAPFederationProvider; import org.keycloak.federation.ldap.mappers.membership.CommonLDAPGroupMapperConfig; import org.keycloak.models.LDAPConstants; import org.keycloak.models.ModelException; import org.keycloak.models.UserFederationMapperModel; +import java.util.Collection; + /** * @author Marek Posolda */ diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/msad/MSADUserAccountControlMapper.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/msad/MSADUserAccountControlMapper.java index ba6139d23b..d974f3c21c 100644 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/msad/MSADUserAccountControlMapper.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/msad/MSADUserAccountControlMapper.java @@ -17,13 +17,6 @@ package org.keycloak.federation.ldap.mappers.msad; -import java.util.HashSet; -import java.util.Set; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import javax.naming.AuthenticationException; - import org.jboss.logging.Logger; import org.keycloak.credential.CredentialInput; import org.keycloak.federation.ldap.LDAPFederationProvider; @@ -34,12 +27,17 @@ import org.keycloak.federation.ldap.mappers.PasswordUpdated; import org.keycloak.models.LDAPConstants; import org.keycloak.models.ModelException; import org.keycloak.models.RealmModel; -import org.keycloak.models.UserCredentialModel; import org.keycloak.models.UserFederationMapperModel; import org.keycloak.models.UserFederationProvider; import org.keycloak.models.UserModel; import org.keycloak.models.utils.UserModelDelegate; +import javax.naming.AuthenticationException; +import java.util.HashSet; +import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + /** * Mapper specific to MSAD. It's able to read the userAccountControl and pwdLastSet attributes and set actions in Keycloak based on that. * It's also able to handle exception code from LDAP user authentication (See http://www-01.ibm.com/support/docview.wss?uid=swg21290631 ) diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/msad/MSADUserAccountControlMapperFactory.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/msad/MSADUserAccountControlMapperFactory.java index 36c494dcdd..a8afd1cb9f 100644 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/msad/MSADUserAccountControlMapperFactory.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/msad/MSADUserAccountControlMapperFactory.java @@ -17,11 +17,6 @@ package org.keycloak.federation.ldap.mappers.msad; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; - import org.keycloak.federation.ldap.LDAPFederationProvider; import org.keycloak.federation.ldap.mappers.AbstractLDAPFederationMapper; import org.keycloak.federation.ldap.mappers.AbstractLDAPFederationMapperFactory; @@ -32,6 +27,11 @@ import org.keycloak.models.UserFederationMapperModel; import org.keycloak.models.UserFederationProviderModel; import org.keycloak.provider.ProviderConfigProperty; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; + /** * @author Marek Posolda */ diff --git a/federation/ldap/src/test/java/org/keycloak/federation/ldap/idm/model/GroupTreeResolverTest.java b/federation/ldap/src/test/java/org/keycloak/federation/ldap/idm/model/GroupTreeResolverTest.java index ab6b71b9d7..66cddf7f43 100644 --- a/federation/ldap/src/test/java/org/keycloak/federation/ldap/idm/model/GroupTreeResolverTest.java +++ b/federation/ldap/src/test/java/org/keycloak/federation/ldap/idm/model/GroupTreeResolverTest.java @@ -17,13 +17,13 @@ package org.keycloak.federation.ldap.idm.model; -import java.util.Arrays; -import java.util.List; - import org.junit.Assert; import org.junit.Test; import org.keycloak.federation.ldap.mappers.membership.group.GroupTreeResolver; +import java.util.Arrays; +import java.util.List; + /** * @author Marek Posolda */ diff --git a/federation/ldap/src/test/java/org/keycloak/federation/ldap/idm/model/LDAPMappersComparatorTest.java b/federation/ldap/src/test/java/org/keycloak/federation/ldap/idm/model/LDAPMappersComparatorTest.java index 7ca7ff2a88..061ef50097 100644 --- a/federation/ldap/src/test/java/org/keycloak/federation/ldap/idm/model/LDAPMappersComparatorTest.java +++ b/federation/ldap/src/test/java/org/keycloak/federation/ldap/idm/model/LDAPMappersComparatorTest.java @@ -17,12 +17,6 @@ package org.keycloak.federation.ldap.idm.model; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - import org.junit.Assert; import org.junit.Test; import org.keycloak.federation.ldap.LDAPConfig; @@ -36,6 +30,12 @@ import org.keycloak.models.UserFederationMapperModel; import org.keycloak.models.UserModel; import org.keycloak.models.utils.KeycloakModelUtils; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + /** * @author Marek Posolda */ diff --git a/federation/sssd/src/main/java/org/keycloak/federation/sssd/ReadonlySSSDUserModelDelegate.java b/federation/sssd/src/main/java/org/keycloak/federation/sssd/ReadonlySSSDUserModelDelegate.java index 75b6fd8f56..aff52ac221 100755 --- a/federation/sssd/src/main/java/org/keycloak/federation/sssd/ReadonlySSSDUserModelDelegate.java +++ b/federation/sssd/src/main/java/org/keycloak/federation/sssd/ReadonlySSSDUserModelDelegate.java @@ -18,8 +18,6 @@ package org.keycloak.federation.sssd; import org.keycloak.models.ModelReadOnlyException; -import org.keycloak.models.UserCredentialModel; -import org.keycloak.models.UserCredentialValueModel; import org.keycloak.models.UserModel; import org.keycloak.models.utils.UserModelDelegate; diff --git a/federation/sssd/src/main/java/org/keycloak/federation/sssd/SSSDFederationProvider.java b/federation/sssd/src/main/java/org/keycloak/federation/sssd/SSSDFederationProvider.java index ba47871b51..8e669439a6 100755 --- a/federation/sssd/src/main/java/org/keycloak/federation/sssd/SSSDFederationProvider.java +++ b/federation/sssd/src/main/java/org/keycloak/federation/sssd/SSSDFederationProvider.java @@ -36,7 +36,6 @@ import org.keycloak.models.UserModel; import org.keycloak.models.utils.KeycloakModelUtils; import org.keycloak.services.managers.UserManager; -import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.List; diff --git a/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/ClientAttributeCertificateResource.java b/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/ClientAttributeCertificateResource.java index 2675e19cfb..8acaf858d4 100644 --- a/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/ClientAttributeCertificateResource.java +++ b/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/ClientAttributeCertificateResource.java @@ -17,16 +17,17 @@ package org.keycloak.admin.client.resource; +import org.jboss.resteasy.annotations.cache.NoCache; +import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataOutput; +import org.keycloak.representations.KeyStoreConfig; +import org.keycloak.representations.idm.CertificateRepresentation; + import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; -import org.jboss.resteasy.annotations.cache.NoCache; -import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataOutput; -import org.keycloak.representations.KeyStoreConfig; -import org.keycloak.representations.idm.CertificateRepresentation; /** * diff --git a/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/ClientInitialAccessResource.java b/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/ClientInitialAccessResource.java index 4798bb1e2c..54dba868b1 100644 --- a/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/ClientInitialAccessResource.java +++ b/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/ClientInitialAccessResource.java @@ -20,11 +20,14 @@ package org.keycloak.admin.client.resource; import org.keycloak.representations.idm.ClientInitialAccessCreatePresentation; import org.keycloak.representations.idm.ClientInitialAccessPresentation; -import javax.ws.rs.*; -import javax.ws.rs.core.Context; +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriInfo; import java.util.List; /** diff --git a/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/ClientRegistrationTrustedHostResource.java b/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/ClientRegistrationTrustedHostResource.java index 4f5ace9c4d..29e3864ffb 100644 --- a/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/ClientRegistrationTrustedHostResource.java +++ b/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/ClientRegistrationTrustedHostResource.java @@ -17,7 +17,7 @@ package org.keycloak.admin.client.resource; -import java.util.List; +import org.keycloak.representations.idm.ClientRegistrationTrustedHostRepresentation; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; @@ -29,8 +29,7 @@ import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; - -import org.keycloak.representations.idm.ClientRegistrationTrustedHostRepresentation; +import java.util.List; /** * @author Marek Posolda diff --git a/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/ClientTemplateResource.java b/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/ClientTemplateResource.java index 98a849e132..00a41b76b2 100755 --- a/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/ClientTemplateResource.java +++ b/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/ClientTemplateResource.java @@ -17,24 +17,15 @@ package org.keycloak.admin.client.resource; -import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.representations.idm.ClientTemplateRepresentation; -import org.keycloak.representations.idm.CredentialRepresentation; -import org.keycloak.representations.idm.UserSessionRepresentation; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; import javax.ws.rs.GET; -import javax.ws.rs.POST; import javax.ws.rs.PUT; import javax.ws.rs.Path; -import javax.ws.rs.PathParam; import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; -import java.util.List; -import java.util.Map; -import java.util.Set; /** * @author rodrigo.sasaki@icarros.com.br diff --git a/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/ClientTemplatesResource.java b/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/ClientTemplatesResource.java index 2f3f9a7361..acf26c4f84 100755 --- a/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/ClientTemplatesResource.java +++ b/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/ClientTemplatesResource.java @@ -17,7 +17,6 @@ package org.keycloak.admin.client.resource; -import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.representations.idm.ClientTemplateRepresentation; import javax.ws.rs.Consumes; diff --git a/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/ComponentResource.java b/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/ComponentResource.java index 2839f862da..efc9f2b6c9 100644 --- a/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/ComponentResource.java +++ b/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/ComponentResource.java @@ -16,15 +16,12 @@ */ package org.keycloak.admin.client.resource; -import org.jboss.resteasy.spi.NotFoundException; import org.keycloak.representations.idm.ComponentRepresentation; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; import javax.ws.rs.GET; import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; import javax.ws.rs.core.MediaType; /** diff --git a/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/ProtocolMappersResource.java b/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/ProtocolMappersResource.java index 8604a1ca65..db53bc4b4e 100644 --- a/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/ProtocolMappersResource.java +++ b/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/ProtocolMappersResource.java @@ -17,7 +17,7 @@ package org.keycloak.admin.client.resource; -import java.util.List; +import org.keycloak.representations.idm.ProtocolMapperRepresentation; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; @@ -28,8 +28,7 @@ import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.Response; - -import org.keycloak.representations.idm.ProtocolMapperRepresentation; +import java.util.List; /** * @author Marek Posolda diff --git a/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/RealmResource.java b/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/RealmResource.java index ba91227448..252157a6fb 100644 --- a/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/RealmResource.java +++ b/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/RealmResource.java @@ -27,7 +27,15 @@ import org.keycloak.representations.idm.PartialImportRepresentation; import org.keycloak.representations.idm.RealmEventsConfigRepresentation; import org.keycloak.representations.idm.RealmRepresentation; -import javax.ws.rs.*; +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.util.List; diff --git a/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/ResourceScopeResource.java b/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/ResourceScopeResource.java index 4a0ad8e9fa..6975574111 100644 --- a/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/ResourceScopeResource.java +++ b/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/ResourceScopeResource.java @@ -17,7 +17,6 @@ package org.keycloak.admin.client.resource; import org.jboss.resteasy.annotations.cache.NoCache; -import org.keycloak.representations.idm.authorization.ResourceRepresentation; import org.keycloak.representations.idm.authorization.ScopeRepresentation; import javax.ws.rs.Consumes; diff --git a/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/ResourceScopesResource.java b/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/ResourceScopesResource.java index 88f5c74843..3a481140cc 100644 --- a/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/ResourceScopesResource.java +++ b/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/ResourceScopesResource.java @@ -17,7 +17,6 @@ package org.keycloak.admin.client.resource; import org.jboss.resteasy.annotations.cache.NoCache; -import org.keycloak.representations.idm.authorization.ResourceRepresentation; import org.keycloak.representations.idm.authorization.ScopeRepresentation; import javax.ws.rs.Consumes; diff --git a/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/UserFederationProviderResource.java b/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/UserFederationProviderResource.java index 2e4543ae61..9ba7638709 100644 --- a/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/UserFederationProviderResource.java +++ b/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/UserFederationProviderResource.java @@ -17,8 +17,10 @@ package org.keycloak.admin.client.resource; -import java.util.List; -import java.util.Map; +import org.keycloak.representations.idm.UserFederationMapperRepresentation; +import org.keycloak.representations.idm.UserFederationMapperTypeRepresentation; +import org.keycloak.representations.idm.UserFederationProviderRepresentation; +import org.keycloak.representations.idm.UserFederationSyncResultRepresentation; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; @@ -31,11 +33,8 @@ import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; - -import org.keycloak.representations.idm.UserFederationMapperRepresentation; -import org.keycloak.representations.idm.UserFederationMapperTypeRepresentation; -import org.keycloak.representations.idm.UserFederationProviderRepresentation; -import org.keycloak.representations.idm.UserFederationSyncResultRepresentation; +import java.util.List; +import java.util.Map; /** * @author Marek Posolda diff --git a/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/UserFederationProvidersResource.java b/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/UserFederationProvidersResource.java index e56ea3c09c..e98c008598 100644 --- a/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/UserFederationProvidersResource.java +++ b/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/UserFederationProvidersResource.java @@ -17,7 +17,8 @@ package org.keycloak.admin.client.resource; -import java.util.List; +import org.keycloak.representations.idm.UserFederationProviderFactoryRepresentation; +import org.keycloak.representations.idm.UserFederationProviderRepresentation; import javax.ws.rs.Consumes; import javax.ws.rs.GET; @@ -27,9 +28,7 @@ import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; - -import org.keycloak.representations.idm.UserFederationProviderFactoryRepresentation; -import org.keycloak.representations.idm.UserFederationProviderRepresentation; +import java.util.List; /** * @author Marek Posolda diff --git a/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/UserResource.java b/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/UserResource.java index eebefe79ce..e871313cfc 100755 --- a/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/UserResource.java +++ b/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/UserResource.java @@ -30,8 +30,8 @@ import javax.ws.rs.POST; import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.PathParam; -import javax.ws.rs.QueryParam; import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.util.List; diff --git a/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/UsersResource.java b/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/UsersResource.java index 93a0638b8c..3d57c07a02 100755 --- a/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/UsersResource.java +++ b/integration/admin-client/src/main/java/org/keycloak/admin/client/resource/UsersResource.java @@ -19,7 +19,14 @@ package org.keycloak.admin.client.resource; import org.keycloak.representations.idm.UserRepresentation; -import javax.ws.rs.*; +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.util.List; diff --git a/integration/admin-client/src/main/java/org/keycloak/admin/client/token/TokenManager.java b/integration/admin-client/src/main/java/org/keycloak/admin/client/token/TokenManager.java index bb32daea90..b434b108ea 100644 --- a/integration/admin-client/src/main/java/org/keycloak/admin/client/token/TokenManager.java +++ b/integration/admin-client/src/main/java/org/keycloak/admin/client/token/TokenManager.java @@ -27,7 +27,11 @@ import org.keycloak.representations.AccessTokenResponse; import javax.ws.rs.BadRequestException; import javax.ws.rs.core.Form; -import static org.keycloak.OAuth2Constants.*; +import static org.keycloak.OAuth2Constants.CLIENT_CREDENTIALS; +import static org.keycloak.OAuth2Constants.CLIENT_ID; +import static org.keycloak.OAuth2Constants.GRANT_TYPE; +import static org.keycloak.OAuth2Constants.PASSWORD; +import static org.keycloak.OAuth2Constants.REFRESH_TOKEN; /** * @author rodrigo.sasaki@icarros.com.br diff --git a/integration/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/SetupCommand.java b/integration/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/SetupCommand.java index 26579abd4e..5ec15f98e6 100644 --- a/integration/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/SetupCommand.java +++ b/integration/client-registration-cli/src/main/java/org/keycloak/client/registration/cli/commands/SetupCommand.java @@ -5,11 +5,7 @@ import org.jboss.aesh.cl.Option; import org.jboss.aesh.console.command.Command; import org.jboss.aesh.console.command.CommandResult; import org.jboss.aesh.console.command.invocation.CommandInvocation; -import org.jboss.aesh.io.Resource; -import org.keycloak.client.registration.ClientRegistrationException; import org.keycloak.client.registration.cli.Context; -import org.keycloak.representations.idm.ClientRepresentation; -import org.keycloak.util.JsonSerialization; import java.io.IOException; diff --git a/integration/client-registration/src/main/java/org/keycloak/client/registration/ClientRegistration.java b/integration/client-registration/src/main/java/org/keycloak/client/registration/ClientRegistration.java index 8961aadc3a..b4ee78afb3 100644 --- a/integration/client-registration/src/main/java/org/keycloak/client/registration/ClientRegistration.java +++ b/integration/client-registration/src/main/java/org/keycloak/client/registration/ClientRegistration.java @@ -18,9 +18,9 @@ package org.keycloak.client.registration; import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.ObjectMapper; import org.apache.http.client.HttpClient; import org.apache.http.impl.client.HttpClients; -import com.fasterxml.jackson.databind.ObjectMapper; import org.keycloak.representations.adapters.config.AdapterConfig; import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.representations.oidc.OIDCClientRepresentation; diff --git a/integration/client-registration/src/main/java/org/keycloak/client/registration/HttpUtil.java b/integration/client-registration/src/main/java/org/keycloak/client/registration/HttpUtil.java index 66808ed8d7..7ca1361011 100644 --- a/integration/client-registration/src/main/java/org/keycloak/client/registration/HttpUtil.java +++ b/integration/client-registration/src/main/java/org/keycloak/client/registration/HttpUtil.java @@ -20,7 +20,11 @@ package org.keycloak.client.registration; import org.apache.http.HttpHeaders; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.*; +import org.apache.http.client.methods.HttpDelete; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.client.methods.HttpPut; +import org.apache.http.client.methods.HttpRequestBase; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.CloseableHttpClient; import org.keycloak.common.util.StreamUtil; diff --git a/misc/logo/bg.svg b/misc/logo/bg.svg index 9bb2f44645..e9497b55d3 100644 --- a/misc/logo/bg.svg +++ b/misc/logo/bg.svg @@ -3,7 +3,6 @@ xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2400 1350" height="1350" diff --git a/misc/logo/bg_gray.svg b/misc/logo/bg_gray.svg index 01642a6220..494efbbde2 100644 --- a/misc/logo/bg_gray.svg +++ b/misc/logo/bg_gray.svg @@ -5,7 +5,6 @@ xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" diff --git a/misc/logo/keycloak_icon_128px.svg b/misc/logo/keycloak_icon_128px.svg index d8baf12419..614041737c 100644 --- a/misc/logo/keycloak_icon_128px.svg +++ b/misc/logo/keycloak_icon_128px.svg @@ -1 +1 @@ -keycloak_deliverables \ No newline at end of file +keycloak_deliverables \ No newline at end of file diff --git a/misc/logo/keycloak_icon_16px.svg b/misc/logo/keycloak_icon_16px.svg index d50057151f..bf22972cc7 100644 --- a/misc/logo/keycloak_icon_16px.svg +++ b/misc/logo/keycloak_icon_16px.svg @@ -1 +1 @@ -keycloak_deliverables \ No newline at end of file +keycloak_deliverables \ No newline at end of file diff --git a/misc/logo/keycloak_icon_256px.svg b/misc/logo/keycloak_icon_256px.svg index 570bcc1c30..37f734e1bc 100644 --- a/misc/logo/keycloak_icon_256px.svg +++ b/misc/logo/keycloak_icon_256px.svg @@ -1 +1 @@ -keycloak_deliverables \ No newline at end of file +keycloak_deliverables \ No newline at end of file diff --git a/misc/logo/keycloak_icon_32px.svg b/misc/logo/keycloak_icon_32px.svg index 9371cb51d3..171aa59142 100644 --- a/misc/logo/keycloak_icon_32px.svg +++ b/misc/logo/keycloak_icon_32px.svg @@ -1 +1 @@ -keycloak_deliverables \ No newline at end of file +keycloak_deliverables \ No newline at end of file diff --git a/misc/logo/keycloak_icon_48px.svg b/misc/logo/keycloak_icon_48px.svg index b1d3c03efb..c0d485ab5d 100644 --- a/misc/logo/keycloak_icon_48px.svg +++ b/misc/logo/keycloak_icon_48px.svg @@ -1 +1 @@ -keycloak_deliverables \ No newline at end of file +keycloak_deliverables \ No newline at end of file diff --git a/misc/logo/keycloak_icon_512px.svg b/misc/logo/keycloak_icon_512px.svg index cb8d57061e..feaa105f17 100644 --- a/misc/logo/keycloak_icon_512px.svg +++ b/misc/logo/keycloak_icon_512px.svg @@ -1 +1 @@ -keycloak_deliverables \ No newline at end of file +keycloak_deliverables \ No newline at end of file diff --git a/misc/logo/keycloak_icon_64px.svg b/misc/logo/keycloak_icon_64px.svg index 34320393d5..7eef05996c 100644 --- a/misc/logo/keycloak_icon_64px.svg +++ b/misc/logo/keycloak_icon_64px.svg @@ -1 +1 @@ -keycloak_deliverables \ No newline at end of file +keycloak_deliverables \ No newline at end of file diff --git a/misc/logo/keycloak_logo_100px.svg b/misc/logo/keycloak_logo_100px.svg index e1130b6dfd..0e3a658682 100644 --- a/misc/logo/keycloak_logo_100px.svg +++ b/misc/logo/keycloak_logo_100px.svg @@ -1 +1 @@ -keycloak_deliverables \ No newline at end of file +keycloak_deliverables \ No newline at end of file diff --git a/misc/logo/keycloak_logo_200px.svg b/misc/logo/keycloak_logo_200px.svg index 9eeb7291db..af4b1dad73 100644 --- a/misc/logo/keycloak_logo_200px.svg +++ b/misc/logo/keycloak_logo_200px.svg @@ -1 +1 @@ -keycloak_deliverables \ No newline at end of file +keycloak_deliverables \ No newline at end of file diff --git a/misc/logo/keycloak_logo_450px.svg b/misc/logo/keycloak_logo_450px.svg index 29be2bc8bb..17ef3c383f 100644 --- a/misc/logo/keycloak_logo_450px.svg +++ b/misc/logo/keycloak_logo_450px.svg @@ -1 +1 @@ -keycloak_deliverables \ No newline at end of file +keycloak_deliverables \ No newline at end of file diff --git a/misc/logo/keycloak_logo_600px.svg b/misc/logo/keycloak_logo_600px.svg index 87c8de0a8f..9267bf22f9 100644 --- a/misc/logo/keycloak_logo_600px.svg +++ b/misc/logo/keycloak_logo_600px.svg @@ -1 +1 @@ -keycloak_deliverables \ No newline at end of file +keycloak_deliverables \ No newline at end of file diff --git a/misc/logo/keycloak_logofinal_1color.svg b/misc/logo/keycloak_logofinal_1color.svg index 8632036805..a3dba37d11 100644 --- a/misc/logo/keycloak_logofinal_1color.svg +++ b/misc/logo/keycloak_logofinal_1color.svg @@ -1,6 +1,6 @@ -

Holds attributes, their values and provides utlity methods to manage them. * diff --git a/server-spi/src/main/java/org/keycloak/authorization/identity/Identity.java b/server-spi/src/main/java/org/keycloak/authorization/identity/Identity.java index f16e6c3397..ad7057b457 100644 --- a/server-spi/src/main/java/org/keycloak/authorization/identity/Identity.java +++ b/server-spi/src/main/java/org/keycloak/authorization/identity/Identity.java @@ -19,10 +19,6 @@ package org.keycloak.authorization.identity; import org.keycloak.authorization.attribute.Attributes; -import java.util.Collection; -import java.util.Map; -import java.util.function.Predicate; - /** *

Represents a security identity, which can be a person or non-person entity that was previously authenticated. * diff --git a/server-spi/src/main/java/org/keycloak/authorization/policy/evaluation/DefaultPolicyEvaluator.java b/server-spi/src/main/java/org/keycloak/authorization/policy/evaluation/DefaultPolicyEvaluator.java index 724b65571a..207c89ee83 100644 --- a/server-spi/src/main/java/org/keycloak/authorization/policy/evaluation/DefaultPolicyEvaluator.java +++ b/server-spi/src/main/java/org/keycloak/authorization/policy/evaluation/DefaultPolicyEvaluator.java @@ -38,7 +38,6 @@ import java.util.Map; import java.util.Set; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Consumer; -import java.util.function.Predicate; import java.util.stream.Collectors; /** diff --git a/server-spi/src/main/java/org/keycloak/authorization/policy/provider/PolicyProviderFactory.java b/server-spi/src/main/java/org/keycloak/authorization/policy/provider/PolicyProviderFactory.java index 1beedd9e5f..f82bdb7573 100644 --- a/server-spi/src/main/java/org/keycloak/authorization/policy/provider/PolicyProviderFactory.java +++ b/server-spi/src/main/java/org/keycloak/authorization/policy/provider/PolicyProviderFactory.java @@ -21,7 +21,6 @@ package org.keycloak.authorization.policy.provider; import org.keycloak.authorization.AuthorizationProvider; import org.keycloak.authorization.model.Policy; import org.keycloak.authorization.model.ResourceServer; -import org.keycloak.provider.ProviderEvent; import org.keycloak.provider.ProviderFactory; /** diff --git a/server-spi/src/main/java/org/keycloak/authorization/store/AuthorizationStoreFactory.java b/server-spi/src/main/java/org/keycloak/authorization/store/AuthorizationStoreFactory.java index dac1b33695..6179cc7288 100644 --- a/server-spi/src/main/java/org/keycloak/authorization/store/AuthorizationStoreFactory.java +++ b/server-spi/src/main/java/org/keycloak/authorization/store/AuthorizationStoreFactory.java @@ -18,11 +18,9 @@ package org.keycloak.authorization.store; -import org.jboss.resteasy.spi.ResteasyProviderFactory; import org.keycloak.authorization.store.syncronization.ClientApplicationSynchronizer; import org.keycloak.authorization.store.syncronization.RealmSynchronizer; import org.keycloak.authorization.store.syncronization.Synchronizer; -import org.keycloak.models.KeycloakSession; import org.keycloak.models.KeycloakSessionFactory; import org.keycloak.models.RealmModel.ClientRemovedEvent; import org.keycloak.models.RealmModel.RealmRemovedEvent; diff --git a/server-spi/src/main/java/org/keycloak/authorization/store/syncronization/ClientApplicationSynchronizer.java b/server-spi/src/main/java/org/keycloak/authorization/store/syncronization/ClientApplicationSynchronizer.java index 67683ff9de..686eeef4b0 100644 --- a/server-spi/src/main/java/org/keycloak/authorization/store/syncronization/ClientApplicationSynchronizer.java +++ b/server-spi/src/main/java/org/keycloak/authorization/store/syncronization/ClientApplicationSynchronizer.java @@ -20,7 +20,6 @@ package org.keycloak.authorization.store.syncronization; import org.keycloak.authorization.AuthorizationProvider; import org.keycloak.authorization.model.ResourceServer; -import org.keycloak.authorization.store.AuthorizationStoreFactory; import org.keycloak.authorization.store.ResourceServerStore; import org.keycloak.authorization.store.StoreFactory; import org.keycloak.models.KeycloakSessionFactory; diff --git a/server-spi/src/main/java/org/keycloak/broker/provider/DefaultDataMarshaller.java b/server-spi/src/main/java/org/keycloak/broker/provider/DefaultDataMarshaller.java index b013e8e33d..8aa8dab3d2 100644 --- a/server-spi/src/main/java/org/keycloak/broker/provider/DefaultDataMarshaller.java +++ b/server-spi/src/main/java/org/keycloak/broker/provider/DefaultDataMarshaller.java @@ -17,12 +17,12 @@ package org.keycloak.broker.provider; -import java.io.IOException; -import java.util.List; - import org.keycloak.common.util.Base64Url; import org.keycloak.util.JsonSerialization; +import java.io.IOException; +import java.util.List; + /** * @author Marek Posolda */ diff --git a/server-spi/src/main/java/org/keycloak/cluster/ClusterProvider.java b/server-spi/src/main/java/org/keycloak/cluster/ClusterProvider.java index 498782baf4..6c22056c99 100644 --- a/server-spi/src/main/java/org/keycloak/cluster/ClusterProvider.java +++ b/server-spi/src/main/java/org/keycloak/cluster/ClusterProvider.java @@ -18,10 +18,10 @@ package org.keycloak.cluster; -import java.util.concurrent.Callable; - import org.keycloak.provider.Provider; +import java.util.concurrent.Callable; + /** * Various utils related to clustering and concurrent tasks on cluster nodes * diff --git a/server-spi/src/main/java/org/keycloak/component/ComponentFactory.java b/server-spi/src/main/java/org/keycloak/component/ComponentFactory.java index b107d5a59a..284d29dbb0 100644 --- a/server-spi/src/main/java/org/keycloak/component/ComponentFactory.java +++ b/server-spi/src/main/java/org/keycloak/component/ComponentFactory.java @@ -19,12 +19,7 @@ package org.keycloak.component; import org.keycloak.models.KeycloakSession; import org.keycloak.provider.ConfiguredProvider; import org.keycloak.provider.Provider; -import org.keycloak.provider.ProviderConfigProperty; import org.keycloak.provider.ProviderFactory; -import org.keycloak.storage.UserStorageProviderModel; - -import java.util.Collections; -import java.util.List; /** * @author Bill Burke diff --git a/server-spi/src/main/java/org/keycloak/component/ComponentModel.java b/server-spi/src/main/java/org/keycloak/component/ComponentModel.java index 338bc4b8af..c80df69824 100755 --- a/server-spi/src/main/java/org/keycloak/component/ComponentModel.java +++ b/server-spi/src/main/java/org/keycloak/component/ComponentModel.java @@ -20,10 +20,6 @@ package org.keycloak.component; import org.keycloak.common.util.MultivaluedHashMap; import java.io.Serializable; -import java.util.Comparator; -import java.util.HashMap; -import java.util.List; -import java.util.Map; /** * Stored configuration of a User Storage provider instance. diff --git a/server-spi/src/main/java/org/keycloak/component/ConfiguredComponent.java b/server-spi/src/main/java/org/keycloak/component/ConfiguredComponent.java index 835cd3986a..814e3682ab 100644 --- a/server-spi/src/main/java/org/keycloak/component/ConfiguredComponent.java +++ b/server-spi/src/main/java/org/keycloak/component/ConfiguredComponent.java @@ -16,7 +16,6 @@ */ package org.keycloak.component; -import org.keycloak.models.KeycloakSession; import org.keycloak.provider.ConfiguredProvider; /** diff --git a/server-spi/src/main/java/org/keycloak/component/PrioritizedComponentModel.java b/server-spi/src/main/java/org/keycloak/component/PrioritizedComponentModel.java index 7a0393a4bc..51da6c1345 100644 --- a/server-spi/src/main/java/org/keycloak/component/PrioritizedComponentModel.java +++ b/server-spi/src/main/java/org/keycloak/component/PrioritizedComponentModel.java @@ -16,9 +16,6 @@ */ package org.keycloak.component; -import org.keycloak.component.ComponentModel; -import org.keycloak.storage.UserStorageProviderModel; - import java.util.Comparator; /** diff --git a/server-spi/src/main/java/org/keycloak/credential/CredentialInputUpdater.java b/server-spi/src/main/java/org/keycloak/credential/CredentialInputUpdater.java index 3456f8f5e1..f4e3165200 100644 --- a/server-spi/src/main/java/org/keycloak/credential/CredentialInputUpdater.java +++ b/server-spi/src/main/java/org/keycloak/credential/CredentialInputUpdater.java @@ -19,8 +19,6 @@ package org.keycloak.credential; import org.keycloak.models.RealmModel; import org.keycloak.models.UserModel; -import java.util.Set; - /** * @author Bill Burke * @version $Revision: 1 $ diff --git a/server-spi/src/main/java/org/keycloak/credential/CredentialInputValidator.java b/server-spi/src/main/java/org/keycloak/credential/CredentialInputValidator.java index a7a4c6d58a..95e1d1e2db 100644 --- a/server-spi/src/main/java/org/keycloak/credential/CredentialInputValidator.java +++ b/server-spi/src/main/java/org/keycloak/credential/CredentialInputValidator.java @@ -18,10 +18,6 @@ package org.keycloak.credential; import org.keycloak.models.RealmModel; import org.keycloak.models.UserModel; -import org.keycloak.provider.Provider; - -import java.util.List; -import java.util.Set; /** * @author Bill Burke diff --git a/server-spi/src/main/java/org/keycloak/credential/CredentialModel.java b/server-spi/src/main/java/org/keycloak/credential/CredentialModel.java index 24b7772398..d3600ba125 100755 --- a/server-spi/src/main/java/org/keycloak/credential/CredentialModel.java +++ b/server-spi/src/main/java/org/keycloak/credential/CredentialModel.java @@ -20,8 +20,6 @@ package org.keycloak.credential; import org.keycloak.common.util.MultivaluedHashMap; import java.io.Serializable; -import java.util.List; -import java.util.Map; /** * Used just in cases when we want to "directly" update or retrieve the hash or salt of user credential (For example during export/import) diff --git a/server-spi/src/main/java/org/keycloak/credential/CredentialProviderFactory.java b/server-spi/src/main/java/org/keycloak/credential/CredentialProviderFactory.java index 9ad2bc8c87..f853e6e7c5 100755 --- a/server-spi/src/main/java/org/keycloak/credential/CredentialProviderFactory.java +++ b/server-spi/src/main/java/org/keycloak/credential/CredentialProviderFactory.java @@ -18,18 +18,8 @@ package org.keycloak.credential; import org.keycloak.Config; -import org.keycloak.component.ComponentFactory; -import org.keycloak.component.ComponentModel; -import org.keycloak.component.ComponentValidationException; -import org.keycloak.models.KeycloakSession; import org.keycloak.models.KeycloakSessionFactory; -import org.keycloak.provider.ProviderConfigProperty; import org.keycloak.provider.ProviderFactory; -import org.keycloak.storage.UserStorageProvider; - -import java.util.Collections; -import java.util.List; -import java.util.Set; /** * @author Bill Burke diff --git a/server-spi/src/main/java/org/keycloak/credential/CredentialSpi.java b/server-spi/src/main/java/org/keycloak/credential/CredentialSpi.java index 34bd43f1b1..c6277504cd 100644 --- a/server-spi/src/main/java/org/keycloak/credential/CredentialSpi.java +++ b/server-spi/src/main/java/org/keycloak/credential/CredentialSpi.java @@ -17,8 +17,6 @@ package org.keycloak.credential; -import org.keycloak.credential.hash.PasswordHashProvider; -import org.keycloak.credential.hash.PasswordHashProviderFactory; import org.keycloak.provider.Provider; import org.keycloak.provider.ProviderFactory; import org.keycloak.provider.Spi; diff --git a/server-spi/src/main/java/org/keycloak/credential/hash/PasswordHashProvider.java b/server-spi/src/main/java/org/keycloak/credential/hash/PasswordHashProvider.java index 74fe7cd00c..0a4013efab 100644 --- a/server-spi/src/main/java/org/keycloak/credential/hash/PasswordHashProvider.java +++ b/server-spi/src/main/java/org/keycloak/credential/hash/PasswordHashProvider.java @@ -19,7 +19,6 @@ package org.keycloak.credential.hash; import org.keycloak.credential.CredentialModel; import org.keycloak.models.PasswordPolicy; -import org.keycloak.models.UserCredentialValueModel; import org.keycloak.provider.Provider; /** diff --git a/server-spi/src/main/java/org/keycloak/events/EventBuilder.java b/server-spi/src/main/java/org/keycloak/events/EventBuilder.java index c55feb5e8d..837d35191a 100755 --- a/server-spi/src/main/java/org/keycloak/events/EventBuilder.java +++ b/server-spi/src/main/java/org/keycloak/events/EventBuilder.java @@ -19,12 +19,12 @@ package org.keycloak.events; import org.jboss.logging.Logger; import org.keycloak.common.ClientConnection; +import org.keycloak.common.util.Time; import org.keycloak.models.ClientModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; import org.keycloak.models.UserModel; import org.keycloak.models.UserSessionModel; -import org.keycloak.common.util.Time; import java.util.HashMap; import java.util.LinkedList; diff --git a/server-spi/src/main/java/org/keycloak/forms/account/AccountProvider.java b/server-spi/src/main/java/org/keycloak/forms/account/AccountProvider.java index f82164fc41..7c20cf7bd2 100755 --- a/server-spi/src/main/java/org/keycloak/forms/account/AccountProvider.java +++ b/server-spi/src/main/java/org/keycloak/forms/account/AccountProvider.java @@ -17,13 +17,6 @@ package org.keycloak.forms.account; -import java.util.List; - -import javax.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriInfo; - import org.keycloak.events.Event; import org.keycloak.models.RealmModel; import org.keycloak.models.UserModel; @@ -31,6 +24,12 @@ import org.keycloak.models.UserSessionModel; import org.keycloak.models.utils.FormMessage; import org.keycloak.provider.Provider; +import javax.ws.rs.core.HttpHeaders; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.UriInfo; +import java.util.List; + /** * @author Stian Thorgersen */ diff --git a/server-spi/src/main/java/org/keycloak/forms/login/LoginFormsProvider.java b/server-spi/src/main/java/org/keycloak/forms/login/LoginFormsProvider.java index 88b309e960..f16f0c2165 100755 --- a/server-spi/src/main/java/org/keycloak/forms/login/LoginFormsProvider.java +++ b/server-spi/src/main/java/org/keycloak/forms/login/LoginFormsProvider.java @@ -17,12 +17,6 @@ package org.keycloak.forms.login; -import java.net.URI; -import java.util.List; - -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Response; - import org.keycloak.models.ClientSessionModel; import org.keycloak.models.ProtocolMapperModel; import org.keycloak.models.RoleModel; @@ -30,6 +24,11 @@ import org.keycloak.models.UserModel; import org.keycloak.models.utils.FormMessage; import org.keycloak.provider.Provider; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.Response; +import java.net.URI; +import java.util.List; + /** * @author Stian Thorgersen */ diff --git a/server-spi/src/main/java/org/keycloak/mappers/UserFederationMapper.java b/server-spi/src/main/java/org/keycloak/mappers/UserFederationMapper.java index 98fa98d6c3..9e4be6f822 100644 --- a/server-spi/src/main/java/org/keycloak/mappers/UserFederationMapper.java +++ b/server-spi/src/main/java/org/keycloak/mappers/UserFederationMapper.java @@ -17,8 +17,6 @@ package org.keycloak.mappers; -import java.util.List; - import org.keycloak.models.GroupModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; @@ -28,6 +26,8 @@ import org.keycloak.models.UserFederationSyncResult; import org.keycloak.models.UserModel; import org.keycloak.provider.Provider; +import java.util.List; + /** * @author Marek Posolda */ diff --git a/server-spi/src/main/java/org/keycloak/mappers/UserFederationMapperFactory.java b/server-spi/src/main/java/org/keycloak/mappers/UserFederationMapperFactory.java index 0efcf2ea9f..023d1819eb 100644 --- a/server-spi/src/main/java/org/keycloak/mappers/UserFederationMapperFactory.java +++ b/server-spi/src/main/java/org/keycloak/mappers/UserFederationMapperFactory.java @@ -17,8 +17,6 @@ package org.keycloak.mappers; -import java.util.Map; - import org.keycloak.models.RealmModel; import org.keycloak.models.UserFederationMapperModel; import org.keycloak.models.UserFederationProviderModel; @@ -26,6 +24,8 @@ import org.keycloak.provider.ConfiguredProvider; import org.keycloak.provider.ProviderFactory; import org.keycloak.representations.idm.UserFederationMapperSyncConfigRepresentation; +import java.util.Map; + /** * @author Marek Posolda */ diff --git a/server-spi/src/main/java/org/keycloak/migration/migrators/MigrateTo1_2_0.java b/server-spi/src/main/java/org/keycloak/migration/migrators/MigrateTo1_2_0.java index d363a10e53..5cd00378b9 100755 --- a/server-spi/src/main/java/org/keycloak/migration/migrators/MigrateTo1_2_0.java +++ b/server-spi/src/main/java/org/keycloak/migration/migrators/MigrateTo1_2_0.java @@ -26,7 +26,6 @@ import org.keycloak.models.RoleModel; import org.keycloak.models.utils.KeycloakModelUtils; import java.util.List; -import java.util.Map; /** * @author Bill Burke diff --git a/server-spi/src/main/java/org/keycloak/migration/migrators/MigrateTo1_3_0.java b/server-spi/src/main/java/org/keycloak/migration/migrators/MigrateTo1_3_0.java index ee337147aa..2b03f6e217 100755 --- a/server-spi/src/main/java/org/keycloak/migration/migrators/MigrateTo1_3_0.java +++ b/server-spi/src/main/java/org/keycloak/migration/migrators/MigrateTo1_3_0.java @@ -27,12 +27,11 @@ import org.keycloak.models.UserFederationProvider; import org.keycloak.models.UserFederationProviderFactory; import org.keycloak.models.UserFederationProviderModel; +import javax.naming.directory.SearchControls; import java.util.List; import java.util.Map; import java.util.Set; -import javax.naming.directory.SearchControls; - /** * @author Bill Burke * @version $Revision: 1 $ diff --git a/server-spi/src/main/java/org/keycloak/migration/migrators/MigrateTo1_6_0.java b/server-spi/src/main/java/org/keycloak/migration/migrators/MigrateTo1_6_0.java index c3d922258d..aab2d527e2 100644 --- a/server-spi/src/main/java/org/keycloak/migration/migrators/MigrateTo1_6_0.java +++ b/server-spi/src/main/java/org/keycloak/migration/migrators/MigrateTo1_6_0.java @@ -16,14 +16,20 @@ */ package org.keycloak.migration.migrators; -import java.util.List; - import org.keycloak.Config; import org.keycloak.migration.MigrationProvider; import org.keycloak.migration.ModelVersion; -import org.keycloak.models.*; +import org.keycloak.models.AdminRoles; +import org.keycloak.models.ClientModel; +import org.keycloak.models.Constants; +import org.keycloak.models.KeycloakSession; +import org.keycloak.models.ProtocolMapperModel; +import org.keycloak.models.RealmModel; +import org.keycloak.models.RoleModel; import org.keycloak.models.utils.KeycloakModelUtils; +import java.util.List; + /** * @author Marek Posolda */ diff --git a/server-spi/src/main/java/org/keycloak/migration/migrators/MigrateTo1_7_0.java b/server-spi/src/main/java/org/keycloak/migration/migrators/MigrateTo1_7_0.java index 3d4a5d5c9f..55e09586ab 100644 --- a/server-spi/src/main/java/org/keycloak/migration/migrators/MigrateTo1_7_0.java +++ b/server-spi/src/main/java/org/keycloak/migration/migrators/MigrateTo1_7_0.java @@ -17,8 +17,6 @@ package org.keycloak.migration.migrators; -import java.util.List; - import org.keycloak.migration.MigrationProvider; import org.keycloak.migration.ModelVersion; import org.keycloak.models.AuthenticationFlowModel; @@ -28,6 +26,8 @@ import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; import org.keycloak.models.utils.DefaultAuthenticationFlows; +import java.util.List; + /** * @author Marek Posolda */ diff --git a/server-spi/src/main/java/org/keycloak/migration/migrators/MigrateTo1_8_0.java b/server-spi/src/main/java/org/keycloak/migration/migrators/MigrateTo1_8_0.java index 549cde9a7c..79fb02cc7d 100644 --- a/server-spi/src/main/java/org/keycloak/migration/migrators/MigrateTo1_8_0.java +++ b/server-spi/src/main/java/org/keycloak/migration/migrators/MigrateTo1_8_0.java @@ -17,8 +17,6 @@ package org.keycloak.migration.migrators; -import java.util.List; -import java.util.Map; import org.keycloak.migration.ModelVersion; import org.keycloak.models.KeycloakSession; import org.keycloak.models.LDAPConstants; @@ -27,6 +25,9 @@ import org.keycloak.models.UserFederationMapperModel; import org.keycloak.models.UserFederationProviderModel; import org.keycloak.models.utils.KeycloakModelUtils; +import java.util.List; +import java.util.Map; + /** * @author Marek Posolda */ diff --git a/server-spi/src/main/java/org/keycloak/migration/migrators/MigrateTo1_9_0.java b/server-spi/src/main/java/org/keycloak/migration/migrators/MigrateTo1_9_0.java index e91f1265b1..241cac72a4 100644 --- a/server-spi/src/main/java/org/keycloak/migration/migrators/MigrateTo1_9_0.java +++ b/server-spi/src/main/java/org/keycloak/migration/migrators/MigrateTo1_9_0.java @@ -19,16 +19,8 @@ package org.keycloak.migration.migrators; import org.keycloak.Config; import org.keycloak.migration.ModelVersion; -import org.keycloak.models.Constants; import org.keycloak.models.KeycloakSession; -import org.keycloak.models.LDAPConstants; import org.keycloak.models.RealmModel; -import org.keycloak.models.UserFederationMapperModel; -import org.keycloak.models.UserFederationProviderModel; -import org.keycloak.models.utils.KeycloakModelUtils; - -import java.util.List; -import java.util.Map; /** * @author Marek Posolda diff --git a/server-spi/src/main/java/org/keycloak/migration/migrators/MigrateTo2_2_0.java b/server-spi/src/main/java/org/keycloak/migration/migrators/MigrateTo2_2_0.java index 1dbcba4200..411bf243dd 100644 --- a/server-spi/src/main/java/org/keycloak/migration/migrators/MigrateTo2_2_0.java +++ b/server-spi/src/main/java/org/keycloak/migration/migrators/MigrateTo2_2_0.java @@ -19,16 +19,11 @@ package org.keycloak.migration.migrators; import org.jboss.logging.Logger; import org.keycloak.migration.ModelVersion; -import org.keycloak.models.AuthenticationExecutionModel; -import org.keycloak.models.AuthenticatorConfigModel; import org.keycloak.models.IdentityProviderModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; import org.keycloak.models.utils.DefaultAuthenticationFlows; -import java.util.HashMap; -import java.util.Map; - public class MigrateTo2_2_0 implements Migration { public static final ModelVersion VERSION = new ModelVersion("2.2.0"); diff --git a/server-spi/src/main/java/org/keycloak/migration/migrators/MigrationUtils.java b/server-spi/src/main/java/org/keycloak/migration/migrators/MigrationUtils.java index 2afbbcc1e8..e9d0cb911d 100644 --- a/server-spi/src/main/java/org/keycloak/migration/migrators/MigrationUtils.java +++ b/server-spi/src/main/java/org/keycloak/migration/migrators/MigrationUtils.java @@ -18,7 +18,13 @@ package org.keycloak.migration.migrators; import org.keycloak.Config; -import org.keycloak.models.*; +import org.keycloak.models.AdminRoles; +import org.keycloak.models.ClientModel; +import org.keycloak.models.Constants; +import org.keycloak.models.RealmModel; +import org.keycloak.models.RequiredActionProviderModel; +import org.keycloak.models.RoleModel; +import org.keycloak.models.UserModel; /** * @author Stian Thorgersen diff --git a/server-spi/src/main/java/org/keycloak/models/AuthenticationExecutionModel.java b/server-spi/src/main/java/org/keycloak/models/AuthenticationExecutionModel.java index 304b5f39c2..666d5dc9d1 100755 --- a/server-spi/src/main/java/org/keycloak/models/AuthenticationExecutionModel.java +++ b/server-spi/src/main/java/org/keycloak/models/AuthenticationExecutionModel.java @@ -17,8 +17,8 @@ package org.keycloak.models; -import java.util.Comparator; import java.io.Serializable; +import java.util.Comparator; /** * @author Bill Burke diff --git a/server-spi/src/main/java/org/keycloak/models/ClientModel.java b/server-spi/src/main/java/org/keycloak/models/ClientModel.java index 6d96eb0a6b..072cda3a9c 100755 --- a/server-spi/src/main/java/org/keycloak/models/ClientModel.java +++ b/server-spi/src/main/java/org/keycloak/models/ClientModel.java @@ -17,7 +17,6 @@ package org.keycloak.models; -import java.util.List; import java.util.Map; import java.util.Set; diff --git a/server-spi/src/main/java/org/keycloak/models/KeycloakSession.java b/server-spi/src/main/java/org/keycloak/models/KeycloakSession.java index 2a1ad0ff4c..c880250eaa 100755 --- a/server-spi/src/main/java/org/keycloak/models/KeycloakSession.java +++ b/server-spi/src/main/java/org/keycloak/models/KeycloakSession.java @@ -21,7 +21,6 @@ import org.keycloak.models.cache.UserCache; import org.keycloak.provider.Provider; import org.keycloak.scripting.ScriptingProvider; import org.keycloak.storage.federated.UserFederatedStorageProvider; -import org.keycloak.storage.federated.UserFederatedStorageProviderFactory; import java.util.Set; diff --git a/server-spi/src/main/java/org/keycloak/models/UserCredentialManager.java b/server-spi/src/main/java/org/keycloak/models/UserCredentialManager.java index 0dd1aae40e..8dad996608 100644 --- a/server-spi/src/main/java/org/keycloak/models/UserCredentialManager.java +++ b/server-spi/src/main/java/org/keycloak/models/UserCredentialManager.java @@ -20,7 +20,6 @@ import org.keycloak.credential.CredentialInput; import org.keycloak.credential.UserCredentialStore; import java.util.List; -import java.util.Set; /** * @author Bill Burke diff --git a/server-spi/src/main/java/org/keycloak/models/UserFederationManager.java b/server-spi/src/main/java/org/keycloak/models/UserFederationManager.java index 42f112d15b..205c9c03d6 100755 --- a/server-spi/src/main/java/org/keycloak/models/UserFederationManager.java +++ b/server-spi/src/main/java/org/keycloak/models/UserFederationManager.java @@ -19,14 +19,10 @@ package org.keycloak.models; import org.jboss.logging.Logger; import org.keycloak.component.ComponentModel; -import org.keycloak.credential.CredentialInput; import org.keycloak.models.utils.KeycloakModelUtils; -import org.keycloak.policy.PasswordPolicyManagerProvider; -import org.keycloak.policy.PolicyError; import org.keycloak.services.managers.UserManager; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.LinkedHashSet; diff --git a/server-spi/src/main/java/org/keycloak/models/entities/UsernameLoginFailureEntity.java b/server-spi/src/main/java/org/keycloak/models/entities/UsernameLoginFailureEntity.java deleted file mode 100644 index 0265fe6be4..0000000000 --- a/server-spi/src/main/java/org/keycloak/models/entities/UsernameLoginFailureEntity.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.models.entities; - -/** - * @author Marek Posolda - */ -public class UsernameLoginFailureEntity extends AbstractIdentifiableEntity { - - private String username; - private int failedLoginNotBefore; - private int numFailures; - private long lastFailure; - private String lastIPFailure; - - private String realmId; - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public int getFailedLoginNotBefore() { - return failedLoginNotBefore; - } - - public void setFailedLoginNotBefore(int failedLoginNotBefore) { - this.failedLoginNotBefore = failedLoginNotBefore; - } - - public int getNumFailures() { - return numFailures; - } - - public void setNumFailures(int numFailures) { - this.numFailures = numFailures; - } - - public long getLastFailure() { - return lastFailure; - } - - public void setLastFailure(long lastFailure) { - this.lastFailure = lastFailure; - } - - public String getLastIPFailure() { - return lastIPFailure; - } - - public void setLastIPFailure(String lastIPFailure) { - this.lastIPFailure = lastIPFailure; - } - - public String getRealmId() { - return realmId; - } - - public void setRealmId(String realmId) { - this.realmId = realmId; - } - - public void clearFailures() { - this.numFailures = 0; - this.lastFailure = 0; - this.lastIPFailure = null; - this.failedLoginNotBefore = 0; - } -} diff --git a/server-spi/src/main/java/org/keycloak/models/session/DisabledUserSessionPersisterProvider.java b/server-spi/src/main/java/org/keycloak/models/session/DisabledUserSessionPersisterProvider.java index a67f10c698..f5e58d33bf 100644 --- a/server-spi/src/main/java/org/keycloak/models/session/DisabledUserSessionPersisterProvider.java +++ b/server-spi/src/main/java/org/keycloak/models/session/DisabledUserSessionPersisterProvider.java @@ -17,9 +17,6 @@ package org.keycloak.models.session; -import java.util.Collections; -import java.util.List; - import org.keycloak.Config; import org.keycloak.models.ClientModel; import org.keycloak.models.ClientSessionModel; @@ -29,6 +26,9 @@ import org.keycloak.models.RealmModel; import org.keycloak.models.UserModel; import org.keycloak.models.UserSessionModel; +import java.util.Collections; +import java.util.List; + /** * Persistence of userSessions is disabled . Useful just if you never need survive of userSessions/clientSessions * among server restart. Offline sessions / offline tokens will be invalid after server restart as well, diff --git a/server-spi/src/main/java/org/keycloak/models/session/PersistentClientSessionAdapter.java b/server-spi/src/main/java/org/keycloak/models/session/PersistentClientSessionAdapter.java index e55d28241b..f842787a2c 100644 --- a/server-spi/src/main/java/org/keycloak/models/session/PersistentClientSessionAdapter.java +++ b/server-spi/src/main/java/org/keycloak/models/session/PersistentClientSessionAdapter.java @@ -17,13 +17,6 @@ package org.keycloak.models.session; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - import com.fasterxml.jackson.annotation.JsonProperty; import org.keycloak.models.ClientModel; import org.keycloak.models.ClientSessionModel; @@ -33,6 +26,13 @@ import org.keycloak.models.UserModel; import org.keycloak.models.UserSessionModel; import org.keycloak.util.JsonSerialization; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + /** * @author Marek Posolda */ diff --git a/server-spi/src/main/java/org/keycloak/models/session/PersistentUserSessionAdapter.java b/server-spi/src/main/java/org/keycloak/models/session/PersistentUserSessionAdapter.java index dad4867e0c..6047be29ea 100644 --- a/server-spi/src/main/java/org/keycloak/models/session/PersistentUserSessionAdapter.java +++ b/server-spi/src/main/java/org/keycloak/models/session/PersistentUserSessionAdapter.java @@ -17,11 +17,6 @@ package org.keycloak.models.session; -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - import com.fasterxml.jackson.annotation.JsonProperty; import org.keycloak.models.ClientSessionModel; import org.keycloak.models.ModelException; @@ -30,6 +25,11 @@ import org.keycloak.models.UserModel; import org.keycloak.models.UserSessionModel; import org.keycloak.util.JsonSerialization; +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + /** * @author Marek Posolda */ diff --git a/server-spi/src/main/java/org/keycloak/models/session/UserSessionPersisterProvider.java b/server-spi/src/main/java/org/keycloak/models/session/UserSessionPersisterProvider.java index 4a27d0c8e3..c0d033acb0 100644 --- a/server-spi/src/main/java/org/keycloak/models/session/UserSessionPersisterProvider.java +++ b/server-spi/src/main/java/org/keycloak/models/session/UserSessionPersisterProvider.java @@ -17,8 +17,6 @@ package org.keycloak.models.session; -import java.util.List; - import org.keycloak.models.ClientModel; import org.keycloak.models.ClientSessionModel; import org.keycloak.models.RealmModel; @@ -26,6 +24,8 @@ import org.keycloak.models.UserModel; import org.keycloak.models.UserSessionModel; import org.keycloak.provider.Provider; +import java.util.List; + /** * @author Marek Posolda */ diff --git a/server-spi/src/main/java/org/keycloak/models/utils/CredentialValidation.java b/server-spi/src/main/java/org/keycloak/models/utils/CredentialValidation.java index 4bbb2ab192..e2e31e6838 100755 --- a/server-spi/src/main/java/org/keycloak/models/utils/CredentialValidation.java +++ b/server-spi/src/main/java/org/keycloak/models/utils/CredentialValidation.java @@ -18,20 +18,15 @@ package org.keycloak.models.utils; import org.keycloak.common.util.Time; -import org.keycloak.hash.PasswordHashManager; import org.keycloak.jose.jws.JWSInput; import org.keycloak.jose.jws.JWSInputException; import org.keycloak.jose.jws.crypto.RSAProvider; -import org.keycloak.models.KeycloakSession; import org.keycloak.models.OTPPolicy; import org.keycloak.models.RealmModel; import org.keycloak.models.UserCredentialModel; -import org.keycloak.models.UserCredentialValueModel; import org.keycloak.models.UserModel; import org.keycloak.representations.PasswordToken; -import java.util.List; - /** * @author Bill Burke * @version $Revision: 1 $ diff --git a/server-spi/src/main/java/org/keycloak/models/utils/DefaultAuthenticationFlows.java b/server-spi/src/main/java/org/keycloak/models/utils/DefaultAuthenticationFlows.java index a738d05af7..b02881406e 100755 --- a/server-spi/src/main/java/org/keycloak/models/utils/DefaultAuthenticationFlows.java +++ b/server-spi/src/main/java/org/keycloak/models/utils/DefaultAuthenticationFlows.java @@ -17,11 +17,6 @@ package org.keycloak.models.utils; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - import org.keycloak.models.AuthenticationExecutionModel; import org.keycloak.models.AuthenticationFlowModel; import org.keycloak.models.AuthenticatorConfigModel; @@ -29,6 +24,11 @@ import org.keycloak.models.RealmModel; import org.keycloak.models.RequiredCredentialModel; import org.keycloak.representations.idm.IdentityProviderRepresentation; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + /** * @author Bill Burke * @version $Revision: 1 $ diff --git a/server-spi/src/main/java/org/keycloak/models/utils/KeycloakModelUtils.java b/server-spi/src/main/java/org/keycloak/models/utils/KeycloakModelUtils.java index b8adc6271d..6774b6f430 100755 --- a/server-spi/src/main/java/org/keycloak/models/utils/KeycloakModelUtils.java +++ b/server-spi/src/main/java/org/keycloak/models/utils/KeycloakModelUtils.java @@ -19,6 +19,8 @@ package org.keycloak.models.utils; import org.bouncycastle.openssl.PEMWriter; import org.keycloak.common.util.Base64Url; +import org.keycloak.common.util.CertificateUtils; +import org.keycloak.common.util.PemUtils; import org.keycloak.models.AuthenticationExecutionModel; import org.keycloak.models.AuthenticationFlowModel; import org.keycloak.models.ClientModel; @@ -42,13 +44,9 @@ import org.keycloak.models.UserFederationProviderFactory; import org.keycloak.models.UserFederationProviderModel; import org.keycloak.models.UserModel; import org.keycloak.representations.idm.CertificateRepresentation; -import org.keycloak.common.util.CertificateUtils; -import org.keycloak.common.util.PemUtils; import org.keycloak.transaction.JtaTransactionManagerLookup; import javax.crypto.spec.SecretKeySpec; -import javax.naming.InitialContext; -import javax.sql.DataSource; import javax.transaction.InvalidTransactionException; import javax.transaction.SystemException; import javax.transaction.Transaction; @@ -62,7 +60,6 @@ import java.security.PrivateKey; import java.security.PublicKey; import java.security.SecureRandom; import java.security.cert.X509Certificate; -import java.sql.DriverManager; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; @@ -70,7 +67,6 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.UUID; -import java.util.function.Function; /** * Set of helper methods, which are useful in various model implementations. diff --git a/server-spi/src/main/java/org/keycloak/models/utils/ModelToRepresentation.java b/server-spi/src/main/java/org/keycloak/models/utils/ModelToRepresentation.java index 659c116419..36b1d2b762 100755 --- a/server-spi/src/main/java/org/keycloak/models/utils/ModelToRepresentation.java +++ b/server-spi/src/main/java/org/keycloak/models/utils/ModelToRepresentation.java @@ -25,6 +25,7 @@ import org.keycloak.authorization.model.Scope; import org.keycloak.authorization.store.PolicyStore; import org.keycloak.authorization.store.ResourceStore; import org.keycloak.authorization.store.StoreFactory; +import org.keycloak.common.util.Time; import org.keycloak.component.ComponentModel; import org.keycloak.credential.CredentialModel; import org.keycloak.events.Event; @@ -54,7 +55,6 @@ import org.keycloak.models.UserFederationMapperModel; import org.keycloak.models.UserFederationProviderModel; import org.keycloak.models.UserModel; import org.keycloak.models.UserSessionModel; - import org.keycloak.provider.ProviderConfigProperty; import org.keycloak.representations.idm.AdminEventRepresentation; import org.keycloak.representations.idm.AuthDetailsRepresentation; @@ -81,7 +81,6 @@ import org.keycloak.representations.idm.UserFederationMapperRepresentation; import org.keycloak.representations.idm.UserFederationProviderRepresentation; import org.keycloak.representations.idm.UserRepresentation; import org.keycloak.representations.idm.UserSessionRepresentation; -import org.keycloak.common.util.Time; import org.keycloak.representations.idm.authorization.PolicyRepresentation; import org.keycloak.representations.idm.authorization.ResourceOwnerRepresentation; import org.keycloak.representations.idm.authorization.ResourceRepresentation; diff --git a/server-spi/src/main/java/org/keycloak/models/utils/RepresentationToModel.java b/server-spi/src/main/java/org/keycloak/models/utils/RepresentationToModel.java index f228bc7631..5e60d43d66 100755 --- a/server-spi/src/main/java/org/keycloak/models/utils/RepresentationToModel.java +++ b/server-spi/src/main/java/org/keycloak/models/utils/RepresentationToModel.java @@ -17,6 +17,7 @@ package org.keycloak.models.utils; +import org.jboss.logging.Logger; import org.keycloak.authorization.AuthorizationProvider; import org.keycloak.authorization.AuthorizationProviderFactory; import org.keycloak.authorization.model.Policy; @@ -28,23 +29,23 @@ import org.keycloak.authorization.store.ResourceServerStore; import org.keycloak.authorization.store.ResourceStore; import org.keycloak.authorization.store.ScopeStore; import org.keycloak.authorization.store.StoreFactory; +import org.keycloak.common.enums.SslRequired; +import org.keycloak.common.util.Base64; import org.keycloak.common.util.MultivaluedHashMap; +import org.keycloak.common.util.UriUtils; import org.keycloak.component.ComponentModel; import org.keycloak.credential.CredentialModel; import org.keycloak.hash.Pbkdf2PasswordHashProvider; -import org.keycloak.migration.migrators.MigrationUtils; -import org.keycloak.models.ClientTemplateModel; -import org.keycloak.models.Constants; -import org.keycloak.common.util.Base64; -import org.jboss.logging.Logger; -import org.keycloak.common.enums.SslRequired; import org.keycloak.migration.MigrationProvider; +import org.keycloak.migration.migrators.MigrationUtils; import org.keycloak.models.AuthenticationExecutionModel; import org.keycloak.models.AuthenticationFlowModel; import org.keycloak.models.AuthenticatorConfigModel; import org.keycloak.models.BrowserSecurityHeaders; import org.keycloak.models.ClaimMask; import org.keycloak.models.ClientModel; +import org.keycloak.models.ClientTemplateModel; +import org.keycloak.models.Constants; import org.keycloak.models.FederatedIdentityModel; import org.keycloak.models.GroupModel; import org.keycloak.models.IdentityProviderMapperModel; @@ -60,11 +61,9 @@ import org.keycloak.models.RoleModel; import org.keycloak.models.ScopeContainerModel; import org.keycloak.models.UserConsentModel; import org.keycloak.models.UserCredentialModel; -import org.keycloak.models.UserCredentialValueModel; import org.keycloak.models.UserFederationMapperModel; import org.keycloak.models.UserFederationProviderModel; import org.keycloak.models.UserModel; -import org.keycloak.common.util.UriUtils; import org.keycloak.representations.idm.ApplicationRepresentation; import org.keycloak.representations.idm.AuthenticationExecutionExportRepresentation; import org.keycloak.representations.idm.AuthenticationExecutionRepresentation; diff --git a/server-spi/src/main/java/org/keycloak/models/utils/UserModelDelegate.java b/server-spi/src/main/java/org/keycloak/models/utils/UserModelDelegate.java index 9efdfad282..a08e18a4e7 100755 --- a/server-spi/src/main/java/org/keycloak/models/utils/UserModelDelegate.java +++ b/server-spi/src/main/java/org/keycloak/models/utils/UserModelDelegate.java @@ -19,10 +19,7 @@ package org.keycloak.models.utils; import org.keycloak.models.ClientModel; import org.keycloak.models.GroupModel; -import org.keycloak.models.UserConsentModel; import org.keycloak.models.RoleModel; -import org.keycloak.models.UserCredentialModel; -import org.keycloak.models.UserCredentialValueModel; import org.keycloak.models.UserModel; import java.util.List; diff --git a/server-spi/src/main/java/org/keycloak/policy/HistoryPasswordPolicyProvider.java b/server-spi/src/main/java/org/keycloak/policy/HistoryPasswordPolicyProvider.java index b65aff216c..154ea56b39 100644 --- a/server-spi/src/main/java/org/keycloak/policy/HistoryPasswordPolicyProvider.java +++ b/server-spi/src/main/java/org/keycloak/policy/HistoryPasswordPolicyProvider.java @@ -20,17 +20,11 @@ package org.keycloak.policy; import org.jboss.logging.Logger; import org.keycloak.credential.CredentialModel; import org.keycloak.credential.hash.PasswordHashProvider; -import org.keycloak.hash.PasswordHashManager; import org.keycloak.models.KeycloakSession; import org.keycloak.models.PasswordPolicy; import org.keycloak.models.RealmModel; -import org.keycloak.models.UserCredentialModel; -import org.keycloak.models.UserCredentialValueModel; import org.keycloak.models.UserModel; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; import java.util.List; /** diff --git a/server-spi/src/main/java/org/keycloak/services/managers/BruteForceProtectorSpi.java b/server-spi/src/main/java/org/keycloak/services/managers/BruteForceProtectorSpi.java index 567d7a0601..0d3e24cca1 100755 --- a/server-spi/src/main/java/org/keycloak/services/managers/BruteForceProtectorSpi.java +++ b/server-spi/src/main/java/org/keycloak/services/managers/BruteForceProtectorSpi.java @@ -17,8 +17,6 @@ package org.keycloak.services.managers; -import org.keycloak.models.UserFederationProvider; -import org.keycloak.models.UserFederationProviderFactory; import org.keycloak.provider.Provider; import org.keycloak.provider.ProviderFactory; import org.keycloak.provider.Spi; diff --git a/server-spi/src/main/java/org/keycloak/services/managers/ClientSessionCode.java b/server-spi/src/main/java/org/keycloak/services/managers/ClientSessionCode.java index 8c096edae9..5cf883d655 100755 --- a/server-spi/src/main/java/org/keycloak/services/managers/ClientSessionCode.java +++ b/server-spi/src/main/java/org/keycloak/services/managers/ClientSessionCode.java @@ -17,6 +17,8 @@ package org.keycloak.services.managers; +import org.keycloak.common.util.Base64Url; +import org.keycloak.common.util.Time; import org.keycloak.models.ClientModel; import org.keycloak.models.ClientSessionModel; import org.keycloak.models.ClientTemplateModel; @@ -24,14 +26,11 @@ import org.keycloak.models.KeycloakSession; import org.keycloak.models.ProtocolMapperModel; import org.keycloak.models.RealmModel; import org.keycloak.models.RoleModel; -import org.keycloak.common.util.Base64Url; -import org.keycloak.common.util.Time; import javax.crypto.Mac; import java.security.Key; import java.util.HashSet; import java.util.Set; -import java.util.UUID; /** * @author Bill Burke diff --git a/server-spi/src/main/java/org/keycloak/storage/adapter/AbstractUserAdapter.java b/server-spi/src/main/java/org/keycloak/storage/adapter/AbstractUserAdapter.java index 157f9ddba2..49d22889ed 100644 --- a/server-spi/src/main/java/org/keycloak/storage/adapter/AbstractUserAdapter.java +++ b/server-spi/src/main/java/org/keycloak/storage/adapter/AbstractUserAdapter.java @@ -24,8 +24,6 @@ import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; import org.keycloak.models.RoleContainerModel; import org.keycloak.models.RoleModel; -import org.keycloak.models.UserCredentialModel; -import org.keycloak.models.UserCredentialValueModel; import org.keycloak.models.UserModel; import org.keycloak.models.utils.DefaultRoles; import org.keycloak.models.utils.KeycloakModelUtils; diff --git a/server-spi/src/main/java/org/keycloak/storage/adapter/AbstractUserAdapterFederatedStorage.java b/server-spi/src/main/java/org/keycloak/storage/adapter/AbstractUserAdapterFederatedStorage.java index 705a87265d..68e068998b 100644 --- a/server-spi/src/main/java/org/keycloak/storage/adapter/AbstractUserAdapterFederatedStorage.java +++ b/server-spi/src/main/java/org/keycloak/storage/adapter/AbstractUserAdapterFederatedStorage.java @@ -23,8 +23,6 @@ import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; import org.keycloak.models.RoleContainerModel; import org.keycloak.models.RoleModel; -import org.keycloak.models.UserCredentialModel; -import org.keycloak.models.UserCredentialValueModel; import org.keycloak.models.UserModel; import org.keycloak.models.utils.DefaultRoles; import org.keycloak.models.utils.KeycloakModelUtils; diff --git a/server-spi/src/main/java/org/keycloak/storage/federated/UserAttributeFederatedStorage.java b/server-spi/src/main/java/org/keycloak/storage/federated/UserAttributeFederatedStorage.java index 08755da564..6c04521607 100644 --- a/server-spi/src/main/java/org/keycloak/storage/federated/UserAttributeFederatedStorage.java +++ b/server-spi/src/main/java/org/keycloak/storage/federated/UserAttributeFederatedStorage.java @@ -21,8 +21,6 @@ import org.keycloak.models.RealmModel; import org.keycloak.models.UserModel; import java.util.List; -import java.util.Map; -import java.util.Set; /** * @author Bill Burke diff --git a/server-spi/src/main/java/org/keycloak/storage/federated/UserFederatedStorageProvider.java b/server-spi/src/main/java/org/keycloak/storage/federated/UserFederatedStorageProvider.java index 4a45301967..5bf764b6dd 100755 --- a/server-spi/src/main/java/org/keycloak/storage/federated/UserFederatedStorageProvider.java +++ b/server-spi/src/main/java/org/keycloak/storage/federated/UserFederatedStorageProvider.java @@ -28,7 +28,6 @@ import org.keycloak.models.UserModel; import org.keycloak.provider.Provider; import java.util.List; -import java.util.Set; /** * @author Bill Burke diff --git a/services/src/main/java/org/keycloak/authentication/AuthenticationProcessor.java b/services/src/main/java/org/keycloak/authentication/AuthenticationProcessor.java index cd921bbb11..691acf8cdb 100755 --- a/services/src/main/java/org/keycloak/authentication/AuthenticationProcessor.java +++ b/services/src/main/java/org/keycloak/authentication/AuthenticationProcessor.java @@ -17,12 +17,12 @@ package org.keycloak.authentication; -import org.jboss.resteasy.annotations.cache.NoCache; import org.jboss.resteasy.spi.HttpRequest; -import org.keycloak.common.ClientConnection; import org.keycloak.OAuth2Constants; import org.keycloak.authentication.authenticators.browser.AbstractUsernameFormAuthenticator; import org.keycloak.authentication.authenticators.client.ClientAuthUtil; +import org.keycloak.common.ClientConnection; +import org.keycloak.common.util.Time; import org.keycloak.events.Details; import org.keycloak.events.Errors; import org.keycloak.events.EventBuilder; @@ -48,7 +48,6 @@ import org.keycloak.services.managers.BruteForceProtector; import org.keycloak.services.managers.ClientSessionCode; import org.keycloak.services.messages.Messages; import org.keycloak.services.resources.LoginActionsService; -import org.keycloak.common.util.Time; import org.keycloak.services.util.CacheControlUtil; import javax.ws.rs.core.Response; diff --git a/services/src/main/java/org/keycloak/authentication/ClientAuthenticationFlow.java b/services/src/main/java/org/keycloak/authentication/ClientAuthenticationFlow.java index 47ada2dd84..4d3ae65290 100755 --- a/services/src/main/java/org/keycloak/authentication/ClientAuthenticationFlow.java +++ b/services/src/main/java/org/keycloak/authentication/ClientAuthenticationFlow.java @@ -17,12 +17,6 @@ package org.keycloak.authentication; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import javax.ws.rs.core.Response; - import org.keycloak.events.Details; import org.keycloak.events.Errors; import org.keycloak.models.AuthenticationExecutionModel; @@ -31,6 +25,11 @@ import org.keycloak.models.ClientModel; import org.keycloak.models.utils.KeycloakModelUtils; import org.keycloak.services.ServicesLogger; +import javax.ws.rs.core.Response; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + /** * @author Marek Posolda */ diff --git a/services/src/main/java/org/keycloak/authentication/FormAuthenticationFlow.java b/services/src/main/java/org/keycloak/authentication/FormAuthenticationFlow.java index 6ec5825451..59c85fb74a 100755 --- a/services/src/main/java/org/keycloak/authentication/FormAuthenticationFlow.java +++ b/services/src/main/java/org/keycloak/authentication/FormAuthenticationFlow.java @@ -18,8 +18,8 @@ package org.keycloak.authentication; import org.jboss.resteasy.spi.HttpRequest; -import org.keycloak.common.ClientConnection; import org.keycloak.OAuth2Constants; +import org.keycloak.common.ClientConnection; import org.keycloak.events.EventBuilder; import org.keycloak.forms.login.LoginFormsProvider; import org.keycloak.models.AuthenticationExecutionModel; @@ -35,7 +35,12 @@ import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriInfo; import java.net.URI; -import java.util.*; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; /** * @author Bill Burke diff --git a/services/src/main/java/org/keycloak/authentication/RequiredActionContextResult.java b/services/src/main/java/org/keycloak/authentication/RequiredActionContextResult.java index 25eb750fc4..684075e848 100755 --- a/services/src/main/java/org/keycloak/authentication/RequiredActionContextResult.java +++ b/services/src/main/java/org/keycloak/authentication/RequiredActionContextResult.java @@ -18,8 +18,9 @@ package org.keycloak.authentication; import org.jboss.resteasy.spi.HttpRequest; -import org.keycloak.common.ClientConnection; import org.keycloak.OAuth2Constants; +import org.keycloak.common.ClientConnection; +import org.keycloak.common.util.Time; import org.keycloak.events.EventBuilder; import org.keycloak.forms.login.LoginFormsProvider; import org.keycloak.models.ClientSessionModel; @@ -29,7 +30,6 @@ import org.keycloak.models.UserModel; import org.keycloak.models.UserSessionModel; import org.keycloak.services.managers.ClientSessionCode; import org.keycloak.services.resources.LoginActionsService; -import org.keycloak.common.util.Time; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriInfo; diff --git a/services/src/main/java/org/keycloak/authentication/authenticators/broker/AbstractIdpAuthenticator.java b/services/src/main/java/org/keycloak/authentication/authenticators/broker/AbstractIdpAuthenticator.java index 1aa0fd97d4..87108da0a3 100644 --- a/services/src/main/java/org/keycloak/authentication/authenticators/broker/AbstractIdpAuthenticator.java +++ b/services/src/main/java/org/keycloak/authentication/authenticators/broker/AbstractIdpAuthenticator.java @@ -17,8 +17,6 @@ package org.keycloak.authentication.authenticators.broker; -import javax.ws.rs.core.Response; - import org.keycloak.authentication.AuthenticationFlowContext; import org.keycloak.authentication.AuthenticationFlowError; import org.keycloak.authentication.AuthenticationFlowException; @@ -33,6 +31,8 @@ import org.keycloak.models.RealmModel; import org.keycloak.models.UserModel; import org.keycloak.services.messages.Messages; +import javax.ws.rs.core.Response; + /** * @author Marek Posolda */ diff --git a/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpConfirmLinkAuthenticator.java b/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpConfirmLinkAuthenticator.java index ca88dbc7de..407f8cc31f 100755 --- a/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpConfirmLinkAuthenticator.java +++ b/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpConfirmLinkAuthenticator.java @@ -17,9 +17,6 @@ package org.keycloak.authentication.authenticators.broker; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Response; - import org.keycloak.authentication.AuthenticationFlowContext; import org.keycloak.authentication.AuthenticationFlowError; import org.keycloak.authentication.AuthenticationFlowException; @@ -34,6 +31,9 @@ import org.keycloak.models.UserModel; import org.keycloak.services.ServicesLogger; import org.keycloak.services.messages.Messages; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.Response; + /** * @author Marek Posolda */ diff --git a/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpConfirmLinkAuthenticatorFactory.java b/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpConfirmLinkAuthenticatorFactory.java index e2252efdb9..ca94180e30 100644 --- a/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpConfirmLinkAuthenticatorFactory.java +++ b/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpConfirmLinkAuthenticatorFactory.java @@ -17,8 +17,6 @@ package org.keycloak.authentication.authenticators.broker; -import java.util.List; - import org.keycloak.Config; import org.keycloak.authentication.Authenticator; import org.keycloak.authentication.AuthenticatorFactory; @@ -27,6 +25,8 @@ import org.keycloak.models.KeycloakSession; import org.keycloak.models.KeycloakSessionFactory; import org.keycloak.provider.ProviderConfigProperty; +import java.util.List; + /** * @author Marek Posolda */ diff --git a/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpCreateUserIfUniqueAuthenticator.java b/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpCreateUserIfUniqueAuthenticator.java index 6971ab5dd9..c39d975e16 100644 --- a/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpCreateUserIfUniqueAuthenticator.java +++ b/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpCreateUserIfUniqueAuthenticator.java @@ -17,11 +17,6 @@ package org.keycloak.authentication.authenticators.broker; -import java.util.List; -import java.util.Map; - -import javax.ws.rs.core.Response; - import org.keycloak.authentication.AuthenticationFlowContext; import org.keycloak.authentication.authenticators.broker.util.ExistingUserInfo; import org.keycloak.authentication.authenticators.broker.util.SerializedBrokeredIdentityContext; @@ -35,6 +30,10 @@ import org.keycloak.models.UserModel; import org.keycloak.services.ServicesLogger; import org.keycloak.services.messages.Messages; +import javax.ws.rs.core.Response; +import java.util.List; +import java.util.Map; + /** * @author Marek Posolda */ diff --git a/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpCreateUserIfUniqueAuthenticatorFactory.java b/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpCreateUserIfUniqueAuthenticatorFactory.java index 230fe6fb4b..c4e968dded 100644 --- a/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpCreateUserIfUniqueAuthenticatorFactory.java +++ b/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpCreateUserIfUniqueAuthenticatorFactory.java @@ -17,9 +17,6 @@ package org.keycloak.authentication.authenticators.broker; -import java.util.ArrayList; -import java.util.List; - import org.keycloak.Config; import org.keycloak.authentication.Authenticator; import org.keycloak.authentication.AuthenticatorFactory; @@ -28,6 +25,9 @@ import org.keycloak.models.KeycloakSession; import org.keycloak.models.KeycloakSessionFactory; import org.keycloak.provider.ProviderConfigProperty; +import java.util.ArrayList; +import java.util.List; + /** * @author Marek Posolda */ diff --git a/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpEmailVerificationAuthenticator.java b/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpEmailVerificationAuthenticator.java index e56e7e6e31..936ac7b863 100755 --- a/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpEmailVerificationAuthenticator.java +++ b/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpEmailVerificationAuthenticator.java @@ -17,16 +17,10 @@ package org.keycloak.authentication.authenticators.broker; -import java.util.concurrent.TimeUnit; - -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriBuilder; - import org.keycloak.authentication.AuthenticationFlowContext; import org.keycloak.authentication.AuthenticationFlowError; -import org.keycloak.authentication.requiredactions.VerifyEmail; import org.keycloak.authentication.authenticators.broker.util.SerializedBrokeredIdentityContext; +import org.keycloak.authentication.requiredactions.VerifyEmail; import org.keycloak.broker.provider.BrokeredIdentityContext; import org.keycloak.email.EmailException; import org.keycloak.email.EmailTemplateProvider; @@ -44,6 +38,11 @@ import org.keycloak.services.ServicesLogger; import org.keycloak.services.messages.Messages; import org.keycloak.services.resources.LoginActionsService; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.UriBuilder; +import java.util.concurrent.TimeUnit; + /** * @author Marek Posolda */ diff --git a/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpEmailVerificationAuthenticatorFactory.java b/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpEmailVerificationAuthenticatorFactory.java index 990131012b..ef14089040 100644 --- a/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpEmailVerificationAuthenticatorFactory.java +++ b/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpEmailVerificationAuthenticatorFactory.java @@ -17,8 +17,6 @@ package org.keycloak.authentication.authenticators.broker; -import java.util.List; - import org.keycloak.Config; import org.keycloak.authentication.Authenticator; import org.keycloak.authentication.AuthenticatorFactory; @@ -27,6 +25,8 @@ import org.keycloak.models.KeycloakSession; import org.keycloak.models.KeycloakSessionFactory; import org.keycloak.provider.ProviderConfigProperty; +import java.util.List; + /** * @author Marek Posolda */ diff --git a/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpReviewProfileAuthenticator.java b/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpReviewProfileAuthenticator.java index b9a28164f4..003983d148 100755 --- a/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpReviewProfileAuthenticator.java +++ b/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpReviewProfileAuthenticator.java @@ -17,11 +17,6 @@ package org.keycloak.authentication.authenticators.broker; -import java.util.List; - -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Response; - import org.keycloak.authentication.AuthenticationFlowContext; import org.keycloak.authentication.authenticators.broker.util.SerializedBrokeredIdentityContext; import org.keycloak.broker.provider.BrokeredIdentityContext; @@ -41,6 +36,10 @@ import org.keycloak.services.ServicesLogger; import org.keycloak.services.resources.AttributeFormDataProcessor; import org.keycloak.services.validation.Validation; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.Response; +import java.util.List; + /** * @author Marek Posolda */ diff --git a/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpReviewProfileAuthenticatorFactory.java b/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpReviewProfileAuthenticatorFactory.java index b0aced8b55..4937db3658 100644 --- a/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpReviewProfileAuthenticatorFactory.java +++ b/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpReviewProfileAuthenticatorFactory.java @@ -17,10 +17,6 @@ package org.keycloak.authentication.authenticators.broker; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - import org.keycloak.Config; import org.keycloak.authentication.Authenticator; import org.keycloak.authentication.AuthenticatorFactory; @@ -30,6 +26,10 @@ import org.keycloak.models.KeycloakSessionFactory; import org.keycloak.provider.ProviderConfigProperty; import org.keycloak.representations.idm.IdentityProviderRepresentation; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + /** * @author Marek Posolda */ diff --git a/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpUsernamePasswordForm.java b/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpUsernamePasswordForm.java index 5b0e1523b3..cd09c37159 100755 --- a/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpUsernamePasswordForm.java +++ b/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpUsernamePasswordForm.java @@ -17,19 +17,19 @@ package org.keycloak.authentication.authenticators.broker; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Response; - import org.keycloak.authentication.AuthenticationFlowContext; import org.keycloak.authentication.AuthenticationFlowError; import org.keycloak.authentication.AuthenticationFlowException; -import org.keycloak.authentication.authenticators.browser.UsernamePasswordForm; import org.keycloak.authentication.authenticators.broker.util.SerializedBrokeredIdentityContext; +import org.keycloak.authentication.authenticators.browser.UsernamePasswordForm; import org.keycloak.forms.login.LoginFormsProvider; import org.keycloak.models.UserModel; import org.keycloak.services.managers.AuthenticationManager; import org.keycloak.services.messages.Messages; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.Response; + /** * Same like classic username+password form, but username is "known" and user can't change it * diff --git a/services/src/main/java/org/keycloak/authentication/authenticators/broker/util/ExistingUserInfo.java b/services/src/main/java/org/keycloak/authentication/authenticators/broker/util/ExistingUserInfo.java index 883f2a297a..2054441d52 100644 --- a/services/src/main/java/org/keycloak/authentication/authenticators/broker/util/ExistingUserInfo.java +++ b/services/src/main/java/org/keycloak/authentication/authenticators/broker/util/ExistingUserInfo.java @@ -17,10 +17,10 @@ package org.keycloak.authentication.authenticators.broker.util; -import java.io.IOException; - import org.keycloak.util.JsonSerialization; +import java.io.IOException; + /** * @author Marek Posolda */ diff --git a/services/src/main/java/org/keycloak/authentication/authenticators/broker/util/SerializedBrokeredIdentityContext.java b/services/src/main/java/org/keycloak/authentication/authenticators/broker/util/SerializedBrokeredIdentityContext.java index 952c7f1d69..d1c749be66 100755 --- a/services/src/main/java/org/keycloak/authentication/authenticators/broker/util/SerializedBrokeredIdentityContext.java +++ b/services/src/main/java/org/keycloak/authentication/authenticators/broker/util/SerializedBrokeredIdentityContext.java @@ -17,12 +17,6 @@ package org.keycloak.authentication.authenticators.broker.util; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - import com.fasterxml.jackson.annotation.JsonIgnore; import org.keycloak.authentication.requiredactions.util.UpdateProfileContext; import org.keycloak.broker.provider.BrokeredIdentityContext; @@ -39,6 +33,12 @@ import org.keycloak.models.RealmModel; import org.keycloak.services.resources.IdentityBrokerService; import org.keycloak.util.JsonSerialization; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + /** * @author Marek Posolda */ diff --git a/services/src/main/java/org/keycloak/authentication/authenticators/browser/AbstractUsernameFormAuthenticator.java b/services/src/main/java/org/keycloak/authentication/authenticators/browser/AbstractUsernameFormAuthenticator.java index 52491012f0..6c10318aa1 100755 --- a/services/src/main/java/org/keycloak/authentication/authenticators/browser/AbstractUsernameFormAuthenticator.java +++ b/services/src/main/java/org/keycloak/authentication/authenticators/browser/AbstractUsernameFormAuthenticator.java @@ -18,8 +18,8 @@ package org.keycloak.authentication.authenticators.browser; import org.keycloak.authentication.AbstractFormAuthenticator; -import org.keycloak.authentication.AuthenticationFlowError; import org.keycloak.authentication.AuthenticationFlowContext; +import org.keycloak.authentication.AuthenticationFlowError; import org.keycloak.credential.CredentialInput; import org.keycloak.events.Details; import org.keycloak.events.Errors; diff --git a/services/src/main/java/org/keycloak/authentication/authenticators/browser/ConditionalOtpFormAuthenticator.java b/services/src/main/java/org/keycloak/authentication/authenticators/browser/ConditionalOtpFormAuthenticator.java index 019e6472a6..fdaa48187a 100644 --- a/services/src/main/java/org/keycloak/authentication/authenticators/browser/ConditionalOtpFormAuthenticator.java +++ b/services/src/main/java/org/keycloak/authentication/authenticators/browser/ConditionalOtpFormAuthenticator.java @@ -26,7 +26,9 @@ import java.util.List; import java.util.Map; import java.util.regex.Pattern; -import static org.keycloak.authentication.authenticators.browser.ConditionalOtpFormAuthenticator.OtpDecision.*; +import static org.keycloak.authentication.authenticators.browser.ConditionalOtpFormAuthenticator.OtpDecision.ABSTAIN; +import static org.keycloak.authentication.authenticators.browser.ConditionalOtpFormAuthenticator.OtpDecision.SHOW_OTP; +import static org.keycloak.authentication.authenticators.browser.ConditionalOtpFormAuthenticator.OtpDecision.SKIP_OTP; import static org.keycloak.models.utils.KeycloakModelUtils.getRoleFromString; import static org.keycloak.models.utils.KeycloakModelUtils.hasRole; diff --git a/services/src/main/java/org/keycloak/authentication/authenticators/browser/ConditionalOtpFormAuthenticatorFactory.java b/services/src/main/java/org/keycloak/authentication/authenticators/browser/ConditionalOtpFormAuthenticatorFactory.java index facc61b2c2..f19cbb6547 100755 --- a/services/src/main/java/org/keycloak/authentication/authenticators/browser/ConditionalOtpFormAuthenticatorFactory.java +++ b/services/src/main/java/org/keycloak/authentication/authenticators/browser/ConditionalOtpFormAuthenticatorFactory.java @@ -29,8 +29,17 @@ import org.keycloak.provider.ProviderConfigProperty; import java.util.List; import static java.util.Arrays.asList; -import static org.keycloak.authentication.authenticators.browser.ConditionalOtpFormAuthenticator.*; -import static org.keycloak.provider.ProviderConfigProperty.*; +import static org.keycloak.authentication.authenticators.browser.ConditionalOtpFormAuthenticator.DEFAULT_OTP_OUTCOME; +import static org.keycloak.authentication.authenticators.browser.ConditionalOtpFormAuthenticator.FORCE; +import static org.keycloak.authentication.authenticators.browser.ConditionalOtpFormAuthenticator.FORCE_OTP_FOR_HTTP_HEADER; +import static org.keycloak.authentication.authenticators.browser.ConditionalOtpFormAuthenticator.FORCE_OTP_ROLE; +import static org.keycloak.authentication.authenticators.browser.ConditionalOtpFormAuthenticator.OTP_CONTROL_USER_ATTRIBUTE; +import static org.keycloak.authentication.authenticators.browser.ConditionalOtpFormAuthenticator.SKIP; +import static org.keycloak.authentication.authenticators.browser.ConditionalOtpFormAuthenticator.SKIP_OTP_FOR_HTTP_HEADER; +import static org.keycloak.authentication.authenticators.browser.ConditionalOtpFormAuthenticator.SKIP_OTP_ROLE; +import static org.keycloak.provider.ProviderConfigProperty.LIST_TYPE; +import static org.keycloak.provider.ProviderConfigProperty.ROLE_TYPE; +import static org.keycloak.provider.ProviderConfigProperty.STRING_TYPE; /** * An {@link AuthenticatorFactory} for {@link ConditionalOtpFormAuthenticator}s. diff --git a/services/src/main/java/org/keycloak/authentication/authenticators/browser/CookieAuthenticator.java b/services/src/main/java/org/keycloak/authentication/authenticators/browser/CookieAuthenticator.java index 6c961e1d70..b4552af50f 100755 --- a/services/src/main/java/org/keycloak/authentication/authenticators/browser/CookieAuthenticator.java +++ b/services/src/main/java/org/keycloak/authentication/authenticators/browser/CookieAuthenticator.java @@ -19,17 +19,12 @@ package org.keycloak.authentication.authenticators.browser; import org.keycloak.authentication.AuthenticationFlowContext; import org.keycloak.authentication.Authenticator; -import org.keycloak.common.util.Time; import org.keycloak.models.ClientSessionModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; import org.keycloak.models.UserModel; -import org.keycloak.models.UserSessionModel; import org.keycloak.protocol.LoginProtocol; -import org.keycloak.protocol.oidc.OIDCLoginProtocol; -import org.keycloak.services.ServicesLogger; import org.keycloak.services.managers.AuthenticationManager; -import org.keycloak.util.TokenUtil; /** * @author Bill Burke diff --git a/services/src/main/java/org/keycloak/authentication/authenticators/browser/OTPFormAuthenticator.java b/services/src/main/java/org/keycloak/authentication/authenticators/browser/OTPFormAuthenticator.java index 543aa967c5..9df33fca68 100755 --- a/services/src/main/java/org/keycloak/authentication/authenticators/browser/OTPFormAuthenticator.java +++ b/services/src/main/java/org/keycloak/authentication/authenticators/browser/OTPFormAuthenticator.java @@ -17,8 +17,8 @@ package org.keycloak.authentication.authenticators.browser; -import org.keycloak.authentication.AuthenticationFlowError; import org.keycloak.authentication.AuthenticationFlowContext; +import org.keycloak.authentication.AuthenticationFlowError; import org.keycloak.authentication.Authenticator; import org.keycloak.events.Errors; import org.keycloak.forms.login.LoginFormsProvider; @@ -31,8 +31,6 @@ import org.keycloak.services.messages.Messages; import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.core.Response; -import java.util.LinkedList; -import java.util.List; /** * @author Bill Burke diff --git a/services/src/main/java/org/keycloak/authentication/authenticators/browser/SpnegoAuthenticator.java b/services/src/main/java/org/keycloak/authentication/authenticators/browser/SpnegoAuthenticator.java index c290c9ac33..1d6e7ae300 100755 --- a/services/src/main/java/org/keycloak/authentication/authenticators/browser/SpnegoAuthenticator.java +++ b/services/src/main/java/org/keycloak/authentication/authenticators/browser/SpnegoAuthenticator.java @@ -18,8 +18,8 @@ package org.keycloak.authentication.authenticators.browser; import org.jboss.resteasy.spi.HttpRequest; -import org.keycloak.authentication.AuthenticationFlowError; import org.keycloak.authentication.AuthenticationFlowContext; +import org.keycloak.authentication.AuthenticationFlowError; import org.keycloak.authentication.Authenticator; import org.keycloak.common.constants.KerberosConstants; import org.keycloak.events.Errors; diff --git a/services/src/main/java/org/keycloak/authentication/authenticators/client/ClientAuthUtil.java b/services/src/main/java/org/keycloak/authentication/authenticators/client/ClientAuthUtil.java index 94cefa3297..0b7d7b4bac 100755 --- a/services/src/main/java/org/keycloak/authentication/authenticators/client/ClientAuthUtil.java +++ b/services/src/main/java/org/keycloak/authentication/authenticators/client/ClientAuthUtil.java @@ -17,11 +17,11 @@ package org.keycloak.authentication.authenticators.client; +import org.keycloak.representations.idm.OAuth2ErrorRepresentation; + import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -import org.keycloak.representations.idm.OAuth2ErrorRepresentation; - /** * @author Marek Posolda */ diff --git a/services/src/main/java/org/keycloak/authentication/authenticators/client/ClientIdAndSecretAuthenticator.java b/services/src/main/java/org/keycloak/authentication/authenticators/client/ClientIdAndSecretAuthenticator.java index 4516de492a..b7ecb41512 100644 --- a/services/src/main/java/org/keycloak/authentication/authenticators/client/ClientIdAndSecretAuthenticator.java +++ b/services/src/main/java/org/keycloak/authentication/authenticators/client/ClientIdAndSecretAuthenticator.java @@ -17,20 +17,6 @@ package org.keycloak.authentication.authenticators.client; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedHashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Response; - import org.keycloak.OAuth2Constants; import org.keycloak.authentication.AuthenticationFlowError; import org.keycloak.authentication.ClientAuthenticationFlowContext; @@ -42,6 +28,18 @@ import org.keycloak.representations.idm.CredentialRepresentation; import org.keycloak.services.ServicesLogger; import org.keycloak.util.BasicAuthHelper; +import javax.ws.rs.core.HttpHeaders; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.Response; +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedHashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; + /** * Validates client based on "client_id" and "client_secret" sent either in request parameters or in "Authorization: Basic" header . * diff --git a/services/src/main/java/org/keycloak/authentication/authenticators/client/JWTClientAuthenticator.java b/services/src/main/java/org/keycloak/authentication/authenticators/client/JWTClientAuthenticator.java index 86dd4e8c74..ad9b0efec1 100644 --- a/services/src/main/java/org/keycloak/authentication/authenticators/client/JWTClientAuthenticator.java +++ b/services/src/main/java/org/keycloak/authentication/authenticators/client/JWTClientAuthenticator.java @@ -17,21 +17,6 @@ package org.keycloak.authentication.authenticators.client; -import java.security.PublicKey; -import java.security.cert.X509Certificate; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriBuilder; - import org.keycloak.OAuth2Constants; import org.keycloak.authentication.AuthenticationFlowError; import org.keycloak.authentication.ClientAuthenticationFlowContext; @@ -42,16 +27,26 @@ import org.keycloak.models.AuthenticationExecutionModel; import org.keycloak.models.ClientModel; import org.keycloak.models.ModelException; import org.keycloak.models.RealmModel; -import org.keycloak.models.utils.KeycloakModelUtils; import org.keycloak.protocol.oidc.OIDCLoginProtocol; import org.keycloak.protocol.oidc.OIDCLoginProtocolService; import org.keycloak.provider.ProviderConfigProperty; import org.keycloak.representations.JsonWebToken; -import org.keycloak.representations.idm.CertificateRepresentation; import org.keycloak.services.ServicesLogger; import org.keycloak.services.Urls; import org.keycloak.services.util.CertificateInfoHelper; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.Response; +import java.security.PublicKey; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; + /** * Client authentication based on JWT signed by client private key . * See specs for more details. diff --git a/services/src/main/java/org/keycloak/authentication/authenticators/directgrant/AbstractDirectGrantAuthenticator.java b/services/src/main/java/org/keycloak/authentication/authenticators/directgrant/AbstractDirectGrantAuthenticator.java index 88d0e1574e..b171a8301d 100755 --- a/services/src/main/java/org/keycloak/authentication/authenticators/directgrant/AbstractDirectGrantAuthenticator.java +++ b/services/src/main/java/org/keycloak/authentication/authenticators/directgrant/AbstractDirectGrantAuthenticator.java @@ -18,7 +18,6 @@ package org.keycloak.authentication.authenticators.directgrant; import org.keycloak.Config; -import org.keycloak.OAuth2Constants; import org.keycloak.authentication.AuthenticationFlowContext; import org.keycloak.authentication.Authenticator; import org.keycloak.authentication.AuthenticatorFactory; @@ -28,8 +27,6 @@ import org.keycloak.representations.idm.OAuth2ErrorRepresentation; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -import java.util.HashMap; -import java.util.Map; /** * @author Bill Burke diff --git a/services/src/main/java/org/keycloak/authentication/authenticators/directgrant/ValidateOTP.java b/services/src/main/java/org/keycloak/authentication/authenticators/directgrant/ValidateOTP.java index fd3736cf6a..a9ea094626 100755 --- a/services/src/main/java/org/keycloak/authentication/authenticators/directgrant/ValidateOTP.java +++ b/services/src/main/java/org/keycloak/authentication/authenticators/directgrant/ValidateOTP.java @@ -17,8 +17,8 @@ package org.keycloak.authentication.authenticators.directgrant; -import org.keycloak.authentication.AuthenticationFlowError; import org.keycloak.authentication.AuthenticationFlowContext; +import org.keycloak.authentication.AuthenticationFlowError; import org.keycloak.events.Errors; import org.keycloak.models.AuthenticationExecutionModel; import org.keycloak.models.KeycloakSession; diff --git a/services/src/main/java/org/keycloak/authentication/authenticators/directgrant/ValidatePassword.java b/services/src/main/java/org/keycloak/authentication/authenticators/directgrant/ValidatePassword.java index 033972b902..0de3b2a6fa 100755 --- a/services/src/main/java/org/keycloak/authentication/authenticators/directgrant/ValidatePassword.java +++ b/services/src/main/java/org/keycloak/authentication/authenticators/directgrant/ValidatePassword.java @@ -17,8 +17,8 @@ package org.keycloak.authentication.authenticators.directgrant; -import org.keycloak.authentication.AuthenticationFlowError; import org.keycloak.authentication.AuthenticationFlowContext; +import org.keycloak.authentication.AuthenticationFlowError; import org.keycloak.events.Errors; import org.keycloak.models.AuthenticationExecutionModel; import org.keycloak.models.KeycloakSession; diff --git a/services/src/main/java/org/keycloak/authentication/authenticators/directgrant/ValidateUsername.java b/services/src/main/java/org/keycloak/authentication/authenticators/directgrant/ValidateUsername.java index de48a3c281..54bf8b9356 100755 --- a/services/src/main/java/org/keycloak/authentication/authenticators/directgrant/ValidateUsername.java +++ b/services/src/main/java/org/keycloak/authentication/authenticators/directgrant/ValidateUsername.java @@ -17,8 +17,8 @@ package org.keycloak.authentication.authenticators.directgrant; -import org.keycloak.authentication.AuthenticationFlowError; import org.keycloak.authentication.AuthenticationFlowContext; +import org.keycloak.authentication.AuthenticationFlowError; import org.keycloak.authentication.authenticators.browser.AbstractUsernameFormAuthenticator; import org.keycloak.events.Details; import org.keycloak.events.Errors; diff --git a/services/src/main/java/org/keycloak/authentication/forms/RegistrationPassword.java b/services/src/main/java/org/keycloak/authentication/forms/RegistrationPassword.java index d44e3944f9..0094f0a0e1 100755 --- a/services/src/main/java/org/keycloak/authentication/forms/RegistrationPassword.java +++ b/services/src/main/java/org/keycloak/authentication/forms/RegistrationPassword.java @@ -28,7 +28,6 @@ import org.keycloak.forms.login.LoginFormsProvider; import org.keycloak.models.AuthenticationExecutionModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.KeycloakSessionFactory; -import org.keycloak.models.PasswordPolicy; import org.keycloak.models.RealmModel; import org.keycloak.models.UserCredentialModel; import org.keycloak.models.UserModel; diff --git a/services/src/main/java/org/keycloak/authentication/requiredactions/TermsAndConditions.java b/services/src/main/java/org/keycloak/authentication/requiredactions/TermsAndConditions.java index 4826b62796..f4a156665f 100755 --- a/services/src/main/java/org/keycloak/authentication/requiredactions/TermsAndConditions.java +++ b/services/src/main/java/org/keycloak/authentication/requiredactions/TermsAndConditions.java @@ -17,8 +17,6 @@ package org.keycloak.authentication.requiredactions; -import java.util.Arrays; - import org.keycloak.Config; import org.keycloak.authentication.RequiredActionContext; import org.keycloak.authentication.RequiredActionFactory; @@ -28,6 +26,7 @@ import org.keycloak.models.KeycloakSession; import org.keycloak.models.KeycloakSessionFactory; import javax.ws.rs.core.Response; +import java.util.Arrays; /** * @author Bill Burke diff --git a/services/src/main/java/org/keycloak/authentication/requiredactions/UpdatePassword.java b/services/src/main/java/org/keycloak/authentication/requiredactions/UpdatePassword.java index 9393d3eefa..cafcd72898 100755 --- a/services/src/main/java/org/keycloak/authentication/requiredactions/UpdatePassword.java +++ b/services/src/main/java/org/keycloak/authentication/requiredactions/UpdatePassword.java @@ -21,6 +21,7 @@ import org.keycloak.Config; import org.keycloak.authentication.RequiredActionContext; import org.keycloak.authentication.RequiredActionFactory; import org.keycloak.authentication.RequiredActionProvider; +import org.keycloak.common.util.Time; import org.keycloak.credential.CredentialModel; import org.keycloak.credential.CredentialProvider; import org.keycloak.credential.PasswordCredentialProvider; @@ -33,12 +34,10 @@ import org.keycloak.models.KeycloakSession; import org.keycloak.models.KeycloakSessionFactory; import org.keycloak.models.ModelException; import org.keycloak.models.UserCredentialModel; -import org.keycloak.models.UserCredentialValueModel; import org.keycloak.models.UserModel; import org.keycloak.services.ServicesLogger; import org.keycloak.services.messages.Messages; import org.keycloak.services.validation.Validation; -import org.keycloak.common.util.Time; import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.core.Response; diff --git a/services/src/main/java/org/keycloak/authentication/requiredactions/util/UserUpdateProfileContext.java b/services/src/main/java/org/keycloak/authentication/requiredactions/util/UserUpdateProfileContext.java index f7728142ad..3629a8b6c2 100644 --- a/services/src/main/java/org/keycloak/authentication/requiredactions/util/UserUpdateProfileContext.java +++ b/services/src/main/java/org/keycloak/authentication/requiredactions/util/UserUpdateProfileContext.java @@ -17,12 +17,12 @@ package org.keycloak.authentication.requiredactions.util; -import java.util.List; -import java.util.Map; - import org.keycloak.models.RealmModel; import org.keycloak.models.UserModel; +import java.util.List; +import java.util.Map; + /** * @author Marek Posolda */ diff --git a/services/src/main/java/org/keycloak/authorization/admin/PolicyService.java b/services/src/main/java/org/keycloak/authorization/admin/PolicyService.java index b179378d70..ffc61e5536 100644 --- a/services/src/main/java/org/keycloak/authorization/admin/PolicyService.java +++ b/services/src/main/java/org/keycloak/authorization/admin/PolicyService.java @@ -48,7 +48,6 @@ import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.function.Consumer; import java.util.stream.Collectors; import static org.keycloak.models.utils.ModelToRepresentation.toRepresentation; diff --git a/services/src/main/java/org/keycloak/authorization/authorization/AuthorizationTokenService.java b/services/src/main/java/org/keycloak/authorization/authorization/AuthorizationTokenService.java index 4e7c2a9f0b..cdb7cd00ae 100644 --- a/services/src/main/java/org/keycloak/authorization/authorization/AuthorizationTokenService.java +++ b/services/src/main/java/org/keycloak/authorization/authorization/AuthorizationTokenService.java @@ -64,7 +64,6 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; import java.util.function.Function; -import java.util.function.Predicate; import java.util.stream.Collectors; import java.util.stream.Stream; diff --git a/services/src/main/java/org/keycloak/authorization/entitlement/representation/EntitlementRequest.java b/services/src/main/java/org/keycloak/authorization/entitlement/representation/EntitlementRequest.java index 3afcc31651..444645a448 100644 --- a/services/src/main/java/org/keycloak/authorization/entitlement/representation/EntitlementRequest.java +++ b/services/src/main/java/org/keycloak/authorization/entitlement/representation/EntitlementRequest.java @@ -1,6 +1,5 @@ package org.keycloak.authorization.entitlement.representation; -import com.fasterxml.jackson.annotation.JsonProperty; import org.keycloak.authorization.protection.permission.representation.PermissionRequest; import java.util.ArrayList; diff --git a/services/src/main/java/org/keycloak/authorization/protection/permission/AbstractPermissionService.java b/services/src/main/java/org/keycloak/authorization/protection/permission/AbstractPermissionService.java index eb215f97d0..09bf694c61 100644 --- a/services/src/main/java/org/keycloak/authorization/protection/permission/AbstractPermissionService.java +++ b/services/src/main/java/org/keycloak/authorization/protection/permission/AbstractPermissionService.java @@ -32,7 +32,6 @@ import org.keycloak.services.ErrorResponseException; import javax.ws.rs.core.Response; import java.util.List; import java.util.Set; -import java.util.function.Function; import java.util.stream.Collectors; /** diff --git a/services/src/main/java/org/keycloak/broker/oidc/AbstractOAuth2IdentityProvider.java b/services/src/main/java/org/keycloak/broker/oidc/AbstractOAuth2IdentityProvider.java index bad6d199b9..322c33225e 100755 --- a/services/src/main/java/org/keycloak/broker/oidc/AbstractOAuth2IdentityProvider.java +++ b/services/src/main/java/org/keycloak/broker/oidc/AbstractOAuth2IdentityProvider.java @@ -19,14 +19,13 @@ package org.keycloak.broker.oidc; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import org.jboss.logging.Logger; -import org.keycloak.common.ClientConnection; import org.keycloak.OAuth2Constants; -import org.keycloak.broker.provider.util.SimpleHttp; import org.keycloak.broker.provider.AbstractIdentityProvider; import org.keycloak.broker.provider.AuthenticationRequest; import org.keycloak.broker.provider.BrokeredIdentityContext; import org.keycloak.broker.provider.IdentityBrokerException; -import org.keycloak.truststore.JSSETruststoreConfigurator; +import org.keycloak.broker.provider.util.SimpleHttp; +import org.keycloak.common.ClientConnection; import org.keycloak.events.Errors; import org.keycloak.events.EventBuilder; import org.keycloak.events.EventType; @@ -35,6 +34,7 @@ import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; import org.keycloak.services.ErrorPage; import org.keycloak.services.messages.Messages; +import org.keycloak.truststore.JSSETruststoreConfigurator; import javax.ws.rs.GET; import javax.ws.rs.QueryParam; diff --git a/services/src/main/java/org/keycloak/broker/oidc/KeycloakOIDCIdentityProvider.java b/services/src/main/java/org/keycloak/broker/oidc/KeycloakOIDCIdentityProvider.java index 3c1e5539df..af3078cb3e 100755 --- a/services/src/main/java/org/keycloak/broker/oidc/KeycloakOIDCIdentityProvider.java +++ b/services/src/main/java/org/keycloak/broker/oidc/KeycloakOIDCIdentityProvider.java @@ -17,8 +17,8 @@ package org.keycloak.broker.oidc; -import org.keycloak.broker.provider.util.SimpleHttp; import org.keycloak.broker.provider.BrokeredIdentityContext; +import org.keycloak.broker.provider.util.SimpleHttp; import org.keycloak.constants.AdapterConstants; import org.keycloak.events.EventBuilder; import org.keycloak.jose.jws.JWSInput; diff --git a/services/src/main/java/org/keycloak/broker/oidc/OIDCIdentityProvider.java b/services/src/main/java/org/keycloak/broker/oidc/OIDCIdentityProvider.java index 7e19ea604b..d513e72e6d 100755 --- a/services/src/main/java/org/keycloak/broker/oidc/OIDCIdentityProvider.java +++ b/services/src/main/java/org/keycloak/broker/oidc/OIDCIdentityProvider.java @@ -20,10 +20,11 @@ import com.fasterxml.jackson.databind.JsonNode; import org.jboss.logging.Logger; import org.keycloak.broker.oidc.mappers.AbstractJsonUserAttributeMapper; import org.keycloak.broker.oidc.util.JsonSimpleHttp; -import org.keycloak.broker.provider.util.SimpleHttp; import org.keycloak.broker.provider.AuthenticationRequest; import org.keycloak.broker.provider.BrokeredIdentityContext; import org.keycloak.broker.provider.IdentityBrokerException; +import org.keycloak.broker.provider.util.SimpleHttp; +import org.keycloak.common.util.PemUtils; import org.keycloak.common.util.Time; import org.keycloak.events.Errors; import org.keycloak.events.EventBuilder; @@ -45,7 +46,6 @@ import org.keycloak.services.resources.IdentityBrokerService; import org.keycloak.services.resources.RealmsResource; import org.keycloak.truststore.JSSETruststoreConfigurator; import org.keycloak.util.JsonSerialization; -import org.keycloak.common.util.PemUtils; import javax.ws.rs.GET; import javax.ws.rs.Path; @@ -54,7 +54,6 @@ import javax.ws.rs.core.Context; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriBuilder; import javax.ws.rs.core.UriInfo; - import java.io.IOException; import java.security.PublicKey; diff --git a/services/src/main/java/org/keycloak/broker/oidc/OIDCIdentityProviderFactory.java b/services/src/main/java/org/keycloak/broker/oidc/OIDCIdentityProviderFactory.java index a0e5017504..b42b3e1f3b 100755 --- a/services/src/main/java/org/keycloak/broker/oidc/OIDCIdentityProviderFactory.java +++ b/services/src/main/java/org/keycloak/broker/oidc/OIDCIdentityProviderFactory.java @@ -17,11 +17,11 @@ package org.keycloak.broker.oidc; import org.keycloak.broker.provider.AbstractIdentityProviderFactory; +import org.keycloak.jose.jwk.JSONWebKeySet; import org.keycloak.jose.jwk.JWK; import org.keycloak.models.IdentityProviderModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.utils.KeycloakModelUtils; -import org.keycloak.jose.jwk.JSONWebKeySet; import org.keycloak.protocol.oidc.representations.OIDCConfigurationRepresentation; import org.keycloak.protocol.oidc.utils.JWKSUtils; import org.keycloak.services.ServicesLogger; diff --git a/services/src/main/java/org/keycloak/broker/oidc/mappers/AbstractClaimMapper.java b/services/src/main/java/org/keycloak/broker/oidc/mappers/AbstractClaimMapper.java index 44c71859bf..feb51b67c9 100755 --- a/services/src/main/java/org/keycloak/broker/oidc/mappers/AbstractClaimMapper.java +++ b/services/src/main/java/org/keycloak/broker/oidc/mappers/AbstractClaimMapper.java @@ -17,6 +17,7 @@ package org.keycloak.broker.oidc.mappers; +import com.fasterxml.jackson.databind.JsonNode; import org.keycloak.broker.oidc.KeycloakOIDCIdentityProvider; import org.keycloak.broker.oidc.OIDCIdentityProvider; import org.keycloak.broker.provider.AbstractIdentityProviderMapper; @@ -24,7 +25,6 @@ import org.keycloak.broker.provider.BrokeredIdentityContext; import org.keycloak.models.IdentityProviderMapperModel; import org.keycloak.representations.JsonWebToken; -import com.fasterxml.jackson.databind.JsonNode; import java.util.List; import java.util.Map; diff --git a/services/src/main/java/org/keycloak/broker/oidc/mappers/AbstractJsonUserAttributeMapper.java b/services/src/main/java/org/keycloak/broker/oidc/mappers/AbstractJsonUserAttributeMapper.java index a063ddb145..e718a0d7f7 100755 --- a/services/src/main/java/org/keycloak/broker/oidc/mappers/AbstractJsonUserAttributeMapper.java +++ b/services/src/main/java/org/keycloak/broker/oidc/mappers/AbstractJsonUserAttributeMapper.java @@ -17,9 +17,6 @@ package org.keycloak.broker.oidc.mappers; -import java.util.ArrayList; -import java.util.List; - import com.fasterxml.jackson.databind.JsonNode; import org.jboss.logging.Logger; import org.keycloak.broker.oidc.OIDCIdentityProvider; @@ -31,6 +28,9 @@ import org.keycloak.models.RealmModel; import org.keycloak.models.UserModel; import org.keycloak.provider.ProviderConfigProperty; +import java.util.ArrayList; +import java.util.List; + /** * Abstract class for Social Provider mappers which allow mapping of JSON user profile field into Keycloak user * attribute. Concrete mapper classes with own ID and provider mapping must be implemented for each social provider who diff --git a/services/src/main/java/org/keycloak/broker/saml/SAMLDataMarshaller.java b/services/src/main/java/org/keycloak/broker/saml/SAMLDataMarshaller.java index d9f4359368..78459e89e4 100644 --- a/services/src/main/java/org/keycloak/broker/saml/SAMLDataMarshaller.java +++ b/services/src/main/java/org/keycloak/broker/saml/SAMLDataMarshaller.java @@ -17,12 +17,6 @@ package org.keycloak.broker.saml; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.InputStream; - -import javax.xml.stream.XMLEventReader; - import org.keycloak.broker.provider.DefaultDataMarshaller; import org.keycloak.dom.saml.v2.assertion.AssertionType; import org.keycloak.dom.saml.v2.assertion.AuthnStatementType; @@ -35,6 +29,11 @@ import org.keycloak.saml.processing.core.parsers.util.SAMLParserUtil; import org.keycloak.saml.processing.core.saml.v2.writers.SAMLAssertionWriter; import org.keycloak.saml.processing.core.saml.v2.writers.SAMLResponseWriter; +import javax.xml.stream.XMLEventReader; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.InputStream; + /** * @author Marek Posolda */ diff --git a/services/src/main/java/org/keycloak/broker/saml/SAMLEndpoint.java b/services/src/main/java/org/keycloak/broker/saml/SAMLEndpoint.java index 32d64260cf..f55aa0243d 100755 --- a/services/src/main/java/org/keycloak/broker/saml/SAMLEndpoint.java +++ b/services/src/main/java/org/keycloak/broker/saml/SAMLEndpoint.java @@ -19,11 +19,11 @@ package org.keycloak.broker.saml; import org.jboss.logging.Logger; import org.jboss.resteasy.annotations.cache.NoCache; -import org.keycloak.common.ClientConnection; -import org.keycloak.common.VerificationException; import org.keycloak.broker.provider.BrokeredIdentityContext; import org.keycloak.broker.provider.IdentityBrokerException; import org.keycloak.broker.provider.IdentityProvider; +import org.keycloak.common.ClientConnection; +import org.keycloak.common.VerificationException; import org.keycloak.dom.saml.v2.assertion.AssertionType; import org.keycloak.dom.saml.v2.assertion.AttributeStatementType; import org.keycloak.dom.saml.v2.assertion.AttributeType; @@ -42,10 +42,10 @@ import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; import org.keycloak.models.UserSessionModel; import org.keycloak.protocol.saml.JaxrsSAML2BindingBuilder; -import org.keycloak.saml.SAML2LogoutResponseBuilder; -import org.keycloak.saml.SAMLRequestParser; import org.keycloak.protocol.saml.SamlProtocol; import org.keycloak.protocol.saml.SamlProtocolUtils; +import org.keycloak.saml.SAML2LogoutResponseBuilder; +import org.keycloak.saml.SAMLRequestParser; import org.keycloak.saml.common.constants.GeneralConstants; import org.keycloak.saml.common.constants.JBossSAMLURIConstants; import org.keycloak.saml.common.exceptions.ConfigurationException; diff --git a/services/src/main/java/org/keycloak/connections/httpclient/DefaultHttpClientFactory.java b/services/src/main/java/org/keycloak/connections/httpclient/DefaultHttpClientFactory.java index d881382d2a..217581b343 100755 --- a/services/src/main/java/org/keycloak/connections/httpclient/DefaultHttpClientFactory.java +++ b/services/src/main/java/org/keycloak/connections/httpclient/DefaultHttpClientFactory.java @@ -27,11 +27,11 @@ import org.apache.http.entity.ContentType; import org.apache.http.impl.client.CloseableHttpClient; import org.jboss.logging.Logger; import org.keycloak.Config; -import org.keycloak.truststore.TruststoreProvider; -import org.keycloak.models.KeycloakSession; -import org.keycloak.models.KeycloakSessionFactory; import org.keycloak.common.util.EnvUtil; import org.keycloak.common.util.KeystoreUtil; +import org.keycloak.models.KeycloakSession; +import org.keycloak.models.KeycloakSessionFactory; +import org.keycloak.truststore.TruststoreProvider; import java.io.IOException; import java.io.InputStream; diff --git a/services/src/main/java/org/keycloak/credential/UserCredentialStoreManager.java b/services/src/main/java/org/keycloak/credential/UserCredentialStoreManager.java index fab312774a..065be1fe58 100644 --- a/services/src/main/java/org/keycloak/credential/UserCredentialStoreManager.java +++ b/services/src/main/java/org/keycloak/credential/UserCredentialStoreManager.java @@ -17,29 +17,22 @@ package org.keycloak.credential; import org.keycloak.common.util.reflections.Types; -import org.keycloak.component.ComponentModel; -import org.keycloak.component.PrioritizedComponentModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; import org.keycloak.models.UserCredentialManager; -import org.keycloak.models.UserCredentialModel; import org.keycloak.models.UserFederationProvider; -import org.keycloak.models.UserFederationProviderModel; import org.keycloak.models.UserModel; import org.keycloak.models.cache.CachedUserModel; import org.keycloak.models.cache.OnUserCache; -import org.keycloak.models.utils.KeycloakModelUtils; import org.keycloak.provider.ProviderFactory; import org.keycloak.storage.StorageId; import org.keycloak.storage.UserStorageManager; import org.keycloak.storage.UserStorageProvider; import java.util.Arrays; -import java.util.Collections; import java.util.Iterator; import java.util.LinkedList; import java.util.List; -import java.util.Set; /** * @author Bill Burke diff --git a/services/src/main/java/org/keycloak/credential/hash/Pbkdf2PasswordHashProvider.java b/services/src/main/java/org/keycloak/credential/hash/Pbkdf2PasswordHashProvider.java index d3d9b60fe0..24bff5ee03 100644 --- a/services/src/main/java/org/keycloak/credential/hash/Pbkdf2PasswordHashProvider.java +++ b/services/src/main/java/org/keycloak/credential/hash/Pbkdf2PasswordHashProvider.java @@ -20,8 +20,6 @@ package org.keycloak.credential.hash; import org.keycloak.Config; import org.keycloak.common.util.Base64; import org.keycloak.credential.CredentialModel; -import org.keycloak.credential.hash.PasswordHashProvider; -import org.keycloak.credential.hash.PasswordHashProviderFactory; import org.keycloak.models.KeycloakSession; import org.keycloak.models.KeycloakSessionFactory; import org.keycloak.models.PasswordPolicy; diff --git a/services/src/main/java/org/keycloak/email/DefaultEmailSenderProvider.java b/services/src/main/java/org/keycloak/email/DefaultEmailSenderProvider.java index c19d1e817f..f94fe07485 100644 --- a/services/src/main/java/org/keycloak/email/DefaultEmailSenderProvider.java +++ b/services/src/main/java/org/keycloak/email/DefaultEmailSenderProvider.java @@ -17,12 +17,12 @@ package org.keycloak.email; -import org.keycloak.truststore.HostnameVerificationPolicy; -import org.keycloak.truststore.JSSETruststoreConfigurator; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; import org.keycloak.models.UserModel; import org.keycloak.services.ServicesLogger; +import org.keycloak.truststore.HostnameVerificationPolicy; +import org.keycloak.truststore.JSSETruststoreConfigurator; import javax.mail.MessagingException; import javax.mail.Multipart; diff --git a/services/src/main/java/org/keycloak/email/freemarker/FreeMarkerEmailTemplateProvider.java b/services/src/main/java/org/keycloak/email/freemarker/FreeMarkerEmailTemplateProvider.java index e1a27bccef..5105eaef41 100755 --- a/services/src/main/java/org/keycloak/email/freemarker/FreeMarkerEmailTemplateProvider.java +++ b/services/src/main/java/org/keycloak/email/freemarker/FreeMarkerEmailTemplateProvider.java @@ -26,17 +26,23 @@ import org.keycloak.email.freemarker.beans.EventBean; import org.keycloak.email.freemarker.beans.ProfileBean; import org.keycloak.events.Event; import org.keycloak.events.EventType; +import org.keycloak.models.KeycloakSession; +import org.keycloak.models.RealmModel; +import org.keycloak.models.UserModel; import org.keycloak.theme.FreeMarkerException; import org.keycloak.theme.FreeMarkerUtil; import org.keycloak.theme.Theme; import org.keycloak.theme.ThemeProvider; import org.keycloak.theme.beans.MessageFormatterMethod; -import org.keycloak.models.KeycloakSession; -import org.keycloak.models.RealmModel; -import org.keycloak.models.UserModel; import java.text.MessageFormat; -import java.util.*; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Properties; /** * @author Stian Thorgersen diff --git a/services/src/main/java/org/keycloak/email/freemarker/FreeMarkerEmailTemplateProviderFactory.java b/services/src/main/java/org/keycloak/email/freemarker/FreeMarkerEmailTemplateProviderFactory.java index d047228b26..0cda51d329 100755 --- a/services/src/main/java/org/keycloak/email/freemarker/FreeMarkerEmailTemplateProviderFactory.java +++ b/services/src/main/java/org/keycloak/email/freemarker/FreeMarkerEmailTemplateProviderFactory.java @@ -20,9 +20,9 @@ package org.keycloak.email.freemarker; import org.keycloak.Config; import org.keycloak.email.EmailTemplateProvider; import org.keycloak.email.EmailTemplateProviderFactory; -import org.keycloak.theme.FreeMarkerUtil; import org.keycloak.models.KeycloakSession; import org.keycloak.models.KeycloakSessionFactory; +import org.keycloak.theme.FreeMarkerUtil; /** * @author Stian Thorgersen diff --git a/services/src/main/java/org/keycloak/email/freemarker/beans/AdminEventBean.java b/services/src/main/java/org/keycloak/email/freemarker/beans/AdminEventBean.java index 96a9b56f84..6dae05d760 100644 --- a/services/src/main/java/org/keycloak/email/freemarker/beans/AdminEventBean.java +++ b/services/src/main/java/org/keycloak/email/freemarker/beans/AdminEventBean.java @@ -17,10 +17,10 @@ package org.keycloak.email.freemarker.beans; -import java.util.Date; - import org.keycloak.events.admin.AdminEvent; +import java.util.Date; + /** * @author Giriraj Sharma */ diff --git a/services/src/main/java/org/keycloak/events/email/EmailEventListenerProvider.java b/services/src/main/java/org/keycloak/events/email/EmailEventListenerProvider.java index 0d74811df6..94bd1a3434 100755 --- a/services/src/main/java/org/keycloak/events/email/EmailEventListenerProvider.java +++ b/services/src/main/java/org/keycloak/events/email/EmailEventListenerProvider.java @@ -20,10 +20,10 @@ package org.keycloak.events.email; import org.jboss.logging.Logger; import org.keycloak.email.EmailException; import org.keycloak.email.EmailTemplateProvider; -import org.keycloak.events.admin.AdminEvent; import org.keycloak.events.Event; import org.keycloak.events.EventListenerProvider; import org.keycloak.events.EventType; +import org.keycloak.events.admin.AdminEvent; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; import org.keycloak.models.RealmProvider; diff --git a/services/src/main/java/org/keycloak/events/log/JBossLoggingEventListenerProvider.java b/services/src/main/java/org/keycloak/events/log/JBossLoggingEventListenerProvider.java index 2675175d85..918f51a700 100755 --- a/services/src/main/java/org/keycloak/events/log/JBossLoggingEventListenerProvider.java +++ b/services/src/main/java/org/keycloak/events/log/JBossLoggingEventListenerProvider.java @@ -18,16 +18,15 @@ package org.keycloak.events.log; import org.jboss.logging.Logger; -import org.keycloak.events.admin.AdminEvent; import org.keycloak.events.Event; import org.keycloak.events.EventListenerProvider; +import org.keycloak.events.admin.AdminEvent; import org.keycloak.models.KeycloakContext; import org.keycloak.models.KeycloakSession; import javax.ws.rs.core.Cookie; import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.UriInfo; - import java.util.Map; /** diff --git a/services/src/main/java/org/keycloak/exportimport/ExportImportManager.java b/services/src/main/java/org/keycloak/exportimport/ExportImportManager.java index f8fb7eac2f..b51513cb59 100644 --- a/services/src/main/java/org/keycloak/exportimport/ExportImportManager.java +++ b/services/src/main/java/org/keycloak/exportimport/ExportImportManager.java @@ -18,9 +18,9 @@ package org.keycloak.exportimport; -import org.keycloak.services.ServicesLogger; import org.keycloak.models.KeycloakSession; import org.keycloak.models.KeycloakSessionFactory; +import org.keycloak.services.ServicesLogger; import java.io.IOException; diff --git a/services/src/main/java/org/keycloak/exportimport/util/ExportUtils.java b/services/src/main/java/org/keycloak/exportimport/util/ExportUtils.java index 598b8e21fa..136f51943e 100755 --- a/services/src/main/java/org/keycloak/exportimport/util/ExportUtils.java +++ b/services/src/main/java/org/keycloak/exportimport/util/ExportUtils.java @@ -44,7 +44,6 @@ import org.keycloak.models.RealmModel; import org.keycloak.models.RoleContainerModel; import org.keycloak.models.RoleModel; import org.keycloak.models.UserConsentModel; -import org.keycloak.models.UserCredentialValueModel; import org.keycloak.models.UserFederationManager; import org.keycloak.models.UserModel; import org.keycloak.models.utils.ModelToRepresentation; diff --git a/services/src/main/java/org/keycloak/exportimport/util/ImportUtils.java b/services/src/main/java/org/keycloak/exportimport/util/ImportUtils.java index 769cabb52c..044e89ceee 100755 --- a/services/src/main/java/org/keycloak/exportimport/util/ImportUtils.java +++ b/services/src/main/java/org/keycloak/exportimport/util/ImportUtils.java @@ -25,7 +25,6 @@ import org.jboss.logging.Logger; import org.keycloak.Config; import org.keycloak.exportimport.ExportImportConfig; import org.keycloak.exportimport.Strategy; -import org.keycloak.models.ClientModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; import org.keycloak.models.RealmProvider; @@ -37,7 +36,11 @@ import org.keycloak.services.managers.RealmManager; import java.io.IOException; import java.io.InputStream; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * @author Marek Posolda diff --git a/services/src/main/java/org/keycloak/forms/account/freemarker/FreeMarkerAccountProvider.java b/services/src/main/java/org/keycloak/forms/account/freemarker/FreeMarkerAccountProvider.java index 58c39ec568..6241c855eb 100755 --- a/services/src/main/java/org/keycloak/forms/account/freemarker/FreeMarkerAccountProvider.java +++ b/services/src/main/java/org/keycloak/forms/account/freemarker/FreeMarkerAccountProvider.java @@ -16,28 +16,13 @@ */ package org.keycloak.forms.account.freemarker; -import java.io.IOException; -import java.net.URI; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Properties; - -import javax.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriBuilder; -import javax.ws.rs.core.UriInfo; - import org.jboss.logging.Logger; +import org.keycloak.events.Event; import org.keycloak.forms.account.AccountPages; import org.keycloak.forms.account.AccountProvider; -import org.keycloak.forms.account.freemarker.model.ApplicationsBean; import org.keycloak.forms.account.freemarker.model.AccountBean; import org.keycloak.forms.account.freemarker.model.AccountFederatedIdentityBean; +import org.keycloak.forms.account.freemarker.model.ApplicationsBean; import org.keycloak.forms.account.freemarker.model.FeaturesBean; import org.keycloak.forms.account.freemarker.model.LogBean; import org.keycloak.forms.account.freemarker.model.PasswordBean; @@ -46,7 +31,11 @@ import org.keycloak.forms.account.freemarker.model.ReferrerBean; import org.keycloak.forms.account.freemarker.model.SessionsBean; import org.keycloak.forms.account.freemarker.model.TotpBean; import org.keycloak.forms.account.freemarker.model.UrlBean; -import org.keycloak.events.Event; +import org.keycloak.models.KeycloakSession; +import org.keycloak.models.RealmModel; +import org.keycloak.models.UserModel; +import org.keycloak.models.UserSessionModel; +import org.keycloak.models.utils.FormMessage; import org.keycloak.theme.BrowserSecurityHeaderSetup; import org.keycloak.theme.FreeMarkerException; import org.keycloak.theme.FreeMarkerUtil; @@ -58,13 +47,23 @@ import org.keycloak.theme.beans.MessageBean; import org.keycloak.theme.beans.MessageFormatterMethod; import org.keycloak.theme.beans.MessageType; import org.keycloak.theme.beans.MessagesPerFieldBean; -import org.keycloak.models.KeycloakSession; -import org.keycloak.models.RealmModel; -import org.keycloak.models.UserModel; -import org.keycloak.models.UserSessionModel; -import org.keycloak.models.utils.FormMessage; import org.keycloak.utils.MediaType; +import javax.ws.rs.core.HttpHeaders; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.UriBuilder; +import javax.ws.rs.core.UriInfo; +import java.io.IOException; +import java.net.URI; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Properties; + /** * @author Stian Thorgersen */ diff --git a/services/src/main/java/org/keycloak/forms/account/freemarker/FreeMarkerAccountProviderFactory.java b/services/src/main/java/org/keycloak/forms/account/freemarker/FreeMarkerAccountProviderFactory.java index 6e33353ef9..2902353292 100755 --- a/services/src/main/java/org/keycloak/forms/account/freemarker/FreeMarkerAccountProviderFactory.java +++ b/services/src/main/java/org/keycloak/forms/account/freemarker/FreeMarkerAccountProviderFactory.java @@ -20,9 +20,9 @@ package org.keycloak.forms.account.freemarker; import org.keycloak.Config; import org.keycloak.forms.account.AccountProvider; import org.keycloak.forms.account.AccountProviderFactory; -import org.keycloak.theme.FreeMarkerUtil; import org.keycloak.models.KeycloakSession; import org.keycloak.models.KeycloakSessionFactory; +import org.keycloak.theme.FreeMarkerUtil; /** * @author Stian Thorgersen diff --git a/services/src/main/java/org/keycloak/forms/account/freemarker/model/AccountFederatedIdentityBean.java b/services/src/main/java/org/keycloak/forms/account/freemarker/model/AccountFederatedIdentityBean.java index a20810e8a0..c2544e77d4 100755 --- a/services/src/main/java/org/keycloak/forms/account/freemarker/model/AccountFederatedIdentityBean.java +++ b/services/src/main/java/org/keycloak/forms/account/freemarker/model/AccountFederatedIdentityBean.java @@ -22,11 +22,10 @@ import org.keycloak.models.IdentityProviderModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; import org.keycloak.models.UserModel; -import org.keycloak.services.resources.AccountService; import org.keycloak.services.Urls; +import org.keycloak.services.resources.AccountService; import javax.ws.rs.core.UriBuilder; - import java.net.URI; import java.util.Comparator; import java.util.LinkedList; diff --git a/services/src/main/java/org/keycloak/forms/account/freemarker/model/ApplicationsBean.java b/services/src/main/java/org/keycloak/forms/account/freemarker/model/ApplicationsBean.java index f845903467..82d7fb368c 100755 --- a/services/src/main/java/org/keycloak/forms/account/freemarker/model/ApplicationsBean.java +++ b/services/src/main/java/org/keycloak/forms/account/freemarker/model/ApplicationsBean.java @@ -17,22 +17,22 @@ package org.keycloak.forms.account.freemarker.model; +import org.keycloak.common.util.MultivaluedHashMap; +import org.keycloak.models.ClientModel; +import org.keycloak.models.KeycloakSession; +import org.keycloak.models.ProtocolMapperModel; +import org.keycloak.models.RealmModel; +import org.keycloak.models.RoleModel; +import org.keycloak.models.UserConsentModel; +import org.keycloak.models.UserModel; +import org.keycloak.protocol.oidc.TokenManager; +import org.keycloak.services.managers.UserSessionManager; + import java.util.ArrayList; import java.util.LinkedList; import java.util.List; import java.util.Set; -import org.keycloak.models.ClientModel; -import org.keycloak.models.KeycloakSession; -import org.keycloak.models.UserConsentModel; -import org.keycloak.models.ProtocolMapperModel; -import org.keycloak.models.RealmModel; -import org.keycloak.models.RoleModel; -import org.keycloak.models.UserModel; -import org.keycloak.protocol.oidc.TokenManager; -import org.keycloak.services.managers.UserSessionManager; -import org.keycloak.common.util.MultivaluedHashMap; - /** * @author Marek Posolda */ diff --git a/services/src/main/java/org/keycloak/forms/account/freemarker/model/SessionsBean.java b/services/src/main/java/org/keycloak/forms/account/freemarker/model/SessionsBean.java index aefcc72626..a474f4f138 100755 --- a/services/src/main/java/org/keycloak/forms/account/freemarker/model/SessionsBean.java +++ b/services/src/main/java/org/keycloak/forms/account/freemarker/model/SessionsBean.java @@ -17,11 +17,11 @@ package org.keycloak.forms.account.freemarker.model; +import org.keycloak.common.util.Time; import org.keycloak.models.ClientModel; import org.keycloak.models.ClientSessionModel; import org.keycloak.models.RealmModel; import org.keycloak.models.UserSessionModel; -import org.keycloak.common.util.Time; import java.util.Date; import java.util.HashSet; diff --git a/services/src/main/java/org/keycloak/forms/account/freemarker/model/TotpBean.java b/services/src/main/java/org/keycloak/forms/account/freemarker/model/TotpBean.java index d90f21e89c..21afcff182 100644 --- a/services/src/main/java/org/keycloak/forms/account/freemarker/model/TotpBean.java +++ b/services/src/main/java/org/keycloak/forms/account/freemarker/model/TotpBean.java @@ -20,15 +20,9 @@ package org.keycloak.forms.account.freemarker.model; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; import org.keycloak.models.UserModel; -import org.keycloak.models.utils.Base32; import org.keycloak.models.utils.HmacOTP; import org.keycloak.utils.TotpUtils; -import java.io.UnsupportedEncodingException; -import java.net.URI; -import java.net.URLEncoder; -import java.security.SecureRandom; - /** * @author Stian Thorgersen diff --git a/services/src/main/java/org/keycloak/forms/account/freemarker/model/UrlBean.java b/services/src/main/java/org/keycloak/forms/account/freemarker/model/UrlBean.java index 5558ae1176..6ba04fe09a 100755 --- a/services/src/main/java/org/keycloak/forms/account/freemarker/model/UrlBean.java +++ b/services/src/main/java/org/keycloak/forms/account/freemarker/model/UrlBean.java @@ -17,9 +17,9 @@ package org.keycloak.forms.account.freemarker.model; -import org.keycloak.theme.Theme; import org.keycloak.models.RealmModel; import org.keycloak.services.Urls; +import org.keycloak.theme.Theme; import java.net.URI; diff --git a/services/src/main/java/org/keycloak/forms/login/freemarker/FreeMarkerLoginFormsProvider.java b/services/src/main/java/org/keycloak/forms/login/freemarker/FreeMarkerLoginFormsProvider.java index 631ff5792e..0f48ae4436 100755 --- a/services/src/main/java/org/keycloak/forms/login/freemarker/FreeMarkerLoginFormsProvider.java +++ b/services/src/main/java/org/keycloak/forms/login/freemarker/FreeMarkerLoginFormsProvider.java @@ -25,22 +25,10 @@ import org.keycloak.broker.provider.BrokeredIdentityContext; import org.keycloak.common.util.ObjectUtil; import org.keycloak.email.EmailException; import org.keycloak.email.EmailTemplateProvider; -import org.keycloak.forms.login.freemarker.model.CodeBean; -import org.keycloak.forms.login.freemarker.model.UrlBean; -import org.keycloak.theme.BrowserSecurityHeaderSetup; -import org.keycloak.theme.FreeMarkerException; -import org.keycloak.theme.FreeMarkerUtil; -import org.keycloak.theme.Theme; -import org.keycloak.theme.ThemeProvider; -import org.keycloak.theme.beans.AdvancedMessageFormatterMethod; -import org.keycloak.theme.beans.LocaleBean; -import org.keycloak.theme.beans.MessageBean; -import org.keycloak.theme.beans.MessageFormatterMethod; -import org.keycloak.theme.beans.MessageType; -import org.keycloak.theme.beans.MessagesPerFieldBean; import org.keycloak.forms.login.LoginFormsPages; import org.keycloak.forms.login.LoginFormsProvider; import org.keycloak.forms.login.freemarker.model.ClientBean; +import org.keycloak.forms.login.freemarker.model.CodeBean; import org.keycloak.forms.login.freemarker.model.IdentityProviderBean; import org.keycloak.forms.login.freemarker.model.LoginBean; import org.keycloak.forms.login.freemarker.model.OAuthGrantBean; @@ -49,6 +37,7 @@ import org.keycloak.forms.login.freemarker.model.RealmBean; import org.keycloak.forms.login.freemarker.model.RegisterBean; import org.keycloak.forms.login.freemarker.model.RequiredActionUrlFormatterMethod; import org.keycloak.forms.login.freemarker.model.TotpBean; +import org.keycloak.forms.login.freemarker.model.UrlBean; import org.keycloak.models.ClientModel; import org.keycloak.models.ClientSessionModel; import org.keycloak.models.Constants; @@ -61,6 +50,17 @@ import org.keycloak.models.UserModel; import org.keycloak.models.utils.FormMessage; import org.keycloak.services.Urls; import org.keycloak.services.messages.Messages; +import org.keycloak.theme.BrowserSecurityHeaderSetup; +import org.keycloak.theme.FreeMarkerException; +import org.keycloak.theme.FreeMarkerUtil; +import org.keycloak.theme.Theme; +import org.keycloak.theme.ThemeProvider; +import org.keycloak.theme.beans.AdvancedMessageFormatterMethod; +import org.keycloak.theme.beans.LocaleBean; +import org.keycloak.theme.beans.MessageBean; +import org.keycloak.theme.beans.MessageFormatterMethod; +import org.keycloak.theme.beans.MessageType; +import org.keycloak.theme.beans.MessagesPerFieldBean; import org.keycloak.utils.MediaType; import javax.ws.rs.core.MultivaluedMap; diff --git a/services/src/main/java/org/keycloak/forms/login/freemarker/FreeMarkerLoginFormsProviderFactory.java b/services/src/main/java/org/keycloak/forms/login/freemarker/FreeMarkerLoginFormsProviderFactory.java index 53a808d7a5..c801b05dc8 100755 --- a/services/src/main/java/org/keycloak/forms/login/freemarker/FreeMarkerLoginFormsProviderFactory.java +++ b/services/src/main/java/org/keycloak/forms/login/freemarker/FreeMarkerLoginFormsProviderFactory.java @@ -18,11 +18,11 @@ package org.keycloak.forms.login.freemarker; import org.keycloak.Config; -import org.keycloak.theme.FreeMarkerUtil; import org.keycloak.forms.login.LoginFormsProvider; import org.keycloak.forms.login.LoginFormsProviderFactory; import org.keycloak.models.KeycloakSession; import org.keycloak.models.KeycloakSessionFactory; +import org.keycloak.theme.FreeMarkerUtil; /** * @author Stian Thorgersen diff --git a/services/src/main/java/org/keycloak/forms/login/freemarker/LoginFormsUtil.java b/services/src/main/java/org/keycloak/forms/login/freemarker/LoginFormsUtil.java index f6c18086e6..1de8beab9c 100755 --- a/services/src/main/java/org/keycloak/forms/login/freemarker/LoginFormsUtil.java +++ b/services/src/main/java/org/keycloak/forms/login/freemarker/LoginFormsUtil.java @@ -17,14 +17,6 @@ package org.keycloak.forms.login.freemarker; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.ws.rs.core.MultivaluedMap; - import org.keycloak.forms.login.LoginFormsProvider; import org.keycloak.models.FederatedIdentityModel; import org.keycloak.models.IdentityProviderModel; @@ -32,6 +24,13 @@ import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; import org.keycloak.models.UserModel; +import javax.ws.rs.core.MultivaluedMap; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; + /** * Various util methods, so the logic is not hardcoded in freemarker beans * diff --git a/services/src/main/java/org/keycloak/forms/login/freemarker/model/ProfileBean.java b/services/src/main/java/org/keycloak/forms/login/freemarker/model/ProfileBean.java index 926af00124..577d8a1f9c 100755 --- a/services/src/main/java/org/keycloak/forms/login/freemarker/model/ProfileBean.java +++ b/services/src/main/java/org/keycloak/forms/login/freemarker/model/ProfileBean.java @@ -16,15 +16,14 @@ */ package org.keycloak.forms.login.freemarker.model; +import org.jboss.logging.Logger; +import org.keycloak.authentication.requiredactions.util.UpdateProfileContext; + +import javax.ws.rs.core.MultivaluedMap; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.ws.rs.core.MultivaluedMap; - -import org.jboss.logging.Logger; -import org.keycloak.authentication.requiredactions.util.UpdateProfileContext; - /** * @author Stian Thorgersen * @author Vlastimil Elias (velias at redhat dot com) diff --git a/services/src/main/java/org/keycloak/forms/login/freemarker/model/TotpBean.java b/services/src/main/java/org/keycloak/forms/login/freemarker/model/TotpBean.java index c302533d18..662601816d 100755 --- a/services/src/main/java/org/keycloak/forms/login/freemarker/model/TotpBean.java +++ b/services/src/main/java/org/keycloak/forms/login/freemarker/model/TotpBean.java @@ -20,14 +20,9 @@ import org.keycloak.credential.CredentialModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; import org.keycloak.models.UserModel; -import org.keycloak.models.utils.Base32; import org.keycloak.models.utils.HmacOTP; import org.keycloak.utils.TotpUtils; -import java.io.UnsupportedEncodingException; -import java.net.URI; -import java.net.URLEncoder; - /** * @author Stian Thorgersen */ diff --git a/services/src/main/java/org/keycloak/forms/login/freemarker/model/UrlBean.java b/services/src/main/java/org/keycloak/forms/login/freemarker/model/UrlBean.java index 581325a0d5..a622c222e0 100755 --- a/services/src/main/java/org/keycloak/forms/login/freemarker/model/UrlBean.java +++ b/services/src/main/java/org/keycloak/forms/login/freemarker/model/UrlBean.java @@ -16,9 +16,9 @@ */ package org.keycloak.forms.login.freemarker.model; -import org.keycloak.theme.Theme; import org.keycloak.models.RealmModel; import org.keycloak.services.Urls; +import org.keycloak.theme.Theme; import java.net.URI; diff --git a/services/src/main/java/org/keycloak/partialimport/AbstractPartialImport.java b/services/src/main/java/org/keycloak/partialimport/AbstractPartialImport.java index 37097fce4b..cd81c560a5 100644 --- a/services/src/main/java/org/keycloak/partialimport/AbstractPartialImport.java +++ b/services/src/main/java/org/keycloak/partialimport/AbstractPartialImport.java @@ -17,16 +17,17 @@ package org.keycloak.partialimport; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import javax.ws.rs.core.Response; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; import org.keycloak.representations.idm.PartialImportRepresentation; import org.keycloak.services.ErrorResponse; import org.keycloak.services.ServicesLogger; +import javax.ws.rs.core.Response; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + /** * Base PartialImport for most resource types. * diff --git a/services/src/main/java/org/keycloak/partialimport/ClientRolesPartialImport.java b/services/src/main/java/org/keycloak/partialimport/ClientRolesPartialImport.java index 5f571644b7..008917da7c 100644 --- a/services/src/main/java/org/keycloak/partialimport/ClientRolesPartialImport.java +++ b/services/src/main/java/org/keycloak/partialimport/ClientRolesPartialImport.java @@ -16,12 +16,6 @@ */ package org.keycloak.partialimport; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import javax.ws.rs.core.Response; import org.keycloak.models.ClientModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; @@ -31,6 +25,13 @@ import org.keycloak.representations.idm.PartialImportRepresentation; import org.keycloak.representations.idm.RoleRepresentation; import org.keycloak.services.ErrorResponse; +import javax.ws.rs.core.Response; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + /** * Partial Import handler for Client Roles. * diff --git a/services/src/main/java/org/keycloak/partialimport/ClientsPartialImport.java b/services/src/main/java/org/keycloak/partialimport/ClientsPartialImport.java index ab414c5fdf..b7e46dfbc1 100755 --- a/services/src/main/java/org/keycloak/partialimport/ClientsPartialImport.java +++ b/services/src/main/java/org/keycloak/partialimport/ClientsPartialImport.java @@ -17,7 +17,6 @@ package org.keycloak.partialimport; -import java.util.List; import org.keycloak.models.ClientModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; @@ -27,6 +26,8 @@ import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.representations.idm.PartialImportRepresentation; import org.keycloak.representations.idm.ProtocolMapperRepresentation; +import java.util.List; + /** * PartialImport handler for Clients. * diff --git a/services/src/main/java/org/keycloak/partialimport/GroupsPartialImport.java b/services/src/main/java/org/keycloak/partialimport/GroupsPartialImport.java index e9632d6d16..cdb57ad7bc 100644 --- a/services/src/main/java/org/keycloak/partialimport/GroupsPartialImport.java +++ b/services/src/main/java/org/keycloak/partialimport/GroupsPartialImport.java @@ -17,7 +17,6 @@ package org.keycloak.partialimport; -import java.util.List; import org.keycloak.models.GroupModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; @@ -26,6 +25,8 @@ import org.keycloak.models.utils.RepresentationToModel; import org.keycloak.representations.idm.GroupRepresentation; import org.keycloak.representations.idm.PartialImportRepresentation; +import java.util.List; + /** * Partial import handler for Groups. * diff --git a/services/src/main/java/org/keycloak/partialimport/IdentityProvidersPartialImport.java b/services/src/main/java/org/keycloak/partialimport/IdentityProvidersPartialImport.java index 505c61d0ff..cdcb89c031 100644 --- a/services/src/main/java/org/keycloak/partialimport/IdentityProvidersPartialImport.java +++ b/services/src/main/java/org/keycloak/partialimport/IdentityProvidersPartialImport.java @@ -17,7 +17,6 @@ package org.keycloak.partialimport; -import java.util.List; import org.keycloak.models.IdentityProviderModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; @@ -26,6 +25,8 @@ import org.keycloak.models.utils.RepresentationToModel; import org.keycloak.representations.idm.IdentityProviderRepresentation; import org.keycloak.representations.idm.PartialImportRepresentation; +import java.util.List; + /** * PartialImport handler for Identitiy Providers. * diff --git a/services/src/main/java/org/keycloak/partialimport/PartialImportManager.java b/services/src/main/java/org/keycloak/partialimport/PartialImportManager.java index 705d23048f..5ec3eec43e 100644 --- a/services/src/main/java/org/keycloak/partialimport/PartialImportManager.java +++ b/services/src/main/java/org/keycloak/partialimport/PartialImportManager.java @@ -17,15 +17,16 @@ package org.keycloak.partialimport; -import java.util.ArrayList; -import java.util.List; -import javax.ws.rs.core.Response; import org.keycloak.events.admin.OperationType; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; import org.keycloak.representations.idm.PartialImportRepresentation; import org.keycloak.services.resources.admin.AdminEventBuilder; +import javax.ws.rs.core.Response; +import java.util.ArrayList; +import java.util.List; + /** * This class manages the PartialImport handlers. * diff --git a/services/src/main/java/org/keycloak/partialimport/RealmRolesPartialImport.java b/services/src/main/java/org/keycloak/partialimport/RealmRolesPartialImport.java index 4a84b706a1..9c53709052 100644 --- a/services/src/main/java/org/keycloak/partialimport/RealmRolesPartialImport.java +++ b/services/src/main/java/org/keycloak/partialimport/RealmRolesPartialImport.java @@ -16,8 +16,6 @@ */ package org.keycloak.partialimport; -import java.util.List; -import java.util.Set; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; import org.keycloak.models.RoleModel; @@ -25,6 +23,9 @@ import org.keycloak.representations.idm.PartialImportRepresentation; import org.keycloak.representations.idm.RoleRepresentation; import org.keycloak.services.resources.admin.RoleResource; +import java.util.List; +import java.util.Set; + /** * PartialImport handler for Realm Roles. * diff --git a/services/src/main/java/org/keycloak/partialimport/RolesPartialImport.java b/services/src/main/java/org/keycloak/partialimport/RolesPartialImport.java index 7bd16b21b0..6fca177a05 100644 --- a/services/src/main/java/org/keycloak/partialimport/RolesPartialImport.java +++ b/services/src/main/java/org/keycloak/partialimport/RolesPartialImport.java @@ -16,10 +16,6 @@ */ package org.keycloak.partialimport; -import java.util.List; -import java.util.Map; -import java.util.Set; -import javax.ws.rs.core.Response; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; import org.keycloak.models.utils.KeycloakModelUtils; @@ -30,6 +26,11 @@ import org.keycloak.representations.idm.RolesRepresentation; import org.keycloak.services.ErrorResponse; import org.keycloak.services.ServicesLogger; +import javax.ws.rs.core.Response; +import java.util.List; +import java.util.Map; +import java.util.Set; + /** * This class handles both realm roles and client roles. It delegates to * RealmRolesPartialImport and ClientRolesPartialImport, which are no longer used diff --git a/services/src/main/java/org/keycloak/partialimport/UsersPartialImport.java b/services/src/main/java/org/keycloak/partialimport/UsersPartialImport.java index 2dc413626b..0128e4e668 100755 --- a/services/src/main/java/org/keycloak/partialimport/UsersPartialImport.java +++ b/services/src/main/java/org/keycloak/partialimport/UsersPartialImport.java @@ -17,10 +17,6 @@ package org.keycloak.partialimport; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.keycloak.models.ClientModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; import org.keycloak.models.UserModel; @@ -30,6 +26,10 @@ import org.keycloak.representations.idm.PartialImportRepresentation; import org.keycloak.representations.idm.UserRepresentation; import org.keycloak.services.managers.UserManager; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + /** * PartialImport handler for users. * diff --git a/services/src/main/java/org/keycloak/protocol/AuthorizationEndpointBase.java b/services/src/main/java/org/keycloak/protocol/AuthorizationEndpointBase.java index 12dba27e2c..8eed142185 100755 --- a/services/src/main/java/org/keycloak/protocol/AuthorizationEndpointBase.java +++ b/services/src/main/java/org/keycloak/protocol/AuthorizationEndpointBase.java @@ -17,11 +17,6 @@ package org.keycloak.protocol; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriInfo; - import org.jboss.resteasy.spi.HttpRequest; import org.keycloak.authentication.AuthenticationProcessor; import org.keycloak.common.ClientConnection; @@ -36,6 +31,11 @@ import org.keycloak.services.ServicesLogger; import org.keycloak.services.managers.AuthenticationManager; import org.keycloak.services.resources.LoginActionsService; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.HttpHeaders; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.UriInfo; + /** * Common base class for Authorization REST endpoints implementation, which have to be implemented by each protocol. * diff --git a/services/src/main/java/org/keycloak/protocol/ProtocolMapperUtils.java b/services/src/main/java/org/keycloak/protocol/ProtocolMapperUtils.java index da73139e9f..5c12615412 100755 --- a/services/src/main/java/org/keycloak/protocol/ProtocolMapperUtils.java +++ b/services/src/main/java/org/keycloak/protocol/ProtocolMapperUtils.java @@ -22,7 +22,6 @@ import org.keycloak.models.ProtocolMapperModel; import org.keycloak.models.UserModel; import org.keycloak.protocol.oidc.OIDCLoginProtocol; import org.keycloak.protocol.oidc.OIDCLoginProtocolFactory; -import org.keycloak.provider.ProviderConfigProperty; import org.keycloak.provider.ProviderFactory; import java.lang.reflect.Method; diff --git a/services/src/main/java/org/keycloak/protocol/oidc/OIDCClientDescriptionConverter.java b/services/src/main/java/org/keycloak/protocol/oidc/OIDCClientDescriptionConverter.java index 392b3ce955..6eb0c61f3b 100644 --- a/services/src/main/java/org/keycloak/protocol/oidc/OIDCClientDescriptionConverter.java +++ b/services/src/main/java/org/keycloak/protocol/oidc/OIDCClientDescriptionConverter.java @@ -19,8 +19,8 @@ package org.keycloak.protocol.oidc; import org.keycloak.exportimport.ClientDescriptionConverter; import org.keycloak.models.KeycloakSession; -import org.keycloak.representations.oidc.OIDCClientRepresentation; import org.keycloak.representations.idm.ClientRepresentation; +import org.keycloak.representations.oidc.OIDCClientRepresentation; import org.keycloak.services.clientregistration.oidc.DescriptionConverter; import org.keycloak.util.JsonSerialization; diff --git a/services/src/main/java/org/keycloak/protocol/oidc/OIDCLoginProtocolFactory.java b/services/src/main/java/org/keycloak/protocol/oidc/OIDCLoginProtocolFactory.java index 3b90ecae09..5e7d4a7865 100755 --- a/services/src/main/java/org/keycloak/protocol/oidc/OIDCLoginProtocolFactory.java +++ b/services/src/main/java/org/keycloak/protocol/oidc/OIDCLoginProtocolFactory.java @@ -19,15 +19,29 @@ package org.keycloak.protocol.oidc; import org.keycloak.common.constants.KerberosConstants; import org.keycloak.common.util.UriUtils; import org.keycloak.events.EventBuilder; -import org.keycloak.models.*; +import org.keycloak.models.ClientModel; +import org.keycloak.models.ClientTemplateModel; +import org.keycloak.models.KeycloakSession; +import org.keycloak.models.ProtocolMapperModel; +import org.keycloak.models.RealmModel; import org.keycloak.protocol.AbstractLoginProtocolFactory; import org.keycloak.protocol.LoginProtocol; -import org.keycloak.protocol.oidc.mappers.*; +import org.keycloak.protocol.oidc.mappers.AddressMapper; +import org.keycloak.protocol.oidc.mappers.FullNameMapper; +import org.keycloak.protocol.oidc.mappers.OIDCAttributeMapperHelper; +import org.keycloak.protocol.oidc.mappers.UserAttributeMapper; +import org.keycloak.protocol.oidc.mappers.UserPropertyMapper; +import org.keycloak.protocol.oidc.mappers.UserSessionNoteMapper; import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.representations.idm.ClientTemplateRepresentation; import org.keycloak.services.ServicesLogger; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; /** * @author Bill Burke diff --git a/services/src/main/java/org/keycloak/protocol/oidc/OIDCLoginProtocolService.java b/services/src/main/java/org/keycloak/protocol/oidc/OIDCLoginProtocolService.java index 7afec32c41..9e214df5c4 100644 --- a/services/src/main/java/org/keycloak/protocol/oidc/OIDCLoginProtocolService.java +++ b/services/src/main/java/org/keycloak/protocol/oidc/OIDCLoginProtocolService.java @@ -20,9 +20,10 @@ package org.keycloak.protocol.oidc; import org.jboss.resteasy.annotations.cache.NoCache; import org.jboss.resteasy.spi.ResteasyProviderFactory; import org.keycloak.events.EventBuilder; +import org.keycloak.forms.login.LoginFormsProvider; +import org.keycloak.jose.jwk.JSONWebKeySet; import org.keycloak.jose.jwk.JWK; import org.keycloak.jose.jwk.JWKBuilder; -import org.keycloak.forms.login.LoginFormsProvider; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; import org.keycloak.protocol.oidc.endpoints.AuthorizationEndpoint; @@ -30,7 +31,6 @@ import org.keycloak.protocol.oidc.endpoints.LoginStatusIframeEndpoint; import org.keycloak.protocol.oidc.endpoints.LogoutEndpoint; import org.keycloak.protocol.oidc.endpoints.TokenEndpoint; import org.keycloak.protocol.oidc.endpoints.UserInfoEndpoint; -import org.keycloak.jose.jwk.JSONWebKeySet; import org.keycloak.services.ServicesLogger; import org.keycloak.services.resources.RealmsResource; diff --git a/services/src/main/java/org/keycloak/protocol/oidc/OIDCWellKnownProvider.java b/services/src/main/java/org/keycloak/protocol/oidc/OIDCWellKnownProvider.java index 2653b9b247..c2f4296769 100755 --- a/services/src/main/java/org/keycloak/protocol/oidc/OIDCWellKnownProvider.java +++ b/services/src/main/java/org/keycloak/protocol/oidc/OIDCWellKnownProvider.java @@ -28,15 +28,14 @@ import org.keycloak.protocol.oidc.representations.OIDCConfigurationRepresentatio import org.keycloak.protocol.oidc.utils.OIDCResponseType; import org.keycloak.provider.ProviderFactory; import org.keycloak.representations.IDToken; +import org.keycloak.services.Urls; import org.keycloak.services.clientregistration.ClientRegistrationService; import org.keycloak.services.clientregistration.oidc.OIDCClientRegistrationProviderFactory; import org.keycloak.services.resources.RealmsResource; -import org.keycloak.services.Urls; import org.keycloak.wellknown.WellKnownProvider; import javax.ws.rs.core.UriBuilder; import javax.ws.rs.core.UriInfo; - import java.util.ArrayList; import java.util.LinkedList; import java.util.List; diff --git a/services/src/main/java/org/keycloak/protocol/oidc/TokenManager.java b/services/src/main/java/org/keycloak/protocol/oidc/TokenManager.java index ac1d8e1f32..39c6d10313 100755 --- a/services/src/main/java/org/keycloak/protocol/oidc/TokenManager.java +++ b/services/src/main/java/org/keycloak/protocol/oidc/TokenManager.java @@ -17,10 +17,11 @@ package org.keycloak.protocol.oidc; -import org.keycloak.cluster.ClusterProvider; -import org.keycloak.common.ClientConnection; import org.keycloak.OAuth2Constants; import org.keycloak.OAuthErrorException; +import org.keycloak.cluster.ClusterProvider; +import org.keycloak.common.ClientConnection; +import org.keycloak.common.util.Time; import org.keycloak.events.Details; import org.keycloak.events.Errors; import org.keycloak.events.EventBuilder; @@ -59,7 +60,6 @@ import org.keycloak.services.managers.AuthenticationManager; import org.keycloak.services.managers.ClientSessionCode; import org.keycloak.services.managers.UserSessionManager; import org.keycloak.util.TokenUtil; -import org.keycloak.common.util.Time; import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.Response; diff --git a/services/src/main/java/org/keycloak/protocol/oidc/endpoints/AuthorizationEndpoint.java b/services/src/main/java/org/keycloak/protocol/oidc/endpoints/AuthorizationEndpoint.java index 3f18b27c3a..4ef0c5cc56 100755 --- a/services/src/main/java/org/keycloak/protocol/oidc/endpoints/AuthorizationEndpoint.java +++ b/services/src/main/java/org/keycloak/protocol/oidc/endpoints/AuthorizationEndpoint.java @@ -17,10 +17,6 @@ package org.keycloak.protocol.oidc.endpoints; -import javax.ws.rs.GET; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Response; - import org.keycloak.OAuth2Constants; import org.keycloak.OAuthErrorException; import org.keycloak.authentication.AuthenticationProcessor; @@ -49,6 +45,10 @@ import org.keycloak.services.resources.LoginActionsService; import org.keycloak.services.util.CacheControlUtil; import org.keycloak.util.TokenUtil; +import javax.ws.rs.GET; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.Response; + /** * @author Stian Thorgersen */ diff --git a/services/src/main/java/org/keycloak/protocol/oidc/endpoints/LoginStatusIframeEndpoint.java b/services/src/main/java/org/keycloak/protocol/oidc/endpoints/LoginStatusIframeEndpoint.java index 757f0d769c..b41f52d721 100755 --- a/services/src/main/java/org/keycloak/protocol/oidc/endpoints/LoginStatusIframeEndpoint.java +++ b/services/src/main/java/org/keycloak/protocol/oidc/endpoints/LoginStatusIframeEndpoint.java @@ -19,12 +19,12 @@ package org.keycloak.protocol.oidc.endpoints; import org.jboss.resteasy.spi.NotFoundException; import org.keycloak.Config; +import org.keycloak.common.util.StreamUtil; +import org.keycloak.common.util.UriUtils; import org.keycloak.models.ClientModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; import org.keycloak.protocol.oidc.utils.RedirectUtils; -import org.keycloak.common.util.StreamUtil; -import org.keycloak.common.util.UriUtils; import org.keycloak.services.util.P3PHelper; import javax.ws.rs.GET; diff --git a/services/src/main/java/org/keycloak/protocol/oidc/endpoints/LogoutEndpoint.java b/services/src/main/java/org/keycloak/protocol/oidc/endpoints/LogoutEndpoint.java index 85fea77501..1a47301802 100755 --- a/services/src/main/java/org/keycloak/protocol/oidc/endpoints/LogoutEndpoint.java +++ b/services/src/main/java/org/keycloak/protocol/oidc/endpoints/LogoutEndpoint.java @@ -19,9 +19,9 @@ package org.keycloak.protocol.oidc.endpoints; import org.jboss.resteasy.annotations.cache.NoCache; import org.jboss.resteasy.spi.HttpRequest; -import org.keycloak.common.ClientConnection; import org.keycloak.OAuth2Constants; import org.keycloak.OAuthErrorException; +import org.keycloak.common.ClientConnection; import org.keycloak.events.Details; import org.keycloak.events.Errors; import org.keycloak.events.EventBuilder; @@ -36,12 +36,12 @@ import org.keycloak.protocol.oidc.utils.AuthorizeClientUtil; import org.keycloak.protocol.oidc.utils.RedirectUtils; import org.keycloak.representations.IDToken; import org.keycloak.representations.RefreshToken; +import org.keycloak.services.ErrorPage; import org.keycloak.services.ErrorResponseException; import org.keycloak.services.ServicesLogger; import org.keycloak.services.managers.AuthenticationManager; import org.keycloak.services.messages.Messages; import org.keycloak.services.resources.Cors; -import org.keycloak.services.ErrorPage; import javax.ws.rs.Consumes; import javax.ws.rs.GET; diff --git a/services/src/main/java/org/keycloak/protocol/oidc/endpoints/TokenEndpoint.java b/services/src/main/java/org/keycloak/protocol/oidc/endpoints/TokenEndpoint.java index a79e67980e..6d9df6c7a8 100644 --- a/services/src/main/java/org/keycloak/protocol/oidc/endpoints/TokenEndpoint.java +++ b/services/src/main/java/org/keycloak/protocol/oidc/endpoints/TokenEndpoint.java @@ -19,12 +19,12 @@ package org.keycloak.protocol.oidc.endpoints; import org.jboss.resteasy.spi.HttpRequest; import org.jboss.resteasy.spi.ResteasyProviderFactory; -import org.keycloak.common.ClientConnection; import org.keycloak.OAuth2Constants; import org.keycloak.OAuthErrorException; import org.keycloak.authentication.AuthenticationProcessor; -import org.keycloak.constants.AdapterConstants; +import org.keycloak.common.ClientConnection; import org.keycloak.common.constants.ServiceAccountConstants; +import org.keycloak.constants.AdapterConstants; import org.keycloak.events.Details; import org.keycloak.events.Errors; import org.keycloak.events.EventBuilder; @@ -44,12 +44,12 @@ import org.keycloak.representations.AccessToken; import org.keycloak.representations.AccessTokenResponse; import org.keycloak.services.ErrorResponseException; import org.keycloak.services.ServicesLogger; +import org.keycloak.services.Urls; import org.keycloak.services.managers.AuthenticationManager; import org.keycloak.services.managers.ClientManager; import org.keycloak.services.managers.ClientSessionCode; import org.keycloak.services.managers.RealmManager; import org.keycloak.services.resources.Cors; -import org.keycloak.services.Urls; import javax.ws.rs.OPTIONS; import javax.ws.rs.POST; diff --git a/services/src/main/java/org/keycloak/protocol/oidc/endpoints/UserInfoEndpoint.java b/services/src/main/java/org/keycloak/protocol/oidc/endpoints/UserInfoEndpoint.java index 28d951438a..739fd96e90 100755 --- a/services/src/main/java/org/keycloak/protocol/oidc/endpoints/UserInfoEndpoint.java +++ b/services/src/main/java/org/keycloak/protocol/oidc/endpoints/UserInfoEndpoint.java @@ -29,7 +29,12 @@ import org.keycloak.events.EventBuilder; import org.keycloak.events.EventType; import org.keycloak.jose.jws.Algorithm; import org.keycloak.jose.jws.JWSBuilder; -import org.keycloak.models.*; +import org.keycloak.models.ClientModel; +import org.keycloak.models.ClientSessionModel; +import org.keycloak.models.KeycloakSession; +import org.keycloak.models.RealmModel; +import org.keycloak.models.UserModel; +import org.keycloak.models.UserSessionModel; import org.keycloak.protocol.oidc.OIDCAdvancedConfigWrapper; import org.keycloak.protocol.oidc.TokenManager; import org.keycloak.representations.AccessToken; diff --git a/services/src/main/java/org/keycloak/protocol/oidc/endpoints/request/AuthorizationEndpointRequestParserProcessor.java b/services/src/main/java/org/keycloak/protocol/oidc/endpoints/request/AuthorizationEndpointRequestParserProcessor.java index 8db219c08f..faab68db0e 100644 --- a/services/src/main/java/org/keycloak/protocol/oidc/endpoints/request/AuthorizationEndpointRequestParserProcessor.java +++ b/services/src/main/java/org/keycloak/protocol/oidc/endpoints/request/AuthorizationEndpointRequestParserProcessor.java @@ -17,11 +17,6 @@ package org.keycloak.protocol.oidc.endpoints.request; -import java.io.InputStream; -import java.util.Map; - -import javax.ws.rs.core.MultivaluedMap; - import org.keycloak.common.util.StreamUtil; import org.keycloak.connections.httpclient.HttpClientProvider; import org.keycloak.events.Errors; @@ -33,6 +28,9 @@ import org.keycloak.services.ErrorPageException; import org.keycloak.services.ServicesLogger; import org.keycloak.services.messages.Messages; +import javax.ws.rs.core.MultivaluedMap; +import java.io.InputStream; + /** * @author Marek Posolda */ diff --git a/services/src/main/java/org/keycloak/protocol/oidc/endpoints/request/AuthzEndpointQueryStringParser.java b/services/src/main/java/org/keycloak/protocol/oidc/endpoints/request/AuthzEndpointQueryStringParser.java index 8384fdcdcb..148576e9a9 100644 --- a/services/src/main/java/org/keycloak/protocol/oidc/endpoints/request/AuthzEndpointQueryStringParser.java +++ b/services/src/main/java/org/keycloak/protocol/oidc/endpoints/request/AuthzEndpointQueryStringParser.java @@ -17,9 +17,8 @@ package org.keycloak.protocol.oidc.endpoints.request; -import java.util.Set; - import javax.ws.rs.core.MultivaluedMap; +import java.util.Set; /** * Parse the parameters from request queryString diff --git a/services/src/main/java/org/keycloak/protocol/oidc/endpoints/request/AuthzEndpointRequestObjectParser.java b/services/src/main/java/org/keycloak/protocol/oidc/endpoints/request/AuthzEndpointRequestObjectParser.java index 658a2c002e..616e1dbd1d 100644 --- a/services/src/main/java/org/keycloak/protocol/oidc/endpoints/request/AuthzEndpointRequestObjectParser.java +++ b/services/src/main/java/org/keycloak/protocol/oidc/endpoints/request/AuthzEndpointRequestObjectParser.java @@ -17,11 +17,6 @@ package org.keycloak.protocol.oidc.endpoints.request; -import java.security.PublicKey; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - import org.keycloak.authentication.authenticators.client.JWTClientAuthenticator; import org.keycloak.jose.jws.Algorithm; import org.keycloak.jose.jws.JWSHeader; @@ -32,6 +27,11 @@ import org.keycloak.protocol.oidc.OIDCAdvancedConfigWrapper; import org.keycloak.services.util.CertificateInfoHelper; import org.keycloak.util.JsonSerialization; +import java.security.PublicKey; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + /** * Parse the parameters from OIDC "request" object * diff --git a/services/src/main/java/org/keycloak/protocol/oidc/endpoints/request/AuthzEndpointRequestParser.java b/services/src/main/java/org/keycloak/protocol/oidc/endpoints/request/AuthzEndpointRequestParser.java index e322d4b75e..82d2c955ca 100644 --- a/services/src/main/java/org/keycloak/protocol/oidc/endpoints/request/AuthzEndpointRequestParser.java +++ b/services/src/main/java/org/keycloak/protocol/oidc/endpoints/request/AuthzEndpointRequestParser.java @@ -17,14 +17,14 @@ package org.keycloak.protocol.oidc.endpoints.request; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - import org.keycloak.constants.AdapterConstants; import org.keycloak.protocol.oidc.OIDCLoginProtocol; import org.keycloak.services.ServicesLogger; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + /** * @author Marek Posolda */ diff --git a/services/src/main/java/org/keycloak/protocol/oidc/mappers/AbstractPairwiseSubMapper.java b/services/src/main/java/org/keycloak/protocol/oidc/mappers/AbstractPairwiseSubMapper.java index e372c73f35..b2bbdcc1d8 100644 --- a/services/src/main/java/org/keycloak/protocol/oidc/mappers/AbstractPairwiseSubMapper.java +++ b/services/src/main/java/org/keycloak/protocol/oidc/mappers/AbstractPairwiseSubMapper.java @@ -1,10 +1,15 @@ package org.keycloak.protocol.oidc.mappers; -import org.keycloak.models.*; +import org.keycloak.models.ClientModel; +import org.keycloak.models.ClientSessionModel; +import org.keycloak.models.KeycloakSession; +import org.keycloak.models.ProtocolMapperContainerModel; +import org.keycloak.models.ProtocolMapperModel; +import org.keycloak.models.RealmModel; +import org.keycloak.models.UserSessionModel; import org.keycloak.protocol.ProtocolMapperConfigException; -import org.keycloak.protocol.oidc.OIDCAdvancedConfigWrapper; -import org.keycloak.protocol.oidc.utils.PairwiseSubMapperValidator; import org.keycloak.protocol.oidc.utils.PairwiseSubMapperUtils; +import org.keycloak.protocol.oidc.utils.PairwiseSubMapperValidator; import org.keycloak.provider.ProviderConfigProperty; import org.keycloak.representations.AccessToken; import org.keycloak.representations.IDToken; diff --git a/services/src/main/java/org/keycloak/protocol/oidc/mappers/OIDCAttributeMapperHelper.java b/services/src/main/java/org/keycloak/protocol/oidc/mappers/OIDCAttributeMapperHelper.java index f452261e26..0c05aa190d 100755 --- a/services/src/main/java/org/keycloak/protocol/oidc/mappers/OIDCAttributeMapperHelper.java +++ b/services/src/main/java/org/keycloak/protocol/oidc/mappers/OIDCAttributeMapperHelper.java @@ -18,7 +18,6 @@ package org.keycloak.protocol.oidc.mappers; import org.keycloak.models.ProtocolMapperModel; -import org.keycloak.protocol.ProtocolMapper; import org.keycloak.protocol.ProtocolMapperUtils; import org.keycloak.protocol.oidc.OIDCLoginProtocol; import org.keycloak.provider.ProviderConfigProperty; diff --git a/services/src/main/java/org/keycloak/protocol/oidc/mappers/SHA256PairwiseSubMapper.java b/services/src/main/java/org/keycloak/protocol/oidc/mappers/SHA256PairwiseSubMapper.java index 613505165c..83b56a648b 100644 --- a/services/src/main/java/org/keycloak/protocol/oidc/mappers/SHA256PairwiseSubMapper.java +++ b/services/src/main/java/org/keycloak/protocol/oidc/mappers/SHA256PairwiseSubMapper.java @@ -14,7 +14,11 @@ import org.keycloak.services.ServicesLogger; import java.nio.charset.Charset; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; -import java.util.*; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.UUID; public class SHA256PairwiseSubMapper extends AbstractPairwiseSubMapper { public static final String PROVIDER_ID = "sha256"; diff --git a/services/src/main/java/org/keycloak/protocol/oidc/mappers/UserAttributeMapper.java b/services/src/main/java/org/keycloak/protocol/oidc/mappers/UserAttributeMapper.java index f7475a95cf..56e7a48d2e 100755 --- a/services/src/main/java/org/keycloak/protocol/oidc/mappers/UserAttributeMapper.java +++ b/services/src/main/java/org/keycloak/protocol/oidc/mappers/UserAttributeMapper.java @@ -19,12 +19,10 @@ package org.keycloak.protocol.oidc.mappers; import org.keycloak.models.ClientSessionModel; import org.keycloak.models.KeycloakSession; -import org.keycloak.models.ProtocolMapperContainerModel; import org.keycloak.models.ProtocolMapperModel; import org.keycloak.models.UserModel; import org.keycloak.models.UserSessionModel; import org.keycloak.models.utils.KeycloakModelUtils; -import org.keycloak.protocol.ProtocolMapperConfigException; import org.keycloak.protocol.ProtocolMapperUtils; import org.keycloak.provider.ProviderConfigProperty; import org.keycloak.representations.AccessToken; diff --git a/services/src/main/java/org/keycloak/protocol/oidc/mappers/UserSessionNoteMapper.java b/services/src/main/java/org/keycloak/protocol/oidc/mappers/UserSessionNoteMapper.java index b114567648..0016103b61 100755 --- a/services/src/main/java/org/keycloak/protocol/oidc/mappers/UserSessionNoteMapper.java +++ b/services/src/main/java/org/keycloak/protocol/oidc/mappers/UserSessionNoteMapper.java @@ -17,11 +17,6 @@ package org.keycloak.protocol.oidc.mappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - import org.keycloak.models.ClientSessionModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.ProtocolMapperModel; @@ -32,6 +27,11 @@ import org.keycloak.provider.ProviderConfigProperty; import org.keycloak.representations.AccessToken; import org.keycloak.representations.IDToken; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + /** * Mappings UserSessionModel.note to an ID Token claim. * diff --git a/services/src/main/java/org/keycloak/protocol/oidc/utils/AuthorizeClientUtil.java b/services/src/main/java/org/keycloak/protocol/oidc/utils/AuthorizeClientUtil.java index a7ba7c31aa..6e4498ee50 100644 --- a/services/src/main/java/org/keycloak/protocol/oidc/utils/AuthorizeClientUtil.java +++ b/services/src/main/java/org/keycloak/protocol/oidc/utils/AuthorizeClientUtil.java @@ -17,9 +17,6 @@ package org.keycloak.protocol.oidc.utils; -import java.util.List; -import java.util.Map; - import org.jboss.resteasy.spi.HttpRequest; import org.keycloak.authentication.AuthenticationProcessor; import org.keycloak.authentication.ClientAuthenticator; @@ -35,6 +32,8 @@ import org.keycloak.services.ErrorResponseException; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.Response; +import java.util.List; +import java.util.Map; /** * @author Stian Thorgersen diff --git a/services/src/main/java/org/keycloak/protocol/oidc/utils/JWKSUtils.java b/services/src/main/java/org/keycloak/protocol/oidc/utils/JWKSUtils.java index 62d2c58039..dc6896ec3d 100644 --- a/services/src/main/java/org/keycloak/protocol/oidc/utils/JWKSUtils.java +++ b/services/src/main/java/org/keycloak/protocol/oidc/utils/JWKSUtils.java @@ -17,10 +17,6 @@ package org.keycloak.protocol.oidc.utils; -import java.io.IOException; -import java.io.InputStream; -import java.security.PublicKey; - import org.keycloak.common.util.StreamUtil; import org.keycloak.connections.httpclient.HttpClientProvider; import org.keycloak.jose.jwk.JSONWebKeySet; @@ -29,6 +25,10 @@ import org.keycloak.jose.jwk.JWKParser; import org.keycloak.models.KeycloakSession; import org.keycloak.util.JsonSerialization; +import java.io.IOException; +import java.io.InputStream; +import java.security.PublicKey; + /** * TODO: Merge with JWKSUtils from keycloak-core? * diff --git a/services/src/main/java/org/keycloak/protocol/oidc/utils/OIDCRedirectUriBuilder.java b/services/src/main/java/org/keycloak/protocol/oidc/utils/OIDCRedirectUriBuilder.java index cffad4f9d2..f2fdd0c322 100644 --- a/services/src/main/java/org/keycloak/protocol/oidc/utils/OIDCRedirectUriBuilder.java +++ b/services/src/main/java/org/keycloak/protocol/oidc/utils/OIDCRedirectUriBuilder.java @@ -17,15 +17,14 @@ package org.keycloak.protocol.oidc.utils; -import java.net.URI; -import java.util.HashMap; -import java.util.Map; +import org.keycloak.common.util.Encode; +import org.keycloak.common.util.KeycloakUriBuilder; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; - -import org.keycloak.common.util.Encode; -import org.keycloak.common.util.KeycloakUriBuilder; +import java.net.URI; +import java.util.HashMap; +import java.util.Map; /** * @author Marek Posolda diff --git a/services/src/main/java/org/keycloak/protocol/oidc/utils/OIDCResponseType.java b/services/src/main/java/org/keycloak/protocol/oidc/utils/OIDCResponseType.java index c836a68f5e..e423dc9443 100644 --- a/services/src/main/java/org/keycloak/protocol/oidc/utils/OIDCResponseType.java +++ b/services/src/main/java/org/keycloak/protocol/oidc/utils/OIDCResponseType.java @@ -17,12 +17,12 @@ package org.keycloak.protocol.oidc.utils; +import org.keycloak.protocol.oidc.OIDCLoginProtocol; + import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.keycloak.protocol.oidc.OIDCLoginProtocol; - /** * @author Marek Posolda */ diff --git a/services/src/main/java/org/keycloak/protocol/oidc/utils/PairwiseSubMapperUtils.java b/services/src/main/java/org/keycloak/protocol/oidc/utils/PairwiseSubMapperUtils.java index 313a06d632..518448886f 100644 --- a/services/src/main/java/org/keycloak/protocol/oidc/utils/PairwiseSubMapperUtils.java +++ b/services/src/main/java/org/keycloak/protocol/oidc/utils/PairwiseSubMapperUtils.java @@ -1,9 +1,6 @@ package org.keycloak.protocol.oidc.utils; -import org.keycloak.models.ClientModel; -import org.keycloak.models.ProtocolMapperModel; import org.keycloak.protocol.oidc.mappers.AbstractPairwiseSubMapper; -import org.keycloak.protocol.oidc.mappers.PairwiseSubMapperHelper; import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.representations.idm.ProtocolMapperRepresentation; import org.keycloak.services.ServicesLogger; diff --git a/services/src/main/java/org/keycloak/protocol/oidc/utils/RedirectUtils.java b/services/src/main/java/org/keycloak/protocol/oidc/utils/RedirectUtils.java index b7d9ad4246..125769e5d4 100644 --- a/services/src/main/java/org/keycloak/protocol/oidc/utils/RedirectUtils.java +++ b/services/src/main/java/org/keycloak/protocol/oidc/utils/RedirectUtils.java @@ -20,8 +20,8 @@ package org.keycloak.protocol.oidc.utils; import org.keycloak.models.ClientModel; import org.keycloak.models.Constants; import org.keycloak.models.RealmModel; -import org.keycloak.services.Urls; import org.keycloak.services.ServicesLogger; +import org.keycloak.services.Urls; import javax.ws.rs.core.UriInfo; import java.net.URI; diff --git a/services/src/main/java/org/keycloak/protocol/oidc/utils/WebOriginsUtils.java b/services/src/main/java/org/keycloak/protocol/oidc/utils/WebOriginsUtils.java index 7e9c126254..f606bfc602 100644 --- a/services/src/main/java/org/keycloak/protocol/oidc/utils/WebOriginsUtils.java +++ b/services/src/main/java/org/keycloak/protocol/oidc/utils/WebOriginsUtils.java @@ -17,8 +17,8 @@ package org.keycloak.protocol.oidc.utils; -import org.keycloak.models.ClientModel; import org.keycloak.common.util.UriUtils; +import org.keycloak.models.ClientModel; import javax.ws.rs.core.UriInfo; import java.util.Set; diff --git a/services/src/main/java/org/keycloak/protocol/saml/SamlProtocol.java b/services/src/main/java/org/keycloak/protocol/saml/SamlProtocol.java index 42fd549cb0..9751c6bec9 100755 --- a/services/src/main/java/org/keycloak/protocol/saml/SamlProtocol.java +++ b/services/src/main/java/org/keycloak/protocol/saml/SamlProtocol.java @@ -17,23 +17,6 @@ package org.keycloak.protocol.saml; -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.security.PublicKey; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.UUID; - -import javax.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriBuilder; -import javax.ws.rs.core.UriInfo; - import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.NameValuePair; @@ -77,6 +60,22 @@ import org.keycloak.services.messages.Messages; import org.keycloak.services.resources.RealmsResource; import org.w3c.dom.Document; +import javax.ws.rs.core.HttpHeaders; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.UriBuilder; +import javax.ws.rs.core.UriInfo; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.security.PublicKey; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.UUID; + /** * @author Bill Burke * @version $Revision: 1 $ diff --git a/services/src/main/java/org/keycloak/protocol/saml/SamlProtocolUtils.java b/services/src/main/java/org/keycloak/protocol/saml/SamlProtocolUtils.java index dfc51a3129..e1a7c98c0d 100755 --- a/services/src/main/java/org/keycloak/protocol/saml/SamlProtocolUtils.java +++ b/services/src/main/java/org/keycloak/protocol/saml/SamlProtocolUtils.java @@ -18,13 +18,13 @@ package org.keycloak.protocol.saml; import org.keycloak.common.VerificationException; +import org.keycloak.common.util.PemUtils; import org.keycloak.models.ClientModel; import org.keycloak.saml.SignatureAlgorithm; import org.keycloak.saml.common.constants.GeneralConstants; import org.keycloak.saml.common.exceptions.ProcessingException; import org.keycloak.saml.processing.api.saml.v2.sig.SAML2Signature; import org.keycloak.saml.processing.web.util.RedirectBindingUtil; -import org.keycloak.common.util.PemUtils; import org.w3c.dom.Document; import javax.ws.rs.core.MultivaluedMap; diff --git a/services/src/main/java/org/keycloak/protocol/saml/SamlService.java b/services/src/main/java/org/keycloak/protocol/saml/SamlService.java index 89cadb8a1a..cff68ae304 100755 --- a/services/src/main/java/org/keycloak/protocol/saml/SamlService.java +++ b/services/src/main/java/org/keycloak/protocol/saml/SamlService.java @@ -17,23 +17,6 @@ package org.keycloak.protocol.saml; -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.security.PublicKey; - -import javax.ws.rs.Consumes; -import javax.ws.rs.FormParam; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriInfo; - import org.jboss.logging.Logger; import org.jboss.resteasy.annotations.cache.NoCache; import org.jboss.resteasy.spi.ResteasyProviderFactory; @@ -68,6 +51,22 @@ import org.keycloak.services.messages.Messages; import org.keycloak.services.resources.RealmsResource; import org.keycloak.services.util.CacheControlUtil; +import javax.ws.rs.Consumes; +import javax.ws.rs.FormParam; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.UriInfo; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.security.PublicKey; + /** * Resource class for the oauth/openid connect token service * diff --git a/services/src/main/java/org/keycloak/protocol/saml/installation/KeycloakSamlSubsystemInstallation.java b/services/src/main/java/org/keycloak/protocol/saml/installation/KeycloakSamlSubsystemInstallation.java index 022787c06b..1310ea486e 100755 --- a/services/src/main/java/org/keycloak/protocol/saml/installation/KeycloakSamlSubsystemInstallation.java +++ b/services/src/main/java/org/keycloak/protocol/saml/installation/KeycloakSamlSubsystemInstallation.java @@ -25,11 +25,9 @@ import org.keycloak.models.RealmModel; import org.keycloak.protocol.ClientInstallationProvider; import org.keycloak.protocol.saml.SamlClient; import org.keycloak.protocol.saml.SamlProtocol; -import org.keycloak.services.resources.RealmsResource; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriBuilder; import java.net.URI; /** diff --git a/services/src/main/java/org/keycloak/protocol/saml/mappers/AttributeStatementHelper.java b/services/src/main/java/org/keycloak/protocol/saml/mappers/AttributeStatementHelper.java index 93e961113c..59ddd49edd 100755 --- a/services/src/main/java/org/keycloak/protocol/saml/mappers/AttributeStatementHelper.java +++ b/services/src/main/java/org/keycloak/protocol/saml/mappers/AttributeStatementHelper.java @@ -17,13 +17,13 @@ package org.keycloak.protocol.saml.mappers; -import org.keycloak.models.ProtocolMapperModel; -import org.keycloak.protocol.ProtocolMapperUtils; -import org.keycloak.provider.ProviderConfigProperty; -import org.keycloak.protocol.saml.SamlProtocol; -import org.keycloak.saml.common.constants.JBossSAMLURIConstants; import org.keycloak.dom.saml.v2.assertion.AttributeStatementType; import org.keycloak.dom.saml.v2.assertion.AttributeType; +import org.keycloak.models.ProtocolMapperModel; +import org.keycloak.protocol.ProtocolMapperUtils; +import org.keycloak.protocol.saml.SamlProtocol; +import org.keycloak.provider.ProviderConfigProperty; +import org.keycloak.saml.common.constants.JBossSAMLURIConstants; import java.util.ArrayList; import java.util.HashMap; diff --git a/services/src/main/java/org/keycloak/protocol/saml/mappers/HardcodedAttributeMapper.java b/services/src/main/java/org/keycloak/protocol/saml/mappers/HardcodedAttributeMapper.java index 2de1a81aa5..b8a62313d9 100755 --- a/services/src/main/java/org/keycloak/protocol/saml/mappers/HardcodedAttributeMapper.java +++ b/services/src/main/java/org/keycloak/protocol/saml/mappers/HardcodedAttributeMapper.java @@ -17,11 +17,11 @@ package org.keycloak.protocol.saml.mappers; +import org.keycloak.dom.saml.v2.assertion.AttributeStatementType; import org.keycloak.models.ClientSessionModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.ProtocolMapperModel; import org.keycloak.models.UserSessionModel; -import org.keycloak.dom.saml.v2.assertion.AttributeStatementType; import org.keycloak.provider.ProviderConfigProperty; import java.util.ArrayList; diff --git a/services/src/main/java/org/keycloak/protocol/saml/mappers/HardcodedRole.java b/services/src/main/java/org/keycloak/protocol/saml/mappers/HardcodedRole.java index 7f55f6f936..9efead26fd 100755 --- a/services/src/main/java/org/keycloak/protocol/saml/mappers/HardcodedRole.java +++ b/services/src/main/java/org/keycloak/protocol/saml/mappers/HardcodedRole.java @@ -18,8 +18,8 @@ package org.keycloak.protocol.saml.mappers; import org.keycloak.models.ProtocolMapperModel; -import org.keycloak.provider.ProviderConfigProperty; import org.keycloak.protocol.saml.SamlProtocol; +import org.keycloak.provider.ProviderConfigProperty; import java.util.ArrayList; import java.util.HashMap; diff --git a/services/src/main/java/org/keycloak/protocol/saml/mappers/RoleListMapper.java b/services/src/main/java/org/keycloak/protocol/saml/mappers/RoleListMapper.java index 9e452cccd7..0f9fdeb619 100755 --- a/services/src/main/java/org/keycloak/protocol/saml/mappers/RoleListMapper.java +++ b/services/src/main/java/org/keycloak/protocol/saml/mappers/RoleListMapper.java @@ -17,6 +17,8 @@ package org.keycloak.protocol.saml.mappers; +import org.keycloak.dom.saml.v2.assertion.AttributeStatementType; +import org.keycloak.dom.saml.v2.assertion.AttributeType; import org.keycloak.models.ClientSessionModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.KeycloakSessionFactory; @@ -24,10 +26,8 @@ import org.keycloak.models.ProtocolMapperModel; import org.keycloak.models.RoleModel; import org.keycloak.models.UserSessionModel; import org.keycloak.protocol.ProtocolMapper; -import org.keycloak.provider.ProviderConfigProperty; import org.keycloak.protocol.saml.SamlProtocol; -import org.keycloak.dom.saml.v2.assertion.AttributeStatementType; -import org.keycloak.dom.saml.v2.assertion.AttributeType; +import org.keycloak.provider.ProviderConfigProperty; import org.keycloak.services.managers.ClientSessionCode; import java.util.ArrayList; diff --git a/services/src/main/java/org/keycloak/protocol/saml/mappers/RoleNameMapper.java b/services/src/main/java/org/keycloak/protocol/saml/mappers/RoleNameMapper.java index 99e4cd3b7a..407ea42b6b 100755 --- a/services/src/main/java/org/keycloak/protocol/saml/mappers/RoleNameMapper.java +++ b/services/src/main/java/org/keycloak/protocol/saml/mappers/RoleNameMapper.java @@ -18,10 +18,15 @@ package org.keycloak.protocol.saml.mappers; import org.keycloak.Config; -import org.keycloak.models.*; +import org.keycloak.models.ClientModel; +import org.keycloak.models.KeycloakSession; +import org.keycloak.models.KeycloakSessionFactory; +import org.keycloak.models.ProtocolMapperModel; +import org.keycloak.models.RoleContainerModel; +import org.keycloak.models.RoleModel; import org.keycloak.protocol.ProtocolMapper; -import org.keycloak.provider.ProviderConfigProperty; import org.keycloak.protocol.saml.SamlProtocol; +import org.keycloak.provider.ProviderConfigProperty; import java.util.ArrayList; import java.util.HashMap; diff --git a/services/src/main/java/org/keycloak/protocol/saml/mappers/SAMLAttributeStatementMapper.java b/services/src/main/java/org/keycloak/protocol/saml/mappers/SAMLAttributeStatementMapper.java index 3dc484dbac..48edfaa81b 100755 --- a/services/src/main/java/org/keycloak/protocol/saml/mappers/SAMLAttributeStatementMapper.java +++ b/services/src/main/java/org/keycloak/protocol/saml/mappers/SAMLAttributeStatementMapper.java @@ -17,11 +17,11 @@ package org.keycloak.protocol.saml.mappers; +import org.keycloak.dom.saml.v2.assertion.AttributeStatementType; import org.keycloak.models.ClientSessionModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.ProtocolMapperModel; import org.keycloak.models.UserSessionModel; -import org.keycloak.dom.saml.v2.assertion.AttributeStatementType; /** * @author Bill Burke diff --git a/services/src/main/java/org/keycloak/protocol/saml/mappers/SAMLLoginResponseMapper.java b/services/src/main/java/org/keycloak/protocol/saml/mappers/SAMLLoginResponseMapper.java index eedc32609a..cf5c9c8bd4 100755 --- a/services/src/main/java/org/keycloak/protocol/saml/mappers/SAMLLoginResponseMapper.java +++ b/services/src/main/java/org/keycloak/protocol/saml/mappers/SAMLLoginResponseMapper.java @@ -17,11 +17,11 @@ package org.keycloak.protocol.saml.mappers; +import org.keycloak.dom.saml.v2.protocol.ResponseType; import org.keycloak.models.ClientSessionModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.ProtocolMapperModel; import org.keycloak.models.UserSessionModel; -import org.keycloak.dom.saml.v2.protocol.ResponseType; /** * @author Bill Burke diff --git a/services/src/main/java/org/keycloak/protocol/saml/mappers/SAMLRoleListMapper.java b/services/src/main/java/org/keycloak/protocol/saml/mappers/SAMLRoleListMapper.java index c6d6ebb33b..a822d8cff0 100755 --- a/services/src/main/java/org/keycloak/protocol/saml/mappers/SAMLRoleListMapper.java +++ b/services/src/main/java/org/keycloak/protocol/saml/mappers/SAMLRoleListMapper.java @@ -17,11 +17,11 @@ package org.keycloak.protocol.saml.mappers; +import org.keycloak.dom.saml.v2.assertion.AttributeStatementType; import org.keycloak.models.ClientSessionModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.ProtocolMapperModel; import org.keycloak.models.UserSessionModel; -import org.keycloak.dom.saml.v2.assertion.AttributeStatementType; /** * @author Bill Burke diff --git a/services/src/main/java/org/keycloak/protocol/saml/mappers/UserAttributeStatementMapper.java b/services/src/main/java/org/keycloak/protocol/saml/mappers/UserAttributeStatementMapper.java index 5043eb61a0..2340191c51 100755 --- a/services/src/main/java/org/keycloak/protocol/saml/mappers/UserAttributeStatementMapper.java +++ b/services/src/main/java/org/keycloak/protocol/saml/mappers/UserAttributeStatementMapper.java @@ -17,6 +17,7 @@ package org.keycloak.protocol.saml.mappers; +import org.keycloak.dom.saml.v2.assertion.AttributeStatementType; import org.keycloak.models.ClientSessionModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.ProtocolMapperModel; @@ -24,7 +25,6 @@ import org.keycloak.models.UserModel; import org.keycloak.models.UserSessionModel; import org.keycloak.models.utils.KeycloakModelUtils; import org.keycloak.protocol.ProtocolMapperUtils; -import org.keycloak.dom.saml.v2.assertion.AttributeStatementType; import org.keycloak.provider.ProviderConfigProperty; import java.util.ArrayList; diff --git a/services/src/main/java/org/keycloak/protocol/saml/mappers/UserPropertyAttributeStatementMapper.java b/services/src/main/java/org/keycloak/protocol/saml/mappers/UserPropertyAttributeStatementMapper.java index fb57a0652e..fd0de2a87c 100755 --- a/services/src/main/java/org/keycloak/protocol/saml/mappers/UserPropertyAttributeStatementMapper.java +++ b/services/src/main/java/org/keycloak/protocol/saml/mappers/UserPropertyAttributeStatementMapper.java @@ -17,13 +17,13 @@ package org.keycloak.protocol.saml.mappers; +import org.keycloak.dom.saml.v2.assertion.AttributeStatementType; import org.keycloak.models.ClientSessionModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.ProtocolMapperModel; import org.keycloak.models.UserModel; import org.keycloak.models.UserSessionModel; import org.keycloak.protocol.ProtocolMapperUtils; -import org.keycloak.dom.saml.v2.assertion.AttributeStatementType; import org.keycloak.provider.ProviderConfigProperty; import java.util.ArrayList; diff --git a/services/src/main/java/org/keycloak/protocol/saml/profile/ecp/authenticator/HttpBasicAuthenticator.java b/services/src/main/java/org/keycloak/protocol/saml/profile/ecp/authenticator/HttpBasicAuthenticator.java index d1404c2b95..ddaec72b80 100755 --- a/services/src/main/java/org/keycloak/protocol/saml/profile/ecp/authenticator/HttpBasicAuthenticator.java +++ b/services/src/main/java/org/keycloak/protocol/saml/profile/ecp/authenticator/HttpBasicAuthenticator.java @@ -25,8 +25,12 @@ import org.keycloak.authentication.Authenticator; import org.keycloak.authentication.AuthenticatorFactory; import org.keycloak.common.util.Base64; import org.keycloak.events.Errors; -import org.keycloak.models.*; import org.keycloak.models.AuthenticationExecutionModel.Requirement; +import org.keycloak.models.KeycloakSession; +import org.keycloak.models.KeycloakSessionFactory; +import org.keycloak.models.RealmModel; +import org.keycloak.models.UserCredentialModel; +import org.keycloak.models.UserModel; import org.keycloak.provider.ProviderConfigProperty; import javax.ws.rs.core.HttpHeaders; diff --git a/services/src/main/java/org/keycloak/services/DefaultKeycloakContext.java b/services/src/main/java/org/keycloak/services/DefaultKeycloakContext.java index 3bb9586868..f58f4ca378 100755 --- a/services/src/main/java/org/keycloak/services/DefaultKeycloakContext.java +++ b/services/src/main/java/org/keycloak/services/DefaultKeycloakContext.java @@ -19,7 +19,11 @@ package org.keycloak.services; import org.jboss.resteasy.spi.ResteasyProviderFactory; import org.keycloak.common.ClientConnection; -import org.keycloak.models.*; +import org.keycloak.models.ClientModel; +import org.keycloak.models.KeycloakContext; +import org.keycloak.models.KeycloakSession; +import org.keycloak.models.RealmModel; +import org.keycloak.models.UserModel; import org.keycloak.models.utils.RealmImporter; import org.keycloak.services.managers.RealmManager; import org.keycloak.services.resources.KeycloakApplication; diff --git a/services/src/main/java/org/keycloak/services/DefaultKeycloakSession.java b/services/src/main/java/org/keycloak/services/DefaultKeycloakSession.java index b1ae4ddac1..0b971d23da 100644 --- a/services/src/main/java/org/keycloak/services/DefaultKeycloakSession.java +++ b/services/src/main/java/org/keycloak/services/DefaultKeycloakSession.java @@ -16,9 +16,16 @@ */ package org.keycloak.services; -import org.keycloak.credential.UserCredentialStore; import org.keycloak.credential.UserCredentialStoreManager; -import org.keycloak.models.*; +import org.keycloak.models.KeycloakContext; +import org.keycloak.models.KeycloakSession; +import org.keycloak.models.KeycloakSessionFactory; +import org.keycloak.models.KeycloakTransactionManager; +import org.keycloak.models.RealmProvider; +import org.keycloak.models.UserCredentialManager; +import org.keycloak.models.UserFederationManager; +import org.keycloak.models.UserProvider; +import org.keycloak.models.UserSessionProvider; import org.keycloak.models.cache.CacheRealmProvider; import org.keycloak.models.cache.UserCache; import org.keycloak.provider.Provider; @@ -27,8 +34,12 @@ import org.keycloak.scripting.ScriptingProvider; import org.keycloak.storage.UserStorageManager; import org.keycloak.storage.federated.UserFederatedStorageProvider; -import javax.transaction.TransactionManager; -import java.util.*; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; /** * @author Stian Thorgersen diff --git a/services/src/main/java/org/keycloak/services/DefaultKeycloakSessionFactory.java b/services/src/main/java/org/keycloak/services/DefaultKeycloakSessionFactory.java index 808b4133cc..9cdb0650ca 100755 --- a/services/src/main/java/org/keycloak/services/DefaultKeycloakSessionFactory.java +++ b/services/src/main/java/org/keycloak/services/DefaultKeycloakSessionFactory.java @@ -29,11 +29,7 @@ import org.keycloak.provider.ProviderManager; import org.keycloak.provider.ProviderManagerDeployer; import org.keycloak.provider.ProviderManagerRegistry; import org.keycloak.provider.Spi; -import org.keycloak.transaction.JtaRegistration; -import org.keycloak.transaction.JtaTransactionManagerLookup; -import org.keycloak.transaction.JtaTransactionWrapper; -import javax.transaction.TransactionManager; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; diff --git a/services/src/main/java/org/keycloak/services/ErrorResponseException.java b/services/src/main/java/org/keycloak/services/ErrorResponseException.java index 538374cee6..07c3bf5c9d 100644 --- a/services/src/main/java/org/keycloak/services/ErrorResponseException.java +++ b/services/src/main/java/org/keycloak/services/ErrorResponseException.java @@ -17,14 +17,11 @@ package org.keycloak.services; -import org.keycloak.OAuth2Constants; import org.keycloak.representations.idm.OAuth2ErrorRepresentation; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -import java.util.HashMap; -import java.util.Map; /** * @author Stian Thorgersen diff --git a/services/src/main/java/org/keycloak/services/ServicesLogger.java b/services/src/main/java/org/keycloak/services/ServicesLogger.java index 0d58f2da06..6418a61986 100644 --- a/services/src/main/java/org/keycloak/services/ServicesLogger.java +++ b/services/src/main/java/org/keycloak/services/ServicesLogger.java @@ -17,15 +17,20 @@ package org.keycloak.services; -import java.io.IOException; -import java.net.URI; -import javax.naming.NamingException; import org.jboss.logging.BasicLogger; import org.jboss.logging.Logger; import org.jboss.logging.annotations.Cause; import org.jboss.logging.annotations.LogMessage; import org.jboss.logging.annotations.Message; import org.jboss.logging.annotations.MessageLogger; +import org.jboss.logging.annotations.Once; +import org.keycloak.email.EmailException; +import org.keycloak.events.EventListenerProvider; +import org.keycloak.models.ModelDuplicateException; + +import javax.naming.NamingException; +import java.io.IOException; +import java.net.URI; import static org.jboss.logging.Logger.Level.DEBUG; import static org.jboss.logging.Logger.Level.ERROR; @@ -33,11 +38,6 @@ import static org.jboss.logging.Logger.Level.FATAL; import static org.jboss.logging.Logger.Level.INFO; import static org.jboss.logging.Logger.Level.WARN; -import org.jboss.logging.annotations.Once; -import org.keycloak.email.EmailException; -import org.keycloak.events.EventListenerProvider; -import org.keycloak.models.ModelDuplicateException; - /** * Main logger for the Keycloak Services module. diff --git a/services/src/main/java/org/keycloak/services/Urls.java b/services/src/main/java/org/keycloak/services/Urls.java index 8a06c662b0..f3beb54055 100755 --- a/services/src/main/java/org/keycloak/services/Urls.java +++ b/services/src/main/java/org/keycloak/services/Urls.java @@ -27,8 +27,6 @@ import org.keycloak.services.resources.RealmsResource; import org.keycloak.services.resources.ThemeResource; import javax.ws.rs.core.UriBuilder; -import javax.ws.rs.core.UriInfo; - import java.net.URI; /** diff --git a/services/src/main/java/org/keycloak/services/clientregistration/AbstractClientRegistrationProvider.java b/services/src/main/java/org/keycloak/services/clientregistration/AbstractClientRegistrationProvider.java index 2fe7902a60..d234bb3fe7 100755 --- a/services/src/main/java/org/keycloak/services/clientregistration/AbstractClientRegistrationProvider.java +++ b/services/src/main/java/org/keycloak/services/clientregistration/AbstractClientRegistrationProvider.java @@ -19,7 +19,11 @@ package org.keycloak.services.clientregistration; import org.keycloak.events.EventBuilder; import org.keycloak.events.EventType; -import org.keycloak.models.*; +import org.keycloak.models.ClientInitialAccessModel; +import org.keycloak.models.ClientModel; +import org.keycloak.models.ClientRegistrationTrustedHostModel; +import org.keycloak.models.KeycloakSession; +import org.keycloak.models.ModelDuplicateException; import org.keycloak.models.utils.ModelToRepresentation; import org.keycloak.models.utils.RepresentationToModel; import org.keycloak.representations.idm.ClientRepresentation; diff --git a/services/src/main/java/org/keycloak/services/clientregistration/ClientRegistrationHostUtils.java b/services/src/main/java/org/keycloak/services/clientregistration/ClientRegistrationHostUtils.java index 93cd98400a..e43a68ee2f 100644 --- a/services/src/main/java/org/keycloak/services/clientregistration/ClientRegistrationHostUtils.java +++ b/services/src/main/java/org/keycloak/services/clientregistration/ClientRegistrationHostUtils.java @@ -17,15 +17,15 @@ package org.keycloak.services.clientregistration; -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.util.List; - import org.jboss.logging.Logger; import org.keycloak.models.ClientRegistrationTrustedHostModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.List; + /** * @author Marek Posolda */ diff --git a/services/src/main/java/org/keycloak/services/clientregistration/DefaultClientRegistrationProvider.java b/services/src/main/java/org/keycloak/services/clientregistration/DefaultClientRegistrationProvider.java index 63f9fef9b4..cdcc8eefb0 100755 --- a/services/src/main/java/org/keycloak/services/clientregistration/DefaultClientRegistrationProvider.java +++ b/services/src/main/java/org/keycloak/services/clientregistration/DefaultClientRegistrationProvider.java @@ -23,7 +23,14 @@ import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.services.validation.PairwiseClientValidator; import org.keycloak.services.validation.ValidationMessages; -import javax.ws.rs.*; +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.net.URI; diff --git a/services/src/main/java/org/keycloak/services/clientregistration/oidc/OIDCClientRegistrationProvider.java b/services/src/main/java/org/keycloak/services/clientregistration/oidc/OIDCClientRegistrationProvider.java index 5277505914..8510642e18 100755 --- a/services/src/main/java/org/keycloak/services/clientregistration/oidc/OIDCClientRegistrationProvider.java +++ b/services/src/main/java/org/keycloak/services/clientregistration/oidc/OIDCClientRegistrationProvider.java @@ -23,15 +23,13 @@ import org.keycloak.models.KeycloakSession; import org.keycloak.models.ProtocolMapperModel; import org.keycloak.models.utils.ModelToRepresentation; import org.keycloak.models.utils.RepresentationToModel; -import org.keycloak.protocol.ProtocolMapperConfigException; import org.keycloak.protocol.oidc.mappers.AbstractPairwiseSubMapper; import org.keycloak.protocol.oidc.mappers.PairwiseSubMapperHelper; import org.keycloak.protocol.oidc.mappers.SHA256PairwiseSubMapper; -import org.keycloak.protocol.oidc.utils.PairwiseSubMapperValidator; import org.keycloak.protocol.oidc.utils.SubjectType; +import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.representations.idm.ProtocolMapperRepresentation; import org.keycloak.representations.oidc.OIDCClientRepresentation; -import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.services.ErrorResponseException; import org.keycloak.services.ServicesLogger; import org.keycloak.services.clientregistration.AbstractClientRegistrationProvider; diff --git a/services/src/main/java/org/keycloak/services/managers/ApplianceBootstrap.java b/services/src/main/java/org/keycloak/services/managers/ApplianceBootstrap.java index 9d374a2416..bd1eabddde 100755 --- a/services/src/main/java/org/keycloak/services/managers/ApplianceBootstrap.java +++ b/services/src/main/java/org/keycloak/services/managers/ApplianceBootstrap.java @@ -19,7 +19,13 @@ package org.keycloak.services.managers; import org.keycloak.Config; import org.keycloak.common.Version; import org.keycloak.common.enums.SslRequired; -import org.keycloak.models.*; +import org.keycloak.models.AdminRoles; +import org.keycloak.models.Constants; +import org.keycloak.models.KeycloakSession; +import org.keycloak.models.RealmModel; +import org.keycloak.models.RoleModel; +import org.keycloak.models.UserCredentialModel; +import org.keycloak.models.UserModel; import org.keycloak.models.utils.KeycloakModelUtils; import org.keycloak.representations.idm.CredentialRepresentation; import org.keycloak.services.ServicesLogger; diff --git a/services/src/main/java/org/keycloak/services/managers/AuthenticationManager.java b/services/src/main/java/org/keycloak/services/managers/AuthenticationManager.java index b188501d7c..2177a9b6d5 100755 --- a/services/src/main/java/org/keycloak/services/managers/AuthenticationManager.java +++ b/services/src/main/java/org/keycloak/services/managers/AuthenticationManager.java @@ -18,21 +18,31 @@ package org.keycloak.services.managers; import org.jboss.resteasy.specimpl.MultivaluedMapImpl; import org.jboss.resteasy.spi.HttpRequest; -import org.keycloak.common.ClientConnection; import org.keycloak.RSATokenVerifier; -import org.keycloak.common.VerificationException; import org.keycloak.authentication.RequiredActionContext; import org.keycloak.authentication.RequiredActionContextResult; import org.keycloak.authentication.RequiredActionFactory; import org.keycloak.authentication.RequiredActionProvider; import org.keycloak.broker.provider.IdentityProvider; +import org.keycloak.common.ClientConnection; +import org.keycloak.common.VerificationException; +import org.keycloak.common.util.Time; import org.keycloak.events.Details; import org.keycloak.events.Errors; import org.keycloak.events.EventBuilder; import org.keycloak.events.EventType; -import org.keycloak.jose.jws.JWSBuilder; import org.keycloak.forms.login.LoginFormsProvider; -import org.keycloak.models.*; +import org.keycloak.jose.jws.JWSBuilder; +import org.keycloak.models.ClientModel; +import org.keycloak.models.ClientSessionModel; +import org.keycloak.models.KeycloakSession; +import org.keycloak.models.ProtocolMapperModel; +import org.keycloak.models.RealmModel; +import org.keycloak.models.RequiredActionProviderModel; +import org.keycloak.models.RoleModel; +import org.keycloak.models.UserConsentModel; +import org.keycloak.models.UserModel; +import org.keycloak.models.UserSessionModel; import org.keycloak.models.utils.KeycloakModelUtils; import org.keycloak.protocol.LoginProtocol; import org.keycloak.protocol.LoginProtocol.Error; @@ -44,10 +54,14 @@ import org.keycloak.services.messages.Messages; import org.keycloak.services.resources.IdentityBrokerService; import org.keycloak.services.resources.RealmsResource; import org.keycloak.services.util.CookieHelper; -import org.keycloak.common.util.Time; import org.keycloak.services.util.P3PHelper; -import javax.ws.rs.core.*; +import javax.ws.rs.core.Cookie; +import javax.ws.rs.core.HttpHeaders; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.NewCookie; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.UriInfo; import java.net.URI; import java.util.LinkedList; import java.util.List; diff --git a/services/src/main/java/org/keycloak/services/managers/ClientManager.java b/services/src/main/java/org/keycloak/services/managers/ClientManager.java index 3de62db240..707dc34ee9 100644 --- a/services/src/main/java/org/keycloak/services/managers/ClientManager.java +++ b/services/src/main/java/org/keycloak/services/managers/ClientManager.java @@ -21,6 +21,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; import org.keycloak.authentication.ClientAuthenticator; import org.keycloak.authentication.ClientAuthenticatorFactory; import org.keycloak.common.constants.ServiceAccountConstants; +import org.keycloak.common.util.Time; import org.keycloak.models.ClientModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.ProtocolMapperModel; @@ -34,7 +35,6 @@ import org.keycloak.protocol.LoginProtocolFactory; import org.keycloak.protocol.oidc.OIDCLoginProtocol; import org.keycloak.protocol.oidc.mappers.UserSessionNoteMapper; import org.keycloak.representations.adapters.config.BaseRealmConfig; -import org.keycloak.common.util.Time; import org.keycloak.representations.adapters.config.PolicyEnforcerConfig; import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.services.ServicesLogger; diff --git a/services/src/main/java/org/keycloak/services/managers/DefaultBruteForceProtector.java b/services/src/main/java/org/keycloak/services/managers/DefaultBruteForceProtector.java index 2e809d1b12..33c81c11f2 100644 --- a/services/src/main/java/org/keycloak/services/managers/DefaultBruteForceProtector.java +++ b/services/src/main/java/org/keycloak/services/managers/DefaultBruteForceProtector.java @@ -22,8 +22,8 @@ import org.keycloak.common.util.Time; import org.keycloak.models.KeycloakSession; import org.keycloak.models.KeycloakSessionFactory; import org.keycloak.models.RealmModel; -import org.keycloak.models.UserModel; import org.keycloak.models.UserLoginFailureModel; +import org.keycloak.models.UserModel; import org.keycloak.services.ServicesLogger; import java.util.ArrayList; diff --git a/services/src/main/java/org/keycloak/services/managers/LDAPConnectionTestManager.java b/services/src/main/java/org/keycloak/services/managers/LDAPConnectionTestManager.java index e4c7ce6b95..b62d1d9c97 100755 --- a/services/src/main/java/org/keycloak/services/managers/LDAPConnectionTestManager.java +++ b/services/src/main/java/org/keycloak/services/managers/LDAPConnectionTestManager.java @@ -16,14 +16,14 @@ */ package org.keycloak.services.managers; +import org.keycloak.models.LDAPConstants; +import org.keycloak.services.ServicesLogger; + import javax.naming.Context; import javax.naming.NamingException; import javax.naming.ldap.InitialLdapContext; import java.util.Hashtable; -import org.keycloak.models.LDAPConstants; -import org.keycloak.services.ServicesLogger; - /** * @author Marek Posolda */ diff --git a/services/src/main/java/org/keycloak/services/managers/RealmManager.java b/services/src/main/java/org/keycloak/services/managers/RealmManager.java index 1add03dbaa..39abe85c2f 100755 --- a/services/src/main/java/org/keycloak/services/managers/RealmManager.java +++ b/services/src/main/java/org/keycloak/services/managers/RealmManager.java @@ -18,27 +18,29 @@ package org.keycloak.services.managers; import org.keycloak.Config; import org.keycloak.common.enums.SslRequired; -import org.keycloak.models.PasswordPolicy; -import org.keycloak.models.session.UserSessionPersisterProvider; -import org.keycloak.models.utils.RealmImporter; import org.keycloak.models.AccountRoles; import org.keycloak.models.AdminRoles; -import org.keycloak.models.ClientModel; import org.keycloak.models.BrowserSecurityHeaders; +import org.keycloak.models.ClientModel; import org.keycloak.models.Constants; import org.keycloak.models.ImpersonationConstants; import org.keycloak.models.KeycloakSession; import org.keycloak.models.OTPPolicy; +import org.keycloak.models.PasswordPolicy; +import org.keycloak.models.ProtocolMapperModel; import org.keycloak.models.RealmModel; import org.keycloak.models.RealmProvider; import org.keycloak.models.RoleModel; import org.keycloak.models.UserFederationProviderModel; import org.keycloak.models.UserModel; import org.keycloak.models.UserSessionProvider; +import org.keycloak.models.session.UserSessionPersisterProvider; import org.keycloak.models.utils.DefaultAuthenticationFlows; import org.keycloak.models.utils.DefaultRequiredActions; import org.keycloak.models.utils.KeycloakModelUtils; +import org.keycloak.models.utils.RealmImporter; import org.keycloak.models.utils.RepresentationToModel; +import org.keycloak.protocol.ProtocolMapperUtils; import org.keycloak.protocol.oidc.OIDCLoginProtocol; import org.keycloak.protocol.oidc.OIDCLoginProtocolFactory; import org.keycloak.representations.idm.ApplicationRepresentation; @@ -52,9 +54,6 @@ import java.util.Collections; import java.util.HashSet; import java.util.List; -import org.keycloak.models.ProtocolMapperModel; -import org.keycloak.protocol.ProtocolMapperUtils; - /** * Per request object * diff --git a/services/src/main/java/org/keycloak/services/managers/ResourceAdminManager.java b/services/src/main/java/org/keycloak/services/managers/ResourceAdminManager.java index c060370aed..2e21465eaf 100755 --- a/services/src/main/java/org/keycloak/services/managers/ResourceAdminManager.java +++ b/services/src/main/java/org/keycloak/services/managers/ResourceAdminManager.java @@ -17,6 +17,10 @@ package org.keycloak.services.managers; import org.keycloak.TokenIdGenerator; +import org.keycloak.common.util.KeycloakUriBuilder; +import org.keycloak.common.util.MultivaluedHashMap; +import org.keycloak.common.util.StringPropertyReplacer; +import org.keycloak.common.util.Time; import org.keycloak.connections.httpclient.HttpClientProvider; import org.keycloak.constants.AdapterConstants; import org.keycloak.models.ClientModel; @@ -32,10 +36,6 @@ import org.keycloak.representations.adapters.action.PushNotBeforeAction; import org.keycloak.representations.adapters.action.TestAvailabilityAction; import org.keycloak.services.ServicesLogger; import org.keycloak.services.util.ResolveRelative; -import org.keycloak.common.util.KeycloakUriBuilder; -import org.keycloak.common.util.MultivaluedHashMap; -import org.keycloak.common.util.StringPropertyReplacer; -import org.keycloak.common.util.Time; import javax.ws.rs.core.UriBuilder; import java.io.IOException; diff --git a/services/src/main/java/org/keycloak/services/managers/UserSessionManager.java b/services/src/main/java/org/keycloak/services/managers/UserSessionManager.java index e764adf69f..639668f93b 100644 --- a/services/src/main/java/org/keycloak/services/managers/UserSessionManager.java +++ b/services/src/main/java/org/keycloak/services/managers/UserSessionManager.java @@ -16,11 +16,6 @@ */ package org.keycloak.services.managers; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Set; - import org.keycloak.common.util.Time; import org.keycloak.models.ClientModel; import org.keycloak.models.ClientSessionModel; @@ -34,6 +29,11 @@ import org.keycloak.models.UserSessionModel; import org.keycloak.models.session.UserSessionPersisterProvider; import org.keycloak.services.ServicesLogger; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; + /** * diff --git a/services/src/main/java/org/keycloak/services/managers/UsersSyncManager.java b/services/src/main/java/org/keycloak/services/managers/UsersSyncManager.java index 3f85a87546..7d390ba2a6 100755 --- a/services/src/main/java/org/keycloak/services/managers/UsersSyncManager.java +++ b/services/src/main/java/org/keycloak/services/managers/UsersSyncManager.java @@ -33,8 +33,6 @@ import org.keycloak.models.utils.KeycloakModelUtils; import org.keycloak.services.ServicesLogger; import org.keycloak.timer.TimerProvider; - -import java.io.Serializable; import java.util.List; import java.util.concurrent.Callable; diff --git a/services/src/main/java/org/keycloak/services/migration/DefaultMigrationProvider.java b/services/src/main/java/org/keycloak/services/migration/DefaultMigrationProvider.java index ee6fcb9eaf..0f0a944813 100755 --- a/services/src/main/java/org/keycloak/services/migration/DefaultMigrationProvider.java +++ b/services/src/main/java/org/keycloak/services/migration/DefaultMigrationProvider.java @@ -17,11 +17,6 @@ package org.keycloak.services.migration; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - import org.keycloak.migration.MigrationProvider; import org.keycloak.models.ClaimMask; import org.keycloak.models.KeycloakSession; @@ -35,6 +30,11 @@ import org.keycloak.provider.ProviderFactory; import org.keycloak.representations.idm.ProtocolMapperRepresentation; import org.keycloak.services.managers.RealmManager; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + /** * Various common utils needed for migration from older version to newer * diff --git a/services/src/main/java/org/keycloak/services/resources/AbstractSecuredLocalService.java b/services/src/main/java/org/keycloak/services/resources/AbstractSecuredLocalService.java index 2a8c0bb6b1..17b4995c60 100755 --- a/services/src/main/java/org/keycloak/services/resources/AbstractSecuredLocalService.java +++ b/services/src/main/java/org/keycloak/services/resources/AbstractSecuredLocalService.java @@ -19,9 +19,10 @@ package org.keycloak.services.resources; import org.jboss.resteasy.spi.BadRequestException; import org.jboss.resteasy.spi.HttpRequest; import org.keycloak.AbstractOAuthClient; -import org.keycloak.common.ClientConnection; import org.keycloak.OAuth2Constants; +import org.keycloak.common.ClientConnection; import org.keycloak.common.util.KeycloakUriBuilder; +import org.keycloak.common.util.UriUtils; import org.keycloak.models.ClientModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; @@ -33,7 +34,6 @@ import org.keycloak.services.managers.AppAuthManager; import org.keycloak.services.managers.Auth; import org.keycloak.services.managers.AuthenticationManager; import org.keycloak.services.util.CookieHelper; -import org.keycloak.common.util.UriUtils; import org.keycloak.util.TokenUtil; import javax.ws.rs.GET; diff --git a/services/src/main/java/org/keycloak/services/resources/AccountService.java b/services/src/main/java/org/keycloak/services/resources/AccountService.java index 36f643f27c..2ba74ca6b1 100755 --- a/services/src/main/java/org/keycloak/services/resources/AccountService.java +++ b/services/src/main/java/org/keycloak/services/resources/AccountService.java @@ -16,16 +16,16 @@ */ package org.keycloak.services.resources; -import org.keycloak.credential.CredentialInput; +import org.keycloak.common.util.UriUtils; import org.keycloak.credential.CredentialModel; -import org.keycloak.events.Errors; -import org.keycloak.forms.account.AccountPages; -import org.keycloak.forms.account.AccountProvider; import org.keycloak.events.Details; +import org.keycloak.events.Errors; import org.keycloak.events.Event; import org.keycloak.events.EventBuilder; import org.keycloak.events.EventStoreProvider; import org.keycloak.events.EventType; +import org.keycloak.forms.account.AccountPages; +import org.keycloak.forms.account.AccountProvider; import org.keycloak.forms.login.LoginFormsProvider; import org.keycloak.models.AccountRoles; import org.keycloak.models.ClientModel; @@ -38,18 +38,13 @@ import org.keycloak.models.ModelException; import org.keycloak.models.ModelReadOnlyException; import org.keycloak.models.RealmModel; import org.keycloak.models.UserCredentialModel; -import org.keycloak.models.UserCredentialValueModel; -import org.keycloak.models.UserFederationProvider; -import org.keycloak.models.UserFederationProviderModel; import org.keycloak.models.UserModel; import org.keycloak.models.UserSessionModel; import org.keycloak.models.utils.CredentialValidation; import org.keycloak.models.utils.FormMessage; -import org.keycloak.models.utils.KeycloakModelUtils; import org.keycloak.models.utils.ModelToRepresentation; import org.keycloak.protocol.oidc.OIDCLoginProtocol; import org.keycloak.protocol.oidc.utils.RedirectUtils; -import org.keycloak.representations.idm.CredentialRepresentation; import org.keycloak.representations.idm.UserRepresentation; import org.keycloak.services.ForbiddenException; import org.keycloak.services.ServicesLogger; @@ -62,7 +57,6 @@ import org.keycloak.services.managers.UserSessionManager; import org.keycloak.services.messages.Messages; import org.keycloak.services.util.ResolveRelative; import org.keycloak.services.validation.Validation; -import org.keycloak.common.util.UriUtils; import org.keycloak.util.JsonSerialization; import javax.ws.rs.Consumes; @@ -77,13 +71,11 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.UriBuilder; import javax.ws.rs.core.UriInfo; import javax.ws.rs.core.Variant; - import java.io.IOException; import java.lang.reflect.Method; import java.net.URI; import java.util.HashSet; import java.util.Iterator; -import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; diff --git a/services/src/main/java/org/keycloak/services/resources/AttributeFormDataProcessor.java b/services/src/main/java/org/keycloak/services/resources/AttributeFormDataProcessor.java index 235c5cfa87..deb4cd47fe 100755 --- a/services/src/main/java/org/keycloak/services/resources/AttributeFormDataProcessor.java +++ b/services/src/main/java/org/keycloak/services/resources/AttributeFormDataProcessor.java @@ -17,9 +17,6 @@ package org.keycloak.services.resources; -import java.util.ArrayList; -import java.util.List; - import org.keycloak.authentication.requiredactions.util.UpdateProfileContext; import org.keycloak.authentication.requiredactions.util.UserUpdateProfileContext; import org.keycloak.models.Constants; @@ -27,6 +24,8 @@ import org.keycloak.models.RealmModel; import org.keycloak.models.UserModel; import javax.ws.rs.core.MultivaluedMap; +import java.util.ArrayList; +import java.util.List; /** * @author Bill Burke diff --git a/services/src/main/java/org/keycloak/services/resources/ClientsManagementService.java b/services/src/main/java/org/keycloak/services/resources/ClientsManagementService.java index 898ad3c05a..5497b57a94 100755 --- a/services/src/main/java/org/keycloak/services/resources/ClientsManagementService.java +++ b/services/src/main/java/org/keycloak/services/resources/ClientsManagementService.java @@ -21,7 +21,7 @@ import org.jboss.resteasy.spi.HttpRequest; import org.jboss.resteasy.spi.UnauthorizedException; import org.keycloak.OAuthErrorException; import org.keycloak.common.ClientConnection; -import org.keycloak.OAuth2Constants; +import org.keycloak.common.util.Time; import org.keycloak.constants.AdapterConstants; import org.keycloak.events.Details; import org.keycloak.events.Errors; @@ -34,7 +34,6 @@ import org.keycloak.protocol.oidc.utils.AuthorizeClientUtil; import org.keycloak.representations.idm.OAuth2ErrorRepresentation; import org.keycloak.services.ForbiddenException; import org.keycloak.services.ServicesLogger; -import org.keycloak.common.util.Time; import javax.ws.rs.HeaderParam; import javax.ws.rs.POST; @@ -48,8 +47,6 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.UriBuilder; import javax.ws.rs.core.UriInfo; import javax.ws.rs.ext.Providers; -import java.util.HashMap; -import java.util.Map; /** * @author Marek Posolda diff --git a/services/src/main/java/org/keycloak/services/resources/Cors.java b/services/src/main/java/org/keycloak/services/resources/Cors.java index c3e11ab95a..7b4957adb4 100755 --- a/services/src/main/java/org/keycloak/services/resources/Cors.java +++ b/services/src/main/java/org/keycloak/services/resources/Cors.java @@ -18,9 +18,9 @@ package org.keycloak.services.resources; import org.jboss.resteasy.spi.HttpRequest; import org.jboss.resteasy.spi.HttpResponse; +import org.keycloak.common.util.CollectionUtil; import org.keycloak.models.ClientModel; import org.keycloak.representations.AccessToken; -import org.keycloak.common.util.CollectionUtil; import org.keycloak.services.ServicesLogger; import javax.ws.rs.core.Response; diff --git a/services/src/main/java/org/keycloak/services/resources/IdentityBrokerService.java b/services/src/main/java/org/keycloak/services/resources/IdentityBrokerService.java index 91818176c2..fabbae0167 100755 --- a/services/src/main/java/org/keycloak/services/resources/IdentityBrokerService.java +++ b/services/src/main/java/org/keycloak/services/resources/IdentityBrokerService.java @@ -19,17 +19,19 @@ package org.keycloak.services.resources; import org.jboss.resteasy.spi.HttpRequest; import org.jboss.resteasy.spi.ResteasyProviderFactory; import org.keycloak.OAuth2Constants; +import org.keycloak.authentication.AuthenticationProcessor; import org.keycloak.authentication.authenticators.broker.AbstractIdpAuthenticator; import org.keycloak.authentication.authenticators.broker.util.PostBrokerLoginConstants; import org.keycloak.authentication.authenticators.broker.util.SerializedBrokeredIdentityContext; -import org.keycloak.common.ClientConnection; -import org.keycloak.authentication.AuthenticationProcessor; import org.keycloak.broker.provider.AuthenticationRequest; import org.keycloak.broker.provider.BrokeredIdentityContext; import org.keycloak.broker.provider.IdentityBrokerException; import org.keycloak.broker.provider.IdentityProvider; import org.keycloak.broker.provider.IdentityProviderFactory; import org.keycloak.broker.provider.IdentityProviderMapper; +import org.keycloak.broker.social.SocialIdentityProvider; +import org.keycloak.common.ClientConnection; +import org.keycloak.common.util.ObjectUtil; import org.keycloak.common.util.Time; import org.keycloak.events.Details; import org.keycloak.events.Errors; @@ -53,29 +55,31 @@ import org.keycloak.models.utils.FormMessage; import org.keycloak.protocol.oidc.TokenManager; import org.keycloak.provider.ProviderFactory; import org.keycloak.representations.AccessToken; +import org.keycloak.services.ErrorPage; +import org.keycloak.services.ErrorResponse; +import org.keycloak.services.ServicesLogger; +import org.keycloak.services.Urls; import org.keycloak.services.managers.AppAuthManager; import org.keycloak.services.managers.AuthenticationManager.AuthResult; import org.keycloak.services.managers.BruteForceProtector; import org.keycloak.services.managers.ClientSessionCode; import org.keycloak.services.messages.Messages; -import org.keycloak.services.ErrorResponse; -import org.keycloak.services.ErrorPage; -import org.keycloak.services.ServicesLogger; -import org.keycloak.services.Urls; import org.keycloak.services.util.CacheControlUtil; import org.keycloak.services.validation.Validation; -import org.keycloak.broker.social.SocialIdentityProvider; -import org.keycloak.common.util.ObjectUtil; import org.keycloak.util.JsonSerialization; -import javax.ws.rs.*; +import javax.ws.rs.GET; +import javax.ws.rs.OPTIONS; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.QueryParam; import javax.ws.rs.core.Context; import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; import javax.ws.rs.core.UriBuilder; import javax.ws.rs.core.UriInfo; - import java.io.IOException; import java.net.URI; import java.util.ArrayList; diff --git a/services/src/main/java/org/keycloak/services/resources/KeycloakApplication.java b/services/src/main/java/org/keycloak/services/resources/KeycloakApplication.java index 1e7c0b7024..f391b1a2a9 100644 --- a/services/src/main/java/org/keycloak/services/resources/KeycloakApplication.java +++ b/services/src/main/java/org/keycloak/services/resources/KeycloakApplication.java @@ -19,14 +19,21 @@ package org.keycloak.services.resources; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; +import org.jboss.dmr.ModelNode; import org.jboss.resteasy.core.Dispatcher; import org.jboss.resteasy.spi.ResteasyProviderFactory; import org.keycloak.Config; +import org.keycloak.common.util.SystemEnvProperties; import org.keycloak.exportimport.ExportImportManager; import org.keycloak.migration.MigrationModelManager; -import org.keycloak.models.*; -import org.keycloak.models.dblock.DBLockProvider; +import org.keycloak.models.KeycloakSession; +import org.keycloak.models.KeycloakSessionFactory; +import org.keycloak.models.KeycloakSessionTask; +import org.keycloak.models.ModelDuplicateException; +import org.keycloak.models.RealmModel; +import org.keycloak.models.UserModel; import org.keycloak.models.dblock.DBLockManager; +import org.keycloak.models.dblock.DBLockProvider; import org.keycloak.models.utils.KeycloakModelUtils; import org.keycloak.models.utils.PostMigrationEvent; import org.keycloak.models.utils.RepresentationToModel; @@ -47,7 +54,6 @@ import org.keycloak.services.util.ObjectMapperResolver; import org.keycloak.timer.TimerProvider; import org.keycloak.transaction.JtaTransactionManagerLookup; import org.keycloak.util.JsonSerialization; -import org.keycloak.common.util.SystemEnvProperties; import javax.servlet.ServletContext; import javax.transaction.SystemException; @@ -55,11 +61,18 @@ import javax.transaction.Transaction; import javax.ws.rs.core.Application; import javax.ws.rs.core.Context; import javax.ws.rs.core.UriInfo; -import java.io.*; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; import java.net.URI; import java.net.URL; -import java.util.*; -import org.jboss.dmr.ModelNode; +import java.util.HashSet; +import java.util.List; +import java.util.Properties; +import java.util.Set; +import java.util.StringTokenizer; /** * @author Bill Burke diff --git a/services/src/main/java/org/keycloak/services/resources/LoginActionsService.java b/services/src/main/java/org/keycloak/services/resources/LoginActionsService.java index 66dee2e651..8b23ee22a3 100755 --- a/services/src/main/java/org/keycloak/services/resources/LoginActionsService.java +++ b/services/src/main/java/org/keycloak/services/resources/LoginActionsService.java @@ -17,19 +17,19 @@ package org.keycloak.services.resources; import org.jboss.resteasy.spi.HttpRequest; -import org.keycloak.authentication.authenticators.broker.AbstractIdpAuthenticator; -import org.keycloak.authentication.authenticators.broker.util.PostBrokerLoginConstants; -import org.keycloak.authentication.requiredactions.VerifyEmail; -import org.keycloak.authentication.authenticators.broker.util.SerializedBrokeredIdentityContext; -import org.keycloak.broker.provider.BrokeredIdentityContext; -import org.keycloak.common.ClientConnection; import org.keycloak.OAuth2Constants; import org.keycloak.authentication.AuthenticationProcessor; import org.keycloak.authentication.RequiredActionContext; import org.keycloak.authentication.RequiredActionContextResult; import org.keycloak.authentication.RequiredActionFactory; import org.keycloak.authentication.RequiredActionProvider; +import org.keycloak.authentication.authenticators.broker.AbstractIdpAuthenticator; +import org.keycloak.authentication.authenticators.broker.util.PostBrokerLoginConstants; +import org.keycloak.authentication.authenticators.broker.util.SerializedBrokeredIdentityContext; import org.keycloak.authentication.authenticators.browser.AbstractUsernameFormAuthenticator; +import org.keycloak.authentication.requiredactions.VerifyEmail; +import org.keycloak.broker.provider.BrokeredIdentityContext; +import org.keycloak.common.ClientConnection; import org.keycloak.common.util.Time; import org.keycloak.events.Details; import org.keycloak.events.Errors; @@ -49,10 +49,9 @@ import org.keycloak.models.UserModel; import org.keycloak.models.UserModel.RequiredAction; import org.keycloak.models.UserSessionModel; import org.keycloak.models.utils.FormMessage; -import org.keycloak.models.utils.KeycloakModelUtils; import org.keycloak.protocol.LoginProtocol; -import org.keycloak.protocol.RestartLoginCookie; import org.keycloak.protocol.LoginProtocol.Error; +import org.keycloak.protocol.RestartLoginCookie; import org.keycloak.protocol.oidc.OIDCLoginProtocol; import org.keycloak.protocol.oidc.utils.OIDCResponseMode; import org.keycloak.protocol.oidc.utils.OIDCResponseType; diff --git a/services/src/main/java/org/keycloak/services/resources/ThemeResource.java b/services/src/main/java/org/keycloak/services/resources/ThemeResource.java index 6675cfc2c8..7cb2379c9a 100644 --- a/services/src/main/java/org/keycloak/services/resources/ThemeResource.java +++ b/services/src/main/java/org/keycloak/services/resources/ThemeResource.java @@ -17,12 +17,12 @@ package org.keycloak.services.resources; import org.keycloak.common.Version; -import org.keycloak.theme.Theme; -import org.keycloak.theme.ThemeProvider; -import org.keycloak.models.KeycloakSession; import org.keycloak.common.util.MimeTypeUtil; +import org.keycloak.models.KeycloakSession; import org.keycloak.services.ServicesLogger; import org.keycloak.services.util.CacheControlUtil; +import org.keycloak.theme.Theme; +import org.keycloak.theme.ThemeProvider; import javax.ws.rs.GET; import javax.ws.rs.Path; diff --git a/services/src/main/java/org/keycloak/services/resources/admin/AdminConsole.java b/services/src/main/java/org/keycloak/services/resources/admin/AdminConsole.java index d2a5945f39..afbec5fb0a 100644 --- a/services/src/main/java/org/keycloak/services/resources/admin/AdminConsole.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/AdminConsole.java @@ -24,10 +24,6 @@ import org.jboss.resteasy.spi.NotFoundException; import org.keycloak.Config; import org.keycloak.common.ClientConnection; import org.keycloak.common.Version; -import org.keycloak.theme.BrowserSecurityHeaderSetup; -import org.keycloak.theme.FreeMarkerException; -import org.keycloak.theme.FreeMarkerUtil; -import org.keycloak.theme.Theme; import org.keycloak.models.AdminRoles; import org.keycloak.models.ClientModel; import org.keycloak.models.Constants; @@ -37,17 +33,22 @@ import org.keycloak.models.RoleModel; import org.keycloak.models.UserModel; import org.keycloak.protocol.oidc.OIDCLoginProtocolService; import org.keycloak.services.ServicesLogger; +import org.keycloak.services.Urls; import org.keycloak.services.managers.AppAuthManager; -import org.keycloak.services.managers.ClientManager; import org.keycloak.services.managers.AuthenticationManager; +import org.keycloak.services.managers.ClientManager; import org.keycloak.services.managers.RealmManager; import org.keycloak.services.resources.KeycloakApplication; -import org.keycloak.services.Urls; +import org.keycloak.theme.BrowserSecurityHeaderSetup; +import org.keycloak.theme.FreeMarkerException; +import org.keycloak.theme.FreeMarkerUtil; +import org.keycloak.theme.Theme; import org.keycloak.utils.MediaType; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; import javax.ws.rs.core.Context; import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.Response; @@ -56,8 +57,13 @@ import javax.ws.rs.ext.Providers; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; -import java.util.*; -import javax.ws.rs.QueryParam; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Properties; +import java.util.Set; /** * @author Bill Burke diff --git a/services/src/main/java/org/keycloak/services/resources/admin/AdminEventBuilder.java b/services/src/main/java/org/keycloak/services/resources/admin/AdminEventBuilder.java index f4f2c8920b..0fa484dc3e 100644 --- a/services/src/main/java/org/keycloak/services/resources/admin/AdminEventBuilder.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/AdminEventBuilder.java @@ -16,11 +16,8 @@ */ package org.keycloak.services.resources.admin; -import java.io.IOException; -import java.util.LinkedList; -import java.util.List; - import org.keycloak.common.ClientConnection; +import org.keycloak.common.util.Time; import org.keycloak.events.EventListenerProvider; import org.keycloak.events.EventStoreProvider; import org.keycloak.events.admin.AdminEvent; @@ -33,9 +30,11 @@ import org.keycloak.models.RealmModel; import org.keycloak.models.UserModel; import org.keycloak.services.ServicesLogger; import org.keycloak.util.JsonSerialization; -import org.keycloak.common.util.Time; import javax.ws.rs.core.UriInfo; +import java.io.IOException; +import java.util.LinkedList; +import java.util.List; public class AdminEventBuilder { diff --git a/services/src/main/java/org/keycloak/services/resources/admin/AttackDetectionResource.java b/services/src/main/java/org/keycloak/services/resources/admin/AttackDetectionResource.java index bf9252408c..b02dbb4899 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/AttackDetectionResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/AttackDetectionResource.java @@ -22,8 +22,8 @@ import org.keycloak.events.admin.OperationType; import org.keycloak.events.admin.ResourceType; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; -import org.keycloak.models.UserModel; import org.keycloak.models.UserLoginFailureModel; +import org.keycloak.models.UserModel; import org.keycloak.services.ServicesLogger; import org.keycloak.services.managers.BruteForceProtector; diff --git a/services/src/main/java/org/keycloak/services/resources/admin/ClientAttributeCertificateResource.java b/services/src/main/java/org/keycloak/services/resources/admin/ClientAttributeCertificateResource.java index 152d632941..77afc30fd3 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/ClientAttributeCertificateResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/ClientAttributeCertificateResource.java @@ -22,6 +22,7 @@ import org.jboss.resteasy.plugins.providers.multipart.InputPart; import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; import org.jboss.resteasy.spi.NotAcceptableException; import org.jboss.resteasy.spi.NotFoundException; +import org.keycloak.common.util.PemUtils; import org.keycloak.common.util.StreamUtil; import org.keycloak.events.admin.OperationType; import org.keycloak.events.admin.ResourceType; @@ -35,7 +36,6 @@ import org.keycloak.protocol.oidc.utils.JWKSUtils; import org.keycloak.representations.KeyStoreConfig; import org.keycloak.representations.idm.CertificateRepresentation; import org.keycloak.services.ErrorResponseException; -import org.keycloak.common.util.PemUtils; import org.keycloak.services.util.CertificateInfoHelper; import org.keycloak.util.JsonSerialization; @@ -48,7 +48,6 @@ import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriInfo; - import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; diff --git a/services/src/main/java/org/keycloak/services/resources/admin/ClientInitialAccessResource.java b/services/src/main/java/org/keycloak/services/resources/admin/ClientInitialAccessResource.java index 696af1851f..532bffcd17 100644 --- a/services/src/main/java/org/keycloak/services/resources/admin/ClientInitialAccessResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/ClientInitialAccessResource.java @@ -27,8 +27,18 @@ import org.keycloak.representations.idm.ClientInitialAccessPresentation; import org.keycloak.services.clientregistration.ClientRegistrationTokenUtils; import javax.servlet.http.HttpServletResponse; -import javax.ws.rs.*; -import javax.ws.rs.core.*; +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.HttpHeaders; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.UriInfo; import java.util.LinkedList; import java.util.List; diff --git a/services/src/main/java/org/keycloak/services/resources/admin/ClientRegistrationTrustedHostResource.java b/services/src/main/java/org/keycloak/services/resources/admin/ClientRegistrationTrustedHostResource.java index 000885fd57..b1dfbfd780 100644 --- a/services/src/main/java/org/keycloak/services/resources/admin/ClientRegistrationTrustedHostResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/ClientRegistrationTrustedHostResource.java @@ -17,24 +17,6 @@ package org.keycloak.services.resources.admin; -import java.util.LinkedList; -import java.util.List; - -import javax.servlet.http.HttpServletResponse; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriInfo; - import org.jboss.resteasy.spi.NotFoundException; import org.keycloak.events.admin.OperationType; import org.keycloak.events.admin.ResourceType; @@ -45,6 +27,21 @@ import org.keycloak.models.RealmModel; import org.keycloak.representations.idm.ClientRegistrationTrustedHostRepresentation; import org.keycloak.services.ErrorResponse; +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.UriInfo; +import java.util.LinkedList; +import java.util.List; + /** * @author Marek Posolda */ diff --git a/services/src/main/java/org/keycloak/services/resources/admin/ClientResource.java b/services/src/main/java/org/keycloak/services/resources/admin/ClientResource.java index 5095c394eb..1352431883 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/ClientResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/ClientResource.java @@ -21,6 +21,7 @@ import org.jboss.resteasy.spi.BadRequestException; import org.jboss.resteasy.spi.ResteasyProviderFactory; import org.keycloak.authorization.admin.AuthorizationService; import org.keycloak.common.Profile; +import org.keycloak.common.util.Time; import org.keycloak.events.admin.OperationType; import org.keycloak.events.admin.ResourceType; import org.keycloak.models.ClientModel; @@ -40,6 +41,7 @@ import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.representations.idm.CredentialRepresentation; import org.keycloak.representations.idm.UserRepresentation; import org.keycloak.representations.idm.UserSessionRepresentation; +import org.keycloak.services.ErrorResponse; import org.keycloak.services.ErrorResponseException; import org.keycloak.services.ServicesLogger; import org.keycloak.services.clientregistration.ClientRegistrationTokenUtils; @@ -47,8 +49,6 @@ import org.keycloak.services.managers.ClientManager; import org.keycloak.services.managers.RealmManager; import org.keycloak.services.managers.ResourceAdminManager; import org.keycloak.services.resources.KeycloakApplication; -import org.keycloak.services.ErrorResponse; -import org.keycloak.common.util.Time; import org.keycloak.services.validation.ClientValidator; import org.keycloak.services.validation.PairwiseClientValidator; import org.keycloak.services.validation.ValidationMessages; @@ -68,8 +68,11 @@ import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriInfo; - -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Properties; import static java.lang.Boolean.TRUE; diff --git a/services/src/main/java/org/keycloak/services/resources/admin/ClientRoleMappingsResource.java b/services/src/main/java/org/keycloak/services/resources/admin/ClientRoleMappingsResource.java index 11fe9ef3ac..9b6c795a1e 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/ClientRoleMappingsResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/ClientRoleMappingsResource.java @@ -40,7 +40,6 @@ import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriInfo; - import java.text.MessageFormat; import java.util.ArrayList; import java.util.HashSet; diff --git a/services/src/main/java/org/keycloak/services/resources/admin/ClientTemplatesResource.java b/services/src/main/java/org/keycloak/services/resources/admin/ClientTemplatesResource.java index 46bcb5593a..fb8a970376 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/ClientTemplatesResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/ClientTemplatesResource.java @@ -17,7 +17,6 @@ package org.keycloak.services.resources.admin; import org.jboss.resteasy.annotations.cache.NoCache; -import org.jboss.resteasy.spi.NotFoundException; import org.jboss.resteasy.spi.ResteasyProviderFactory; import org.keycloak.events.admin.OperationType; import org.keycloak.events.admin.ResourceType; diff --git a/services/src/main/java/org/keycloak/services/resources/admin/ClientsResource.java b/services/src/main/java/org/keycloak/services/resources/admin/ClientsResource.java index 1be0cac65d..237239ce80 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/ClientsResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/ClientsResource.java @@ -34,12 +34,17 @@ import org.keycloak.services.validation.ClientValidator; import org.keycloak.services.validation.PairwiseClientValidator; import org.keycloak.services.validation.ValidationMessages; -import javax.ws.rs.*; +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriInfo; - import java.util.ArrayList; import java.util.List; import java.util.Properties; diff --git a/services/src/main/java/org/keycloak/services/resources/admin/ComponentResource.java b/services/src/main/java/org/keycloak/services/resources/admin/ComponentResource.java index 4ba8fa3121..f3e099afcd 100644 --- a/services/src/main/java/org/keycloak/services/resources/admin/ComponentResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/ComponentResource.java @@ -24,7 +24,6 @@ import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; import org.keycloak.models.utils.ModelToRepresentation; import org.keycloak.models.utils.RepresentationToModel; -import org.keycloak.protocol.oidc.TokenManager; import org.keycloak.representations.idm.ComponentRepresentation; import org.keycloak.services.ServicesLogger; diff --git a/services/src/main/java/org/keycloak/services/resources/admin/IdentityProviderResource.java b/services/src/main/java/org/keycloak/services/resources/admin/IdentityProviderResource.java index d92bd46bf0..af456c6b33 100644 --- a/services/src/main/java/org/keycloak/services/resources/admin/IdentityProviderResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/IdentityProviderResource.java @@ -21,6 +21,7 @@ import org.jboss.resteasy.spi.NotFoundException; import org.keycloak.broker.provider.IdentityProvider; import org.keycloak.broker.provider.IdentityProviderFactory; import org.keycloak.broker.provider.IdentityProviderMapper; +import org.keycloak.broker.social.SocialIdentityProvider; import org.keycloak.events.admin.OperationType; import org.keycloak.events.admin.ResourceType; import org.keycloak.models.FederatedIdentityModel; @@ -41,7 +42,6 @@ import org.keycloak.representations.idm.IdentityProviderMapperTypeRepresentation import org.keycloak.representations.idm.IdentityProviderRepresentation; import org.keycloak.services.ErrorResponse; import org.keycloak.services.ServicesLogger; -import org.keycloak.broker.social.SocialIdentityProvider; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; @@ -56,7 +56,6 @@ import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriInfo; - import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedList; diff --git a/services/src/main/java/org/keycloak/services/resources/admin/IdentityProvidersResource.java b/services/src/main/java/org/keycloak/services/resources/admin/IdentityProvidersResource.java index 8e7c9acb69..05f1f9e938 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/IdentityProvidersResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/IdentityProvidersResource.java @@ -23,6 +23,7 @@ import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; import org.jboss.resteasy.spi.ResteasyProviderFactory; import org.keycloak.broker.provider.IdentityProvider; import org.keycloak.broker.provider.IdentityProviderFactory; +import org.keycloak.broker.social.SocialIdentityProvider; import org.keycloak.connections.httpclient.HttpClientProvider; import org.keycloak.events.admin.OperationType; import org.keycloak.events.admin.ResourceType; @@ -35,7 +36,6 @@ import org.keycloak.models.utils.RepresentationToModel; import org.keycloak.provider.ProviderFactory; import org.keycloak.representations.idm.IdentityProviderRepresentation; import org.keycloak.services.ErrorResponse; -import org.keycloak.broker.social.SocialIdentityProvider; import javax.ws.rs.BadRequestException; import javax.ws.rs.Consumes; @@ -48,7 +48,6 @@ import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriInfo; - import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; diff --git a/services/src/main/java/org/keycloak/services/resources/admin/ProtocolMappersResource.java b/services/src/main/java/org/keycloak/services/resources/admin/ProtocolMappersResource.java index 804082051d..955fa13dba 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/ProtocolMappersResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/ProtocolMappersResource.java @@ -20,7 +20,11 @@ import org.jboss.resteasy.annotations.cache.NoCache; import org.jboss.resteasy.spi.NotFoundException; import org.keycloak.events.admin.OperationType; import org.keycloak.events.admin.ResourceType; -import org.keycloak.models.*; +import org.keycloak.models.KeycloakSession; +import org.keycloak.models.ModelDuplicateException; +import org.keycloak.models.ProtocolMapperContainerModel; +import org.keycloak.models.ProtocolMapperModel; +import org.keycloak.models.RealmModel; import org.keycloak.models.utils.ModelToRepresentation; import org.keycloak.models.utils.RepresentationToModel; import org.keycloak.protocol.ProtocolMapper; @@ -31,7 +35,14 @@ import org.keycloak.services.ErrorResponseException; import org.keycloak.services.ServicesLogger; import org.keycloak.services.resources.admin.RealmAuth.Resource; -import javax.ws.rs.*; +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; diff --git a/services/src/main/java/org/keycloak/services/resources/admin/RealmAdminResource.java b/services/src/main/java/org/keycloak/services/resources/admin/RealmAdminResource.java index 7483bd8e63..29c4cbf3bd 100644 --- a/services/src/main/java/org/keycloak/services/resources/admin/RealmAdminResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/RealmAdminResource.java @@ -48,6 +48,7 @@ import org.keycloak.models.cache.UserCache; import org.keycloak.models.utils.KeycloakModelUtils; import org.keycloak.models.utils.ModelToRepresentation; import org.keycloak.models.utils.RepresentationToModel; +import org.keycloak.partialimport.PartialImportManager; import org.keycloak.protocol.oidc.TokenManager; import org.keycloak.provider.ProviderFactory; import org.keycloak.representations.adapters.action.GlobalRequestResult; @@ -58,13 +59,13 @@ import org.keycloak.representations.idm.GroupRepresentation; import org.keycloak.representations.idm.PartialImportRepresentation; import org.keycloak.representations.idm.RealmEventsConfigRepresentation; import org.keycloak.representations.idm.RealmRepresentation; +import org.keycloak.services.ErrorResponse; +import org.keycloak.services.ServicesLogger; import org.keycloak.services.managers.AuthenticationManager; import org.keycloak.services.managers.LDAPConnectionTestManager; import org.keycloak.services.managers.RealmManager; import org.keycloak.services.managers.ResourceAdminManager; -import org.keycloak.services.ServicesLogger; import org.keycloak.services.managers.UsersSyncManager; -import org.keycloak.services.ErrorResponse; import org.keycloak.services.resources.admin.RealmAuth.Resource; import javax.ws.rs.Consumes; @@ -82,7 +83,6 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; import javax.ws.rs.core.UriInfo; - import java.security.cert.X509Certificate; import java.text.ParseException; import java.text.SimpleDateFormat; @@ -93,7 +93,6 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.regex.PatternSyntaxException; -import org.keycloak.partialimport.PartialImportManager; /** * Base resource class for the admin REST api of one realm diff --git a/services/src/main/java/org/keycloak/services/resources/admin/RealmsAdminResource.java b/services/src/main/java/org/keycloak/services/resources/admin/RealmsAdminResource.java index 1a9a5c316e..2437dd0c1e 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/RealmsAdminResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/RealmsAdminResource.java @@ -29,11 +29,11 @@ import org.keycloak.models.RoleModel; import org.keycloak.models.utils.ModelToRepresentation; import org.keycloak.protocol.oidc.TokenManager; import org.keycloak.representations.idm.RealmRepresentation; +import org.keycloak.services.ErrorResponse; import org.keycloak.services.ForbiddenException; +import org.keycloak.services.ServicesLogger; import org.keycloak.services.managers.RealmManager; import org.keycloak.services.resources.KeycloakApplication; -import org.keycloak.services.ErrorResponse; -import org.keycloak.services.ServicesLogger; import javax.ws.rs.Consumes; import javax.ws.rs.GET; @@ -47,7 +47,6 @@ import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriInfo; - import java.net.URI; import java.util.ArrayList; import java.util.List; diff --git a/services/src/main/java/org/keycloak/services/resources/admin/RoleByIdResource.java b/services/src/main/java/org/keycloak/services/resources/admin/RoleByIdResource.java index 8136db49d1..345cae57fa 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/RoleByIdResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/RoleByIdResource.java @@ -39,7 +39,6 @@ import javax.ws.rs.Produces; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.UriInfo; - import java.util.List; import java.util.Set; diff --git a/services/src/main/java/org/keycloak/services/resources/admin/RoleContainerResource.java b/services/src/main/java/org/keycloak/services/resources/admin/RoleContainerResource.java index 15e163dcad..9e93488920 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/RoleContainerResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/RoleContainerResource.java @@ -43,7 +43,6 @@ import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriInfo; - import java.util.ArrayList; import java.util.List; import java.util.Set; diff --git a/services/src/main/java/org/keycloak/services/resources/admin/RoleMapperResource.java b/services/src/main/java/org/keycloak/services/resources/admin/RoleMapperResource.java index ecaa4744df..91f3e950ad 100644 --- a/services/src/main/java/org/keycloak/services/resources/admin/RoleMapperResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/RoleMapperResource.java @@ -47,7 +47,6 @@ import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriInfo; - import java.text.MessageFormat; import java.util.ArrayList; import java.util.HashMap; diff --git a/services/src/main/java/org/keycloak/services/resources/admin/ScopeMappedClientResource.java b/services/src/main/java/org/keycloak/services/resources/admin/ScopeMappedClientResource.java index 903c2cea59..d7aa5da07b 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/ScopeMappedClientResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/ScopeMappedClientResource.java @@ -37,7 +37,6 @@ import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; - import java.util.ArrayList; import java.util.LinkedList; import java.util.List; diff --git a/services/src/main/java/org/keycloak/services/resources/admin/ScopeMappedResource.java b/services/src/main/java/org/keycloak/services/resources/admin/ScopeMappedResource.java index e4fe22fb4c..1b4ad585eb 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/ScopeMappedResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/ScopeMappedResource.java @@ -40,7 +40,6 @@ import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; - import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedList; diff --git a/services/src/main/java/org/keycloak/services/resources/admin/UserFederationProviderResource.java b/services/src/main/java/org/keycloak/services/resources/admin/UserFederationProviderResource.java index dca3829fb0..04849b52fe 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/UserFederationProviderResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/UserFederationProviderResource.java @@ -16,29 +16,6 @@ */ package org.keycloak.services.resources.admin; -import java.text.MessageFormat; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Properties; - -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriInfo; - import org.jboss.resteasy.annotations.cache.NoCache; import org.jboss.resteasy.spi.NotFoundException; import org.keycloak.events.admin.OperationType; @@ -67,6 +44,28 @@ import org.keycloak.services.ErrorResponseException; import org.keycloak.services.ServicesLogger; import org.keycloak.services.managers.UsersSyncManager; +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.UriInfo; +import java.text.MessageFormat; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Properties; + /** * @author Marek Posolda */ diff --git a/services/src/main/java/org/keycloak/services/resources/admin/UserFederationProvidersResource.java b/services/src/main/java/org/keycloak/services/resources/admin/UserFederationProvidersResource.java index b782462121..36b0b69171 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/UserFederationProvidersResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/UserFederationProvidersResource.java @@ -54,7 +54,6 @@ import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriInfo; - import java.text.MessageFormat; import java.util.ArrayList; import java.util.LinkedList; diff --git a/services/src/main/java/org/keycloak/services/resources/admin/UsersResource.java b/services/src/main/java/org/keycloak/services/resources/admin/UsersResource.java index 4b136591ce..e6d53bceb5 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/UsersResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/UsersResource.java @@ -20,8 +20,9 @@ import org.jboss.resteasy.annotations.cache.NoCache; import org.jboss.resteasy.spi.BadRequestException; import org.jboss.resteasy.spi.NotFoundException; import org.jboss.resteasy.spi.ResteasyProviderFactory; -import org.keycloak.common.ClientConnection; import org.keycloak.authentication.RequiredActionProvider; +import org.keycloak.common.ClientConnection; +import org.keycloak.common.util.Time; import org.keycloak.credential.CredentialModel; import org.keycloak.email.EmailException; import org.keycloak.email.EmailTemplateProvider; @@ -43,6 +44,7 @@ import org.keycloak.models.ModelReadOnlyException; import org.keycloak.models.RealmModel; import org.keycloak.models.UserConsentModel; import org.keycloak.models.UserCredentialModel; +import org.keycloak.models.UserLoginFailureModel; import org.keycloak.models.UserModel; import org.keycloak.models.UserSessionModel; import org.keycloak.models.utils.ModelToRepresentation; @@ -56,13 +58,17 @@ import org.keycloak.representations.idm.GroupRepresentation; import org.keycloak.representations.idm.UserConsentRepresentation; import org.keycloak.representations.idm.UserRepresentation; import org.keycloak.representations.idm.UserSessionRepresentation; -import org.keycloak.services.ErrorResponseException; -import org.keycloak.services.managers.AuthenticationManager; -import org.keycloak.services.managers.ClientSessionCode; -import org.keycloak.services.managers.UserManager; import org.keycloak.services.ErrorResponse; +import org.keycloak.services.ErrorResponseException; import org.keycloak.services.ServicesLogger; import org.keycloak.services.Urls; +import org.keycloak.services.managers.AuthenticationManager; +import org.keycloak.services.managers.BruteForceProtector; +import org.keycloak.services.managers.ClientSessionCode; +import org.keycloak.services.managers.UserManager; +import org.keycloak.services.managers.UserSessionManager; +import org.keycloak.services.resources.AccountService; +import org.keycloak.services.validation.Validation; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; @@ -73,6 +79,7 @@ import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; +import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.Context; import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.MediaType; @@ -80,8 +87,6 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; import javax.ws.rs.core.UriBuilder; import javax.ws.rs.core.UriInfo; -import javax.ws.rs.WebApplicationException; - import java.net.URI; import java.text.MessageFormat; import java.util.ArrayList; @@ -94,14 +99,6 @@ import java.util.Map; import java.util.Properties; import java.util.Set; import java.util.concurrent.TimeUnit; -import org.keycloak.models.UserLoginFailureModel; -import org.keycloak.services.managers.BruteForceProtector; -import org.keycloak.services.managers.UserSessionManager; -import org.keycloak.services.resources.AccountService; -import org.keycloak.common.util.Time; -import org.keycloak.services.validation.Validation; - -import static org.keycloak.events.admin.ResourceType.GROUP_MEMBERSHIP; /** * Base resource for managing users diff --git a/services/src/main/java/org/keycloak/services/resources/admin/info/ServerInfoAdminResource.java b/services/src/main/java/org/keycloak/services/resources/admin/info/ServerInfoAdminResource.java index 638e6570d4..9a87030ab8 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/info/ServerInfoAdminResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/info/ServerInfoAdminResource.java @@ -17,6 +17,45 @@ package org.keycloak.services.resources.admin.info; +import org.keycloak.broker.provider.IdentityProvider; +import org.keycloak.broker.provider.IdentityProviderFactory; +import org.keycloak.broker.social.SocialIdentityProvider; +import org.keycloak.events.EventType; +import org.keycloak.events.admin.OperationType; +import org.keycloak.events.admin.ResourceType; +import org.keycloak.models.KeycloakSession; +import org.keycloak.models.ProtocolMapperModel; +import org.keycloak.models.utils.ModelToRepresentation; +import org.keycloak.policy.PasswordPolicyProvider; +import org.keycloak.policy.PasswordPolicyProviderFactory; +import org.keycloak.protocol.ClientInstallationProvider; +import org.keycloak.protocol.LoginProtocol; +import org.keycloak.protocol.LoginProtocolFactory; +import org.keycloak.protocol.ProtocolMapper; +import org.keycloak.provider.ConfiguredProvider; +import org.keycloak.provider.ProviderConfigProperty; +import org.keycloak.provider.ProviderFactory; +import org.keycloak.provider.ServerInfoAwareProviderFactory; +import org.keycloak.provider.Spi; +import org.keycloak.representations.idm.ComponentTypeRepresentation; +import org.keycloak.representations.idm.ConfigPropertyRepresentation; +import org.keycloak.representations.idm.PasswordPolicyTypeRepresentation; +import org.keycloak.representations.idm.ProtocolMapperRepresentation; +import org.keycloak.representations.idm.ProtocolMapperTypeRepresentation; +import org.keycloak.representations.info.ClientInstallationRepresentation; +import org.keycloak.representations.info.MemoryInfoRepresentation; +import org.keycloak.representations.info.ProfileInfoRepresentation; +import org.keycloak.representations.info.ProviderRepresentation; +import org.keycloak.representations.info.ServerInfoRepresentation; +import org.keycloak.representations.info.SpiInfoRepresentation; +import org.keycloak.representations.info.SystemInfoRepresentation; +import org.keycloak.representations.info.ThemeInfoRepresentation; +import org.keycloak.theme.Theme; +import org.keycloak.theme.ThemeProvider; + +import javax.ws.rs.GET; +import javax.ws.rs.WebApplicationException; +import javax.ws.rs.core.Context; import java.io.IOException; import java.util.Collections; import java.util.Comparator; @@ -25,45 +64,6 @@ import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; -import java.util.ServiceLoader; - -import javax.ws.rs.GET; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.Context; - -import org.keycloak.broker.provider.IdentityProvider; -import org.keycloak.broker.provider.IdentityProviderFactory; -import org.keycloak.common.util.MultivaluedHashMap; -import org.keycloak.events.EventType; -import org.keycloak.events.admin.OperationType; -import org.keycloak.events.admin.ResourceType; -import org.keycloak.models.PasswordPolicy; -import org.keycloak.policy.PasswordPolicyProvider; -import org.keycloak.policy.PasswordPolicyProviderFactory; -import org.keycloak.provider.*; -import org.keycloak.representations.idm.ComponentTypeRepresentation; -import org.keycloak.representations.idm.PasswordPolicyTypeRepresentation; -import org.keycloak.representations.info.ProfileInfoRepresentation; -import org.keycloak.theme.Theme; -import org.keycloak.theme.ThemeProvider; -import org.keycloak.models.KeycloakSession; -import org.keycloak.models.ProtocolMapperModel; -import org.keycloak.models.utils.ModelToRepresentation; -import org.keycloak.protocol.ClientInstallationProvider; -import org.keycloak.protocol.LoginProtocol; -import org.keycloak.protocol.LoginProtocolFactory; -import org.keycloak.protocol.ProtocolMapper; -import org.keycloak.representations.idm.ConfigPropertyRepresentation; -import org.keycloak.representations.idm.ProtocolMapperRepresentation; -import org.keycloak.representations.idm.ProtocolMapperTypeRepresentation; -import org.keycloak.broker.social.SocialIdentityProvider; -import org.keycloak.representations.info.ClientInstallationRepresentation; -import org.keycloak.representations.info.MemoryInfoRepresentation; -import org.keycloak.representations.info.ProviderRepresentation; -import org.keycloak.representations.info.ServerInfoRepresentation; -import org.keycloak.representations.info.SpiInfoRepresentation; -import org.keycloak.representations.info.SystemInfoRepresentation; -import org.keycloak.representations.info.ThemeInfoRepresentation; /** * @author Stian Thorgersen diff --git a/services/src/main/java/org/keycloak/services/scheduled/ClusterAwareScheduledTaskRunner.java b/services/src/main/java/org/keycloak/services/scheduled/ClusterAwareScheduledTaskRunner.java index b2a8bf7d15..da9c87670c 100644 --- a/services/src/main/java/org/keycloak/services/scheduled/ClusterAwareScheduledTaskRunner.java +++ b/services/src/main/java/org/keycloak/services/scheduled/ClusterAwareScheduledTaskRunner.java @@ -17,14 +17,14 @@ package org.keycloak.services.scheduled; -import java.util.concurrent.Callable; - import org.keycloak.cluster.ClusterProvider; import org.keycloak.cluster.ExecutionResult; import org.keycloak.models.KeycloakSession; import org.keycloak.models.KeycloakSessionFactory; import org.keycloak.timer.ScheduledTask; +import java.util.concurrent.Callable; + /** * Ensures that there are not concurrent executions of same task (either on this host or any other cluster host) * diff --git a/services/src/main/java/org/keycloak/services/util/CertificateInfoHelper.java b/services/src/main/java/org/keycloak/services/util/CertificateInfoHelper.java index 359d28d84b..313ce1d4c8 100644 --- a/services/src/main/java/org/keycloak/services/util/CertificateInfoHelper.java +++ b/services/src/main/java/org/keycloak/services/util/CertificateInfoHelper.java @@ -17,21 +17,16 @@ package org.keycloak.services.util; -import java.security.PublicKey; -import java.security.cert.X509Certificate; -import java.util.HashMap; - -import javax.ws.rs.core.Response; - -import org.keycloak.authentication.AuthenticationFlowError; -import org.keycloak.authentication.ClientAuthenticationFlowContext; -import org.keycloak.authentication.authenticators.client.ClientAuthUtil; import org.keycloak.models.ClientModel; import org.keycloak.models.ModelException; import org.keycloak.models.utils.KeycloakModelUtils; import org.keycloak.representations.idm.CertificateRepresentation; import org.keycloak.representations.idm.ClientRepresentation; +import java.security.PublicKey; +import java.security.cert.X509Certificate; +import java.util.HashMap; + /** * @author Marek Posolda */ diff --git a/services/src/main/java/org/keycloak/services/validation/Validation.java b/services/src/main/java/org/keycloak/services/validation/Validation.java index eacfa8fc19..fbd18af399 100755 --- a/services/src/main/java/org/keycloak/services/validation/Validation.java +++ b/services/src/main/java/org/keycloak/services/validation/Validation.java @@ -28,7 +28,6 @@ import org.keycloak.representations.idm.CredentialRepresentation; import org.keycloak.services.messages.Messages; import javax.ws.rs.core.MultivaluedMap; - import java.util.ArrayList; import java.util.List; import java.util.regex.Pattern; diff --git a/services/src/main/java/org/keycloak/services/validation/ValidationMessages.java b/services/src/main/java/org/keycloak/services/validation/ValidationMessages.java index a7e82c8601..82db3742c2 100644 --- a/services/src/main/java/org/keycloak/services/validation/ValidationMessages.java +++ b/services/src/main/java/org/keycloak/services/validation/ValidationMessages.java @@ -19,7 +19,10 @@ package org.keycloak.services.validation; -import java.util.*; +import java.util.Collections; +import java.util.LinkedHashSet; +import java.util.Properties; +import java.util.Set; import java.util.function.Function; import java.util.stream.Collectors; diff --git a/services/src/main/java/org/keycloak/social/facebook/FacebookIdentityProviderFactory.java b/services/src/main/java/org/keycloak/social/facebook/FacebookIdentityProviderFactory.java index 08a088bc87..70bcd91002 100755 --- a/services/src/main/java/org/keycloak/social/facebook/FacebookIdentityProviderFactory.java +++ b/services/src/main/java/org/keycloak/social/facebook/FacebookIdentityProviderFactory.java @@ -18,8 +18,8 @@ package org.keycloak.social.facebook; import org.keycloak.broker.oidc.OAuth2IdentityProviderConfig; import org.keycloak.broker.provider.AbstractIdentityProviderFactory; -import org.keycloak.models.IdentityProviderModel; import org.keycloak.broker.social.SocialIdentityProviderFactory; +import org.keycloak.models.IdentityProviderModel; /** * @author Pedro Igor diff --git a/services/src/main/java/org/keycloak/social/github/GitHubIdentityProviderFactory.java b/services/src/main/java/org/keycloak/social/github/GitHubIdentityProviderFactory.java index fd21036ea2..e305959c90 100755 --- a/services/src/main/java/org/keycloak/social/github/GitHubIdentityProviderFactory.java +++ b/services/src/main/java/org/keycloak/social/github/GitHubIdentityProviderFactory.java @@ -18,8 +18,8 @@ package org.keycloak.social.github; import org.keycloak.broker.oidc.OAuth2IdentityProviderConfig; import org.keycloak.broker.provider.AbstractIdentityProviderFactory; -import org.keycloak.models.IdentityProviderModel; import org.keycloak.broker.social.SocialIdentityProviderFactory; +import org.keycloak.models.IdentityProviderModel; /** * @author Pedro Igor diff --git a/services/src/main/java/org/keycloak/social/google/GoogleIdentityProviderFactory.java b/services/src/main/java/org/keycloak/social/google/GoogleIdentityProviderFactory.java index aac25f8c72..0dfbfe3583 100755 --- a/services/src/main/java/org/keycloak/social/google/GoogleIdentityProviderFactory.java +++ b/services/src/main/java/org/keycloak/social/google/GoogleIdentityProviderFactory.java @@ -18,8 +18,8 @@ package org.keycloak.social.google; import org.keycloak.broker.oidc.OIDCIdentityProviderConfig; import org.keycloak.broker.provider.AbstractIdentityProviderFactory; -import org.keycloak.models.IdentityProviderModel; import org.keycloak.broker.social.SocialIdentityProviderFactory; +import org.keycloak.models.IdentityProviderModel; /** * @author Pedro Igor diff --git a/services/src/main/java/org/keycloak/social/linkedin/LinkedInIdentityProvider.java b/services/src/main/java/org/keycloak/social/linkedin/LinkedInIdentityProvider.java index 2fc075cf11..3327858486 100755 --- a/services/src/main/java/org/keycloak/social/linkedin/LinkedInIdentityProvider.java +++ b/services/src/main/java/org/keycloak/social/linkedin/LinkedInIdentityProvider.java @@ -16,10 +16,6 @@ */ package org.keycloak.social.linkedin; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLDecoder; - import com.fasterxml.jackson.databind.JsonNode; import org.jboss.logging.Logger; import org.keycloak.broker.oidc.AbstractOAuth2IdentityProvider; @@ -31,6 +27,10 @@ import org.keycloak.broker.provider.IdentityBrokerException; import org.keycloak.broker.provider.util.SimpleHttp; import org.keycloak.broker.social.SocialIdentityProvider; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLDecoder; + /** * LinkedIn social provider. See https://developer.linkedin.com/docs/oauth2 * diff --git a/services/src/main/java/org/keycloak/social/linkedin/LinkedInIdentityProviderFactory.java b/services/src/main/java/org/keycloak/social/linkedin/LinkedInIdentityProviderFactory.java index a80db20a68..7dafa33e30 100755 --- a/services/src/main/java/org/keycloak/social/linkedin/LinkedInIdentityProviderFactory.java +++ b/services/src/main/java/org/keycloak/social/linkedin/LinkedInIdentityProviderFactory.java @@ -18,8 +18,8 @@ package org.keycloak.social.linkedin; import org.keycloak.broker.oidc.OAuth2IdentityProviderConfig; import org.keycloak.broker.provider.AbstractIdentityProviderFactory; -import org.keycloak.models.IdentityProviderModel; import org.keycloak.broker.social.SocialIdentityProviderFactory; +import org.keycloak.models.IdentityProviderModel; /** * @author Vlastimil Elias (velias at redhat dot com) diff --git a/services/src/main/java/org/keycloak/social/microsoft/MicrosoftIdentityProvider.java b/services/src/main/java/org/keycloak/social/microsoft/MicrosoftIdentityProvider.java index ed58da10ca..7702738846 100755 --- a/services/src/main/java/org/keycloak/social/microsoft/MicrosoftIdentityProvider.java +++ b/services/src/main/java/org/keycloak/social/microsoft/MicrosoftIdentityProvider.java @@ -17,8 +17,7 @@ package org.keycloak.social.microsoft; -import java.net.URLEncoder; - +import com.fasterxml.jackson.databind.JsonNode; import org.jboss.logging.Logger; import org.keycloak.broker.oidc.AbstractOAuth2IdentityProvider; import org.keycloak.broker.oidc.OAuth2IdentityProviderConfig; @@ -29,7 +28,7 @@ import org.keycloak.broker.provider.IdentityBrokerException; import org.keycloak.broker.provider.util.SimpleHttp; import org.keycloak.broker.social.SocialIdentityProvider; -import com.fasterxml.jackson.databind.JsonNode; +import java.net.URLEncoder; /** * diff --git a/services/src/main/java/org/keycloak/social/stackoverflow/StackoverflowIdentityProvider.java b/services/src/main/java/org/keycloak/social/stackoverflow/StackoverflowIdentityProvider.java index 53f620c661..130a8f3fd3 100755 --- a/services/src/main/java/org/keycloak/social/stackoverflow/StackoverflowIdentityProvider.java +++ b/services/src/main/java/org/keycloak/social/stackoverflow/StackoverflowIdentityProvider.java @@ -16,12 +16,6 @@ */ package org.keycloak.social.stackoverflow; -import java.io.StringWriter; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLDecoder; -import java.util.HashMap; - import com.fasterxml.jackson.databind.JsonNode; import org.jboss.logging.Logger; import org.keycloak.broker.oidc.AbstractOAuth2IdentityProvider; @@ -32,6 +26,12 @@ import org.keycloak.broker.provider.IdentityBrokerException; import org.keycloak.broker.provider.util.SimpleHttp; import org.keycloak.broker.social.SocialIdentityProvider; +import java.io.StringWriter; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLDecoder; +import java.util.HashMap; + /** * Stackoverflow social provider. See https://api.stackexchange.com/docs/authentication * diff --git a/services/src/main/java/org/keycloak/social/stackoverflow/StackoverflowIdentityProviderFactory.java b/services/src/main/java/org/keycloak/social/stackoverflow/StackoverflowIdentityProviderFactory.java index 60a0a6611d..a0f6cf5ef0 100755 --- a/services/src/main/java/org/keycloak/social/stackoverflow/StackoverflowIdentityProviderFactory.java +++ b/services/src/main/java/org/keycloak/social/stackoverflow/StackoverflowIdentityProviderFactory.java @@ -17,8 +17,8 @@ package org.keycloak.social.stackoverflow; import org.keycloak.broker.provider.AbstractIdentityProviderFactory; -import org.keycloak.models.IdentityProviderModel; import org.keycloak.broker.social.SocialIdentityProviderFactory; +import org.keycloak.models.IdentityProviderModel; /** * @author Vlastimil Elias (velias at redhat dot com) diff --git a/services/src/main/java/org/keycloak/social/twitter/TwitterIdentityProvider.java b/services/src/main/java/org/keycloak/social/twitter/TwitterIdentityProvider.java index d4f74cd9d8..630f832a05 100755 --- a/services/src/main/java/org/keycloak/social/twitter/TwitterIdentityProvider.java +++ b/services/src/main/java/org/keycloak/social/twitter/TwitterIdentityProvider.java @@ -17,12 +17,13 @@ package org.keycloak.social.twitter; import org.jboss.logging.Logger; -import org.keycloak.common.ClientConnection; import org.keycloak.broker.oidc.OAuth2IdentityProviderConfig; import org.keycloak.broker.provider.AbstractIdentityProvider; import org.keycloak.broker.provider.AuthenticationRequest; import org.keycloak.broker.provider.BrokeredIdentityContext; import org.keycloak.broker.provider.IdentityBrokerException; +import org.keycloak.broker.social.SocialIdentityProvider; +import org.keycloak.common.ClientConnection; import org.keycloak.events.EventBuilder; import org.keycloak.events.EventType; import org.keycloak.models.ClientModel; @@ -30,10 +31,9 @@ import org.keycloak.models.ClientSessionModel; import org.keycloak.models.FederatedIdentityModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; +import org.keycloak.services.ErrorPage; import org.keycloak.services.managers.ClientSessionCode; import org.keycloak.services.messages.Messages; -import org.keycloak.services.ErrorPage; -import org.keycloak.broker.social.SocialIdentityProvider; import twitter4j.Twitter; import twitter4j.TwitterFactory; import twitter4j.auth.AccessToken; diff --git a/services/src/main/java/org/keycloak/social/twitter/TwitterIdentityProviderFactory.java b/services/src/main/java/org/keycloak/social/twitter/TwitterIdentityProviderFactory.java index 0916a8ccc0..1e0504d79d 100755 --- a/services/src/main/java/org/keycloak/social/twitter/TwitterIdentityProviderFactory.java +++ b/services/src/main/java/org/keycloak/social/twitter/TwitterIdentityProviderFactory.java @@ -18,8 +18,8 @@ package org.keycloak.social.twitter; import org.keycloak.broker.oidc.OAuth2IdentityProviderConfig; import org.keycloak.broker.provider.AbstractIdentityProviderFactory; -import org.keycloak.models.IdentityProviderModel; import org.keycloak.broker.social.SocialIdentityProviderFactory; +import org.keycloak.models.IdentityProviderModel; /** * @author Pedro Igor diff --git a/services/src/main/java/org/keycloak/storage/UserStorageManager.java b/services/src/main/java/org/keycloak/storage/UserStorageManager.java index 8da231ede5..a03682c583 100755 --- a/services/src/main/java/org/keycloak/storage/UserStorageManager.java +++ b/services/src/main/java/org/keycloak/storage/UserStorageManager.java @@ -30,19 +30,18 @@ import org.keycloak.models.ProtocolMapperModel; import org.keycloak.models.RealmModel; import org.keycloak.models.RoleModel; import org.keycloak.models.UserConsentModel; -import org.keycloak.models.cache.CachedUserModel; -import org.keycloak.models.cache.OnUserCache; -import org.keycloak.storage.user.UserCredentialAuthenticationProvider; import org.keycloak.models.UserCredentialModel; import org.keycloak.models.UserFederationProviderModel; -import org.keycloak.storage.user.UserLookupProvider; import org.keycloak.models.UserModel; import org.keycloak.models.UserProvider; +import org.keycloak.models.cache.CachedUserModel; +import org.keycloak.models.cache.OnUserCache; +import org.keycloak.storage.federated.UserFederatedStorageProvider; +import org.keycloak.storage.user.UserCredentialAuthenticationProvider; +import org.keycloak.storage.user.UserLookupProvider; import org.keycloak.storage.user.UserQueryProvider; import org.keycloak.storage.user.UserRegistrationProvider; -import org.keycloak.storage.federated.UserFederatedStorageProvider; -import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.Iterator; diff --git a/services/src/main/java/org/keycloak/theme/ExtendingThemeManager.java b/services/src/main/java/org/keycloak/theme/ExtendingThemeManager.java index f1912705b7..3aa6cdc791 100755 --- a/services/src/main/java/org/keycloak/theme/ExtendingThemeManager.java +++ b/services/src/main/java/org/keycloak/theme/ExtendingThemeManager.java @@ -25,7 +25,15 @@ import org.keycloak.models.KeycloakSession; import java.io.IOException; import java.io.InputStream; import java.net.URL; -import java.util.*; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.ListIterator; +import java.util.Locale; +import java.util.Properties; +import java.util.Set; import java.util.concurrent.ConcurrentHashMap; /** diff --git a/services/src/main/java/org/keycloak/theme/PropertiesUtil.java b/services/src/main/java/org/keycloak/theme/PropertiesUtil.java index 18387f7f5c..a0eab0bb81 100644 --- a/services/src/main/java/org/keycloak/theme/PropertiesUtil.java +++ b/services/src/main/java/org/keycloak/theme/PropertiesUtil.java @@ -17,6 +17,8 @@ package org.keycloak.theme; +import org.jboss.logging.Logger; + import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; @@ -25,8 +27,6 @@ import java.nio.charset.Charset; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.jboss.logging.Logger; - /** * @author Hiroyuki Wada */ diff --git a/services/src/main/java/org/keycloak/transaction/JtaRegistration.java b/services/src/main/java/org/keycloak/transaction/JtaRegistration.java index 1800c52c47..88e9659f34 100644 --- a/services/src/main/java/org/keycloak/transaction/JtaRegistration.java +++ b/services/src/main/java/org/keycloak/transaction/JtaRegistration.java @@ -17,10 +17,7 @@ package org.keycloak.transaction; import org.keycloak.models.KeycloakSession; -import org.keycloak.services.ServicesLogger; -import javax.naming.InitialContext; -import javax.naming.NamingException; import javax.transaction.TransactionManager; /** diff --git a/services/src/main/java/org/keycloak/transaction/JtaTransactionWrapper.java b/services/src/main/java/org/keycloak/transaction/JtaTransactionWrapper.java index e387ff4599..98f4fa8eef 100644 --- a/services/src/main/java/org/keycloak/transaction/JtaTransactionWrapper.java +++ b/services/src/main/java/org/keycloak/transaction/JtaTransactionWrapper.java @@ -18,15 +18,10 @@ package org.keycloak.transaction; import org.jboss.logging.Logger; import org.keycloak.models.KeycloakTransaction; -import org.keycloak.storage.UserStorageManager; -import javax.transaction.InvalidTransactionException; -import javax.transaction.NotSupportedException; import javax.transaction.Status; -import javax.transaction.SystemException; import javax.transaction.Transaction; import javax.transaction.TransactionManager; -import javax.transaction.UserTransaction; /** * @author Bill Burke diff --git a/services/src/main/java/org/keycloak/transaction/UserTransactionWrapper.java b/services/src/main/java/org/keycloak/transaction/UserTransactionWrapper.java index c838b188c4..52bb9138b9 100644 --- a/services/src/main/java/org/keycloak/transaction/UserTransactionWrapper.java +++ b/services/src/main/java/org/keycloak/transaction/UserTransactionWrapper.java @@ -18,12 +18,7 @@ package org.keycloak.transaction; import org.keycloak.models.KeycloakTransaction; -import javax.transaction.HeuristicMixedException; -import javax.transaction.HeuristicRollbackException; -import javax.transaction.NotSupportedException; -import javax.transaction.RollbackException; import javax.transaction.Status; -import javax.transaction.SystemException; import javax.transaction.UserTransaction; /** diff --git a/services/src/main/java/org/keycloak/truststore/FileTruststoreProvider.java b/services/src/main/java/org/keycloak/truststore/FileTruststoreProvider.java index d5f2a6d55f..e8d6f02944 100755 --- a/services/src/main/java/org/keycloak/truststore/FileTruststoreProvider.java +++ b/services/src/main/java/org/keycloak/truststore/FileTruststoreProvider.java @@ -17,9 +17,6 @@ package org.keycloak.truststore; -import org.keycloak.truststore.HostnameVerificationPolicy; -import org.keycloak.truststore.TruststoreProvider; - import java.security.KeyStore; /** diff --git a/services/src/main/java/org/keycloak/truststore/JSSETruststoreConfigurator.java b/services/src/main/java/org/keycloak/truststore/JSSETruststoreConfigurator.java index a2c4d3730c..d36539bcc5 100755 --- a/services/src/main/java/org/keycloak/truststore/JSSETruststoreConfigurator.java +++ b/services/src/main/java/org/keycloak/truststore/JSSETruststoreConfigurator.java @@ -21,9 +21,6 @@ import org.apache.http.conn.ssl.BrowserCompatHostnameVerifier; import org.apache.http.conn.ssl.StrictHostnameVerifier; import org.keycloak.models.KeycloakSession; import org.keycloak.models.KeycloakSessionFactory; -import org.keycloak.truststore.HostnameVerificationPolicy; -import org.keycloak.truststore.TruststoreProvider; -import org.keycloak.truststore.TruststoreProviderFactory; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.SSLContext; diff --git a/services/src/main/java/org/keycloak/truststore/TruststoreProviderSingleton.java b/services/src/main/java/org/keycloak/truststore/TruststoreProviderSingleton.java index 6451db1065..a78f7e637d 100755 --- a/services/src/main/java/org/keycloak/truststore/TruststoreProviderSingleton.java +++ b/services/src/main/java/org/keycloak/truststore/TruststoreProviderSingleton.java @@ -17,8 +17,6 @@ package org.keycloak.truststore; -import org.keycloak.truststore.TruststoreProvider; - /** * @author Marko Strukelj */ diff --git a/services/src/main/java/org/keycloak/utils/TotpUtils.java b/services/src/main/java/org/keycloak/utils/TotpUtils.java index f9f3b60d3a..67ff6979bf 100644 --- a/services/src/main/java/org/keycloak/utils/TotpUtils.java +++ b/services/src/main/java/org/keycloak/utils/TotpUtils.java @@ -27,7 +27,6 @@ import org.keycloak.models.UserModel; import org.keycloak.models.utils.Base32; import java.io.ByteArrayOutputStream; -import java.net.URLEncoder; /** * @author Stian Thorgersen diff --git a/services/src/main/resources/idp-metadata-template.xml b/services/src/main/resources/idp-metadata-template.xml index 6b3d5ec34d..0a536478f6 100755 --- a/services/src/main/resources/idp-metadata-template.xml +++ b/services/src/main/resources/idp-metadata-template.xml @@ -17,8 +17,8 @@ --> + xmlns="urn:oasis:names:tc:SAML:2.0:metadata" + xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"> diff --git a/services/src/test/java/org/keycloak/test/ResponseTypeTest.java b/services/src/test/java/org/keycloak/test/ResponseTypeTest.java index 477746a6ec..3bab4fdf7b 100644 --- a/services/src/test/java/org/keycloak/test/ResponseTypeTest.java +++ b/services/src/test/java/org/keycloak/test/ResponseTypeTest.java @@ -17,13 +17,13 @@ package org.keycloak.test; -import java.util.Arrays; -import java.util.Collections; - import org.junit.Assert; import org.junit.Test; import org.keycloak.protocol.oidc.utils.OIDCResponseType; +import java.util.Arrays; +import java.util.Collections; + /** * @author Marek Posolda */ diff --git a/services/src/test/java/org/keycloak/test/broker/oidc/mappers/AbstractJsonUserAttributeMapperTest.java b/services/src/test/java/org/keycloak/test/broker/oidc/mappers/AbstractJsonUserAttributeMapperTest.java index 538511eb87..24c4cebcd6 100755 --- a/services/src/test/java/org/keycloak/test/broker/oidc/mappers/AbstractJsonUserAttributeMapperTest.java +++ b/services/src/test/java/org/keycloak/test/broker/oidc/mappers/AbstractJsonUserAttributeMapperTest.java @@ -16,8 +16,6 @@ */ package org.keycloak.test.broker.oidc.mappers; -import java.io.IOException; - import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; @@ -25,6 +23,8 @@ import org.junit.Assert; import org.junit.Test; import org.keycloak.broker.oidc.mappers.AbstractJsonUserAttributeMapper; +import java.io.IOException; + /** * Unit test for {@link org.keycloak.broker.oidc.mappers.AbstractJsonUserAttributeMapper} * diff --git a/services/src/test/java/org/keycloak/theme/PropertiesUtilTest.java b/services/src/test/java/org/keycloak/theme/PropertiesUtilTest.java index 7e736145d4..9564155eea 100644 --- a/services/src/test/java/org/keycloak/theme/PropertiesUtilTest.java +++ b/services/src/test/java/org/keycloak/theme/PropertiesUtilTest.java @@ -17,12 +17,12 @@ package org.keycloak.theme; -import static org.junit.Assert.assertEquals; +import org.junit.Test; import java.io.ByteArrayInputStream; import java.nio.charset.Charset; -import org.junit.Test; +import static org.junit.Assert.assertEquals; /** * @author Hiroyuki Wada diff --git a/testsuite/integration-arquillian/servers/auth-server/jboss/common/ispn-cache-owners.xsl b/testsuite/integration-arquillian/servers/auth-server/jboss/common/ispn-cache-owners.xsl index 7237d89868..65abfea2d9 100644 --- a/testsuite/integration-arquillian/servers/auth-server/jboss/common/ispn-cache-owners.xsl +++ b/testsuite/integration-arquillian/servers/auth-server/jboss/common/ispn-cache-owners.xsl @@ -1,6 +1,5 @@ diff --git a/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/authorization/TestPolicyProviderFactory.java b/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/authorization/TestPolicyProviderFactory.java index 9382f20c16..1fa5fc737a 100644 --- a/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/authorization/TestPolicyProviderFactory.java +++ b/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/authorization/TestPolicyProviderFactory.java @@ -27,8 +27,6 @@ import org.keycloak.authorization.policy.provider.PolicyProviderFactory; import org.keycloak.models.KeycloakSession; import org.keycloak.models.KeycloakSessionFactory; -import static org.bouncycastle.asn1.x500.style.RFC4519Style.l; - /** * @author Pedro Igor */ diff --git a/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/domainextension/jpa/ExampleJpaEntityProvider.java b/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/domainextension/jpa/ExampleJpaEntityProvider.java index 2f876329c9..37d0575a95 100644 --- a/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/domainextension/jpa/ExampleJpaEntityProvider.java +++ b/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/domainextension/jpa/ExampleJpaEntityProvider.java @@ -17,11 +17,11 @@ package org.keycloak.testsuite.domainextension.jpa; +import org.keycloak.connections.jpa.entityprovider.JpaEntityProvider; + import java.util.Collections; import java.util.List; -import org.keycloak.connections.jpa.entityprovider.JpaEntityProvider; - /** * @author Erik Mulder * diff --git a/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/domainextension/rest/CompanyResource.java b/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/domainextension/rest/CompanyResource.java index 197cbce382..c26c71f837 100644 --- a/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/domainextension/rest/CompanyResource.java +++ b/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/domainextension/rest/CompanyResource.java @@ -17,7 +17,10 @@ package org.keycloak.testsuite.domainextension.rest; -import java.util.List; +import org.jboss.resteasy.annotations.cache.NoCache; +import org.keycloak.models.KeycloakSession; +import org.keycloak.testsuite.domainextension.CompanyRepresentation; +import org.keycloak.testsuite.domainextension.spi.ExampleService; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; @@ -28,11 +31,7 @@ import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; - -import org.jboss.resteasy.annotations.cache.NoCache; -import org.keycloak.models.KeycloakSession; -import org.keycloak.testsuite.domainextension.CompanyRepresentation; -import org.keycloak.testsuite.domainextension.spi.ExampleService; +import java.util.List; public class CompanyResource { diff --git a/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/domainextension/rest/ExampleRestResource.java b/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/domainextension/rest/ExampleRestResource.java index 629acc892c..90328842ba 100644 --- a/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/domainextension/rest/ExampleRestResource.java +++ b/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/domainextension/rest/ExampleRestResource.java @@ -17,14 +17,14 @@ package org.keycloak.testsuite.domainextension.rest; -import javax.ws.rs.ForbiddenException; -import javax.ws.rs.NotAuthorizedException; -import javax.ws.rs.Path; - import org.keycloak.models.KeycloakSession; import org.keycloak.services.managers.AppAuthManager; import org.keycloak.services.managers.AuthenticationManager; +import javax.ws.rs.ForbiddenException; +import javax.ws.rs.NotAuthorizedException; +import javax.ws.rs.Path; + public class ExampleRestResource { private final KeycloakSession session; diff --git a/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/domainextension/spi/ExampleService.java b/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/domainextension/spi/ExampleService.java index dd47d96ebf..b17fba99a0 100644 --- a/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/domainextension/spi/ExampleService.java +++ b/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/domainextension/spi/ExampleService.java @@ -17,11 +17,11 @@ package org.keycloak.testsuite.domainextension.spi; -import java.util.List; - import org.keycloak.provider.Provider; import org.keycloak.testsuite.domainextension.CompanyRepresentation; +import java.util.List; + public interface ExampleService extends Provider { List listCompanies(); diff --git a/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/domainextension/spi/impl/ExampleServiceImpl.java b/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/domainextension/spi/impl/ExampleServiceImpl.java index 213f7e54c2..6ffaa5872e 100644 --- a/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/domainextension/spi/impl/ExampleServiceImpl.java +++ b/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/domainextension/spi/impl/ExampleServiceImpl.java @@ -17,11 +17,6 @@ package org.keycloak.testsuite.domainextension.spi.impl; -import java.util.LinkedList; -import java.util.List; - -import javax.persistence.EntityManager; - import org.keycloak.connections.jpa.JpaConnectionProvider; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; @@ -30,6 +25,10 @@ import org.keycloak.testsuite.domainextension.CompanyRepresentation; import org.keycloak.testsuite.domainextension.jpa.Company; import org.keycloak.testsuite.domainextension.spi.ExampleService; +import javax.persistence.EntityManager; +import java.util.LinkedList; +import java.util.List; + public class ExampleServiceImpl implements ExampleService { private final KeycloakSession session; diff --git a/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/federation/DummyConfigurableUserFederationProviderFactory.java b/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/federation/DummyConfigurableUserFederationProviderFactory.java index ec63c89aff..f3d701db1e 100644 --- a/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/federation/DummyConfigurableUserFederationProviderFactory.java +++ b/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/federation/DummyConfigurableUserFederationProviderFactory.java @@ -17,12 +17,12 @@ package org.keycloak.testsuite.federation; -import java.util.Arrays; -import java.util.List; - import org.keycloak.provider.ConfiguredProvider; import org.keycloak.provider.ProviderConfigProperty; +import java.util.Arrays; +import java.util.List; + /** * @author Marek Posolda */ diff --git a/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/federation/DummyUserFederationMapper.java b/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/federation/DummyUserFederationMapper.java index 214c488b52..d12a1cfb42 100644 --- a/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/federation/DummyUserFederationMapper.java +++ b/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/federation/DummyUserFederationMapper.java @@ -17,10 +17,6 @@ package org.keycloak.testsuite.federation; -import java.util.Collections; -import java.util.List; -import java.util.Map; - import org.keycloak.Config; import org.keycloak.mappers.FederationConfigValidationException; import org.keycloak.mappers.UserFederationMapper; @@ -37,6 +33,10 @@ import org.keycloak.models.UserModel; import org.keycloak.provider.ProviderConfigProperty; import org.keycloak.representations.idm.UserFederationMapperSyncConfigRepresentation; +import java.util.Collections; +import java.util.List; +import java.util.Map; + /** * @author Marek Posolda */ diff --git a/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/federation/DummyUserFederationProvider.java b/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/federation/DummyUserFederationProvider.java index 5a8b6d41fe..58493d04af 100644 --- a/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/federation/DummyUserFederationProvider.java +++ b/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/federation/DummyUserFederationProvider.java @@ -27,7 +27,6 @@ import org.keycloak.models.UserCredentialModel; import org.keycloak.models.UserFederationProvider; import org.keycloak.models.UserModel; -import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Map; diff --git a/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/federation/DummyUserFederationProviderFactory.java b/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/federation/DummyUserFederationProviderFactory.java index 8bb9e11c2f..df339a9b4f 100644 --- a/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/federation/DummyUserFederationProviderFactory.java +++ b/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/federation/DummyUserFederationProviderFactory.java @@ -26,10 +26,12 @@ import org.keycloak.models.UserFederationProviderFactory; import org.keycloak.models.UserFederationProviderModel; import org.keycloak.models.UserFederationSyncResult; import org.keycloak.models.UserModel; -import org.keycloak.provider.ConfiguredProvider; -import org.keycloak.provider.ProviderConfigProperty; -import java.util.*; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; import java.util.concurrent.atomic.AtomicInteger; /** diff --git a/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/forms/PassThroughAuthenticator.java b/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/forms/PassThroughAuthenticator.java index 0d936271f5..930cb6aa55 100644 --- a/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/forms/PassThroughAuthenticator.java +++ b/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/forms/PassThroughAuthenticator.java @@ -18,8 +18,8 @@ package org.keycloak.testsuite.forms; import org.keycloak.Config; -import org.keycloak.authentication.AuthenticationFlowError; import org.keycloak.authentication.AuthenticationFlowContext; +import org.keycloak.authentication.AuthenticationFlowError; import org.keycloak.authentication.Authenticator; import org.keycloak.authentication.AuthenticatorFactory; import org.keycloak.models.AuthenticationExecutionModel; diff --git a/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/forms/PassThroughClientAuthenticator.java b/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/forms/PassThroughClientAuthenticator.java index 83ee5044eb..b5efe239ff 100755 --- a/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/forms/PassThroughClientAuthenticator.java +++ b/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/forms/PassThroughClientAuthenticator.java @@ -17,6 +17,13 @@ package org.keycloak.testsuite.forms; +import org.keycloak.authentication.AuthenticationFlowError; +import org.keycloak.authentication.ClientAuthenticationFlowContext; +import org.keycloak.authentication.authenticators.client.AbstractClientAuthenticator; +import org.keycloak.models.AuthenticationExecutionModel; +import org.keycloak.models.ClientModel; +import org.keycloak.provider.ProviderConfigProperty; + import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -25,13 +32,6 @@ import java.util.List; import java.util.Map; import java.util.Set; -import org.keycloak.authentication.AuthenticationFlowError; -import org.keycloak.authentication.ClientAuthenticationFlowContext; -import org.keycloak.authentication.authenticators.client.AbstractClientAuthenticator; -import org.keycloak.models.AuthenticationExecutionModel; -import org.keycloak.models.ClientModel; -import org.keycloak.provider.ProviderConfigProperty; - /** * @author Marek Posolda */ diff --git a/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/rest/TestApplicationResourceProvider.java b/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/rest/TestApplicationResourceProvider.java index 5f392a0bc4..2ec15520f2 100644 --- a/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/rest/TestApplicationResourceProvider.java +++ b/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/rest/TestApplicationResourceProvider.java @@ -27,7 +27,6 @@ import org.keycloak.representations.adapters.action.PushNotBeforeAction; import org.keycloak.representations.adapters.action.TestAvailabilityAction; import org.keycloak.services.resource.RealmResourceProvider; import org.keycloak.services.resources.RealmsResource; -import org.keycloak.testsuite.rest.resource.TestingExportImportResource; import org.keycloak.testsuite.rest.resource.TestingOIDCEndpointsApplicationResource; import javax.ws.rs.Consumes; @@ -40,7 +39,6 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriBuilder; - import java.util.concurrent.BlockingQueue; import java.util.concurrent.TimeUnit; diff --git a/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/rest/TestingResourceProvider.java b/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/rest/TestingResourceProvider.java index 007f3a7bdf..4cbf4e7c77 100644 --- a/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/rest/TestingResourceProvider.java +++ b/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/rest/TestingResourceProvider.java @@ -17,28 +17,38 @@ package org.keycloak.testsuite.rest; -import java.io.File; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; import org.infinispan.Cache; -import org.keycloak.OAuth2Constants; +import org.jboss.resteasy.annotations.cache.NoCache; +import org.jboss.resteasy.spi.BadRequestException; import org.keycloak.common.util.Time; import org.keycloak.connections.infinispan.InfinispanConnectionProvider; import org.keycloak.events.Event; +import org.keycloak.events.EventQuery; +import org.keycloak.events.EventStoreProvider; +import org.keycloak.events.EventType; import org.keycloak.events.admin.AdminEvent; +import org.keycloak.events.admin.AdminEventQuery; +import org.keycloak.events.admin.AuthDetails; +import org.keycloak.events.admin.OperationType; import org.keycloak.events.admin.ResourceType; -import org.keycloak.jose.jws.Algorithm; -import org.keycloak.jose.jws.JWSBuilder; +import org.keycloak.models.AuthenticationFlowModel; +import org.keycloak.models.ClientModel; +import org.keycloak.models.FederatedIdentityModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; +import org.keycloak.models.RealmProvider; +import org.keycloak.models.UserCredentialModel; +import org.keycloak.models.UserFederationProvider; +import org.keycloak.models.UserFederationProviderFactory; +import org.keycloak.models.UserModel; +import org.keycloak.models.UserProvider; import org.keycloak.models.UserSessionModel; import org.keycloak.models.utils.ModelToRepresentation; -import org.keycloak.protocol.oidc.OIDCLoginProtocol; -import org.keycloak.protocol.oidc.endpoints.request.AuthorizationEndpointRequest; import org.keycloak.representations.idm.AdminEventRepresentation; +import org.keycloak.representations.idm.AuthDetailsRepresentation; +import org.keycloak.representations.idm.AuthenticationFlowRepresentation; import org.keycloak.representations.idm.EventRepresentation; +import org.keycloak.representations.idm.UserRepresentation; import org.keycloak.services.managers.ClientSessionCode; import org.keycloak.services.managers.RealmManager; import org.keycloak.services.resource.RealmResourceProvider; @@ -46,6 +56,8 @@ import org.keycloak.testsuite.events.EventsListenerProvider; import org.keycloak.testsuite.forms.PassThroughAuthenticator; import org.keycloak.testsuite.forms.PassThroughClientAuthenticator; import org.keycloak.testsuite.rest.representation.AuthenticatorState; +import org.keycloak.testsuite.rest.resource.TestingExportImportResource; + import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.NotFoundException; @@ -57,33 +69,13 @@ import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.jboss.resteasy.annotations.cache.NoCache; -import org.jboss.resteasy.spi.BadRequestException; -import org.keycloak.events.EventQuery; -import org.keycloak.events.EventStoreProvider; -import org.keycloak.events.EventType; -import org.keycloak.events.admin.AdminEventQuery; -import org.keycloak.events.admin.AuthDetails; -import org.keycloak.events.admin.OperationType; -import org.keycloak.exportimport.ExportImportManager; -import org.keycloak.models.AuthenticationFlowModel; -import org.keycloak.models.ClientModel; -import org.keycloak.models.FederatedIdentityModel; -import org.keycloak.models.RealmProvider; -import org.keycloak.models.UserCredentialModel; -import org.keycloak.models.UserFederationProvider; -import org.keycloak.models.UserFederationProviderFactory; -import org.keycloak.models.UserModel; -import org.keycloak.models.UserProvider; -import org.keycloak.representations.idm.AuthDetailsRepresentation; -import org.keycloak.representations.idm.AuthenticationFlowRepresentation; -import org.keycloak.representations.idm.UserRepresentation; -import org.keycloak.testsuite.rest.resource.TestingExportImportResource; - -import static org.keycloak.exportimport.ExportImportConfig.*; /** * @author Stian Thorgersen diff --git a/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/rest/resource/TestingExportImportResource.java b/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/rest/resource/TestingExportImportResource.java index 4f9151c753..a9ff31d91b 100644 --- a/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/rest/resource/TestingExportImportResource.java +++ b/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/rest/resource/TestingExportImportResource.java @@ -17,7 +17,8 @@ package org.keycloak.testsuite.rest.resource; -import java.io.File; +import org.keycloak.exportimport.ExportImportManager; +import org.keycloak.models.KeycloakSession; import javax.ws.rs.Consumes; import javax.ws.rs.GET; @@ -27,9 +28,7 @@ import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; - -import org.keycloak.exportimport.ExportImportManager; -import org.keycloak.models.KeycloakSession; +import java.io.File; import static org.keycloak.exportimport.ExportImportConfig.ACTION; import static org.keycloak.exportimport.ExportImportConfig.DEFAULT_USERS_PER_FILE; diff --git a/testsuite/integration-arquillian/test-apps/hello-world-authz-service/src/main/webapp/index.jsp b/testsuite/integration-arquillian/test-apps/hello-world-authz-service/src/main/webapp/index.jsp index 75f3d6f0f2..0aea6b0452 100644 --- a/testsuite/integration-arquillian/test-apps/hello-world-authz-service/src/main/webapp/index.jsp +++ b/testsuite/integration-arquillian/test-apps/hello-world-authz-service/src/main/webapp/index.jsp @@ -16,9 +16,9 @@ ~ --%> <%@page import="org.keycloak.AuthorizationContext" %> +<%@ page import="org.keycloak.KeycloakSecurityContext" %> <%@ page import="org.keycloak.common.util.KeycloakUriBuilder" %> <%@ page import="org.keycloak.constants.ServiceUrlConstants" %> -<%@ page import="org.keycloak.KeycloakSecurityContext" %> <%@ page import="org.keycloak.representations.idm.authorization.Permission" %> <% diff --git a/testsuite/integration-arquillian/test-apps/photoz/photoz-authz-policy/src/main/resources/META-INF/kmodule.xml b/testsuite/integration-arquillian/test-apps/photoz/photoz-authz-policy/src/main/resources/META-INF/kmodule.xml index 84bacd5624..842128732c 100644 --- a/testsuite/integration-arquillian/test-apps/photoz/photoz-authz-policy/src/main/resources/META-INF/kmodule.xml +++ b/testsuite/integration-arquillian/test-apps/photoz/photoz-authz-policy/src/main/resources/META-INF/kmodule.xml @@ -1,6 +1,6 @@ - + diff --git a/testsuite/integration-arquillian/test-apps/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/album/AlbumService.java b/testsuite/integration-arquillian/test-apps/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/album/AlbumService.java index d0e9c2d5c5..7dd6b244a1 100644 --- a/testsuite/integration-arquillian/test-apps/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/album/AlbumService.java +++ b/testsuite/integration-arquillian/test-apps/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/album/AlbumService.java @@ -11,10 +11,8 @@ import org.keycloak.example.photoz.util.Transaction; import org.keycloak.representations.adapters.config.AdapterConfig; import org.keycloak.util.JsonSerialization; -import javax.ejb.Stateless; import javax.inject.Inject; import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; import javax.persistence.Query; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.Consumes; diff --git a/testsuite/integration-arquillian/test-apps/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/album/ProfileService.java b/testsuite/integration-arquillian/test-apps/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/album/ProfileService.java index f7b55cbc33..92e300dec5 100644 --- a/testsuite/integration-arquillian/test-apps/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/album/ProfileService.java +++ b/testsuite/integration-arquillian/test-apps/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/album/ProfileService.java @@ -17,17 +17,14 @@ */ package org.keycloak.example.photoz.album; -import javax.ejb.Stateless; import javax.inject.Inject; import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.Context; import javax.ws.rs.core.Response; -import javax.ws.rs.core.SecurityContext; import java.security.Principal; import java.util.List; diff --git a/testsuite/integration-arquillian/test-apps/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/util/Transaction.java b/testsuite/integration-arquillian/test-apps/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/util/Transaction.java index a3caa780a8..6f5d5ec229 100644 --- a/testsuite/integration-arquillian/test-apps/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/util/Transaction.java +++ b/testsuite/integration-arquillian/test-apps/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/util/Transaction.java @@ -20,7 +20,6 @@ import javax.interceptor.InterceptorBinding; import java.lang.annotation.Retention; import java.lang.annotation.Target; -import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.TYPE; import static java.lang.annotation.RetentionPolicy.RUNTIME; diff --git a/testsuite/integration-arquillian/test-utils/src/main/java/org/keycloak/testsuite/util/junit/AggregateResultsReporter.java b/testsuite/integration-arquillian/test-utils/src/main/java/org/keycloak/testsuite/util/junit/AggregateResultsReporter.java index 2b1bf6ce04..0b50603c2b 100644 --- a/testsuite/integration-arquillian/test-utils/src/main/java/org/keycloak/testsuite/util/junit/AggregateResultsReporter.java +++ b/testsuite/integration-arquillian/test-utils/src/main/java/org/keycloak/testsuite/util/junit/AggregateResultsReporter.java @@ -1,15 +1,12 @@ package org.keycloak.testsuite.util.junit; import org.apache.commons.configuration.PropertiesConfiguration; - import org.jboss.logging.Logger; - import org.junit.Ignore; import org.junit.runner.Description; import org.junit.runner.Result; import org.junit.runner.notification.Failure; import org.junit.runner.notification.RunListener; - import org.w3c.dom.Document; import org.w3c.dom.Element; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/filter/AdapterActionsFilter.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/filter/AdapterActionsFilter.java index aad5bb889d..6b439e6a54 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/filter/AdapterActionsFilter.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/filter/AdapterActionsFilter.java @@ -18,8 +18,11 @@ package org.keycloak.testsuite.adapter.filter; -import java.io.IOException; -import java.io.PrintWriter; +import org.jboss.logging.Logger; +import org.keycloak.adapters.AdapterDeploymentContext; +import org.keycloak.adapters.KeycloakDeployment; +import org.keycloak.adapters.rotation.JWKPublicKeyLocator; +import org.keycloak.common.util.Time; import javax.servlet.Filter; import javax.servlet.FilterChain; @@ -29,12 +32,8 @@ import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; - -import org.jboss.logging.Logger; -import org.keycloak.adapters.AdapterDeploymentContext; -import org.keycloak.adapters.KeycloakDeployment; -import org.keycloak.adapters.rotation.JWKPublicKeyLocator; -import org.keycloak.common.util.Time; +import java.io.IOException; +import java.io.PrintWriter; /** * Filter to handle "special" requests to perform actions on adapter side (for example setting time offset ) diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/AbstractShowTokensPage.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/AbstractShowTokensPage.java index 6cb1f37d5b..ea7ef6fe48 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/AbstractShowTokensPage.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/AbstractShowTokensPage.java @@ -17,8 +17,6 @@ package org.keycloak.testsuite.adapter.page; -import java.io.IOException; - import org.keycloak.representations.AccessToken; import org.keycloak.representations.RefreshToken; import org.keycloak.testsuite.page.AbstractPageWithInjectedUrl; @@ -27,6 +25,8 @@ import org.openqa.selenium.NoSuchElementException; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; +import java.io.IOException; + /** * @author Marek Posolda */ diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/AppServerContextRoot.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/AppServerContextRoot.java index 25129415e6..634701a4db 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/AppServerContextRoot.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/AppServerContextRoot.java @@ -17,10 +17,11 @@ package org.keycloak.testsuite.adapter.page; -import org.keycloak.testsuite.page.AbstractPageWithInjectedUrl; -import java.net.URL; import org.jboss.arquillian.test.api.ArquillianResource; import org.keycloak.testsuite.arquillian.annotation.AppServerContext; +import org.keycloak.testsuite.page.AbstractPageWithInjectedUrl; + +import java.net.URL; /** * diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/CustomerDb.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/CustomerDb.java index b2c572b2d9..06a52f95b8 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/CustomerDb.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/CustomerDb.java @@ -17,11 +17,12 @@ package org.keycloak.testsuite.adapter.page; -import java.net.URL; import org.jboss.arquillian.container.test.api.OperateOnDeployment; import org.jboss.arquillian.test.api.ArquillianResource; import org.keycloak.testsuite.page.AbstractPageWithInjectedUrl; +import java.net.URL; + /** * * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/CustomerDbErrorPage.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/CustomerDbErrorPage.java index 569f828a3b..7ba9037ce2 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/CustomerDbErrorPage.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/CustomerDbErrorPage.java @@ -17,11 +17,12 @@ package org.keycloak.testsuite.adapter.page; -import java.net.URL; import org.jboss.arquillian.container.test.api.OperateOnDeployment; import org.jboss.arquillian.test.api.ArquillianResource; import org.keycloak.testsuite.page.AbstractPageWithInjectedUrl; +import java.net.URL; + /** * * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/CustomerPortal.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/CustomerPortal.java index bde507a68a..4ec2201fca 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/CustomerPortal.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/CustomerPortal.java @@ -17,13 +17,11 @@ package org.keycloak.testsuite.adapter.page; -import java.net.URL; import org.jboss.arquillian.container.test.api.OperateOnDeployment; -import org.jboss.arquillian.graphene.findby.FindByJQuery; import org.jboss.arquillian.test.api.ArquillianResource; import org.keycloak.testsuite.page.AbstractPageWithInjectedUrl; -import org.keycloak.testsuite.util.WaitUtils; -import org.openqa.selenium.WebElement; + +import java.net.URL; /** * diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/KerberosPortal.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/KerberosPortal.java index 931ae024eb..2ef6068fd2 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/KerberosPortal.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/KerberosPortal.java @@ -17,12 +17,12 @@ package org.keycloak.testsuite.adapter.page; -import java.net.URL; - import org.jboss.arquillian.container.test.api.OperateOnDeployment; import org.jboss.arquillian.test.api.ArquillianResource; import org.keycloak.testsuite.page.AbstractPageWithInjectedUrl; +import java.net.URL; + /** * * @author pdrozd diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/MultiTenant.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/MultiTenant.java index 9590c30c52..3cd866336c 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/MultiTenant.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/MultiTenant.java @@ -17,13 +17,14 @@ package org.keycloak.testsuite.adapter.page; -import java.net.MalformedURLException; -import java.net.URL; -import javax.ws.rs.core.UriBuilder; import org.jboss.arquillian.container.test.api.OperateOnDeployment; import org.jboss.arquillian.test.api.ArquillianResource; import org.keycloak.testsuite.page.AbstractPageWithInjectedUrl; +import javax.ws.rs.core.UriBuilder; +import java.net.MalformedURLException; +import java.net.URL; + /** * * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/MultiTenantExample.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/MultiTenantExample.java index 8ce2bed752..7cff7140d4 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/MultiTenantExample.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/MultiTenantExample.java @@ -17,13 +17,14 @@ package org.keycloak.testsuite.adapter.page; -import java.net.MalformedURLException; -import java.net.URL; -import javax.ws.rs.core.UriBuilder; import org.jboss.arquillian.container.test.api.OperateOnDeployment; import org.jboss.arquillian.test.api.ArquillianResource; import org.keycloak.testsuite.page.AbstractPageWithInjectedUrl; +import javax.ws.rs.core.UriBuilder; +import java.net.MalformedURLException; +import java.net.URL; + /** * * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/OfflineToken.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/OfflineToken.java index 248225e15b..9eb3b347fd 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/OfflineToken.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/OfflineToken.java @@ -2,15 +2,8 @@ package org.keycloak.testsuite.adapter.page; import org.jboss.arquillian.container.test.api.OperateOnDeployment; import org.jboss.arquillian.test.api.ArquillianResource; -import org.keycloak.representations.AccessToken; -import org.keycloak.representations.RefreshToken; -import org.keycloak.testsuite.page.AbstractPageWithInjectedUrl; -import org.keycloak.util.JsonSerialization; import org.openqa.selenium.By; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.support.FindBy; -import java.io.IOException; import java.net.URL; import static org.keycloak.testsuite.util.WaitUtils.pause; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/PhotozClientAuthzTestApp.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/PhotozClientAuthzTestApp.java index c76747a2f1..fe98f0d6c6 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/PhotozClientAuthzTestApp.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/PhotozClientAuthzTestApp.java @@ -24,15 +24,12 @@ import org.keycloak.testsuite.page.AbstractPageWithInjectedUrl; import org.keycloak.testsuite.page.Form; import org.keycloak.testsuite.pages.ConsentPage; import org.keycloak.testsuite.util.URLUtils; -import org.keycloak.testsuite.util.WaitUtils; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import java.net.URL; -import java.util.List; -import static org.keycloak.testsuite.util.WaitUtils.IMPLICIT_ELEMENT_WAIT_MILLIS; import static org.keycloak.testsuite.util.WaitUtils.pause; import static org.keycloak.testsuite.util.WaitUtils.waitForPageToLoad; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/ProductPortal.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/ProductPortal.java index 2eb2c19c6c..6f06ec4eef 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/ProductPortal.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/ProductPortal.java @@ -17,11 +17,12 @@ package org.keycloak.testsuite.adapter.page; -import java.net.URL; import org.jboss.arquillian.container.test.api.OperateOnDeployment; import org.jboss.arquillian.test.api.ArquillianResource; import org.keycloak.testsuite.page.AbstractPageWithInjectedUrl; +import java.net.URL; + /** * * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/SecurePortal.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/SecurePortal.java index d1a51e001a..898c93faae 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/SecurePortal.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/SecurePortal.java @@ -17,11 +17,12 @@ package org.keycloak.testsuite.adapter.page; -import java.net.URL; import org.jboss.arquillian.container.test.api.OperateOnDeployment; import org.jboss.arquillian.test.api.ArquillianResource; import org.keycloak.testsuite.page.AbstractPageWithInjectedUrl; +import java.net.URL; + /** * * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/SessionPortal.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/SessionPortal.java index 63d5b585c0..11aad09e72 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/SessionPortal.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/SessionPortal.java @@ -17,11 +17,12 @@ package org.keycloak.testsuite.adapter.page; -import java.net.URL; import org.jboss.arquillian.container.test.api.OperateOnDeployment; import org.jboss.arquillian.test.api.ArquillianResource; import org.keycloak.testsuite.page.AbstractPageWithInjectedUrl; +import java.net.URL; + /** * * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/TokenMinTTLPage.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/TokenMinTTLPage.java index 797ab6ce2c..ad9f2eea13 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/TokenMinTTLPage.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/TokenMinTTLPage.java @@ -17,11 +17,11 @@ package org.keycloak.testsuite.adapter.page; -import java.net.URL; - import org.jboss.arquillian.container.test.api.OperateOnDeployment; import org.jboss.arquillian.test.api.ArquillianResource; +import java.net.URL; + /** * @author Marek Posolda */ diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/fuse/AbstractFuseExample.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/fuse/AbstractFuseExample.java index ae91ab6bdf..1024c3e93c 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/fuse/AbstractFuseExample.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/fuse/AbstractFuseExample.java @@ -17,9 +17,10 @@ package org.keycloak.testsuite.adapter.page.fuse; +import org.keycloak.testsuite.adapter.page.AppServerContextRoot; + import java.net.MalformedURLException; import java.net.URL; -import org.keycloak.testsuite.adapter.page.AppServerContextRoot; /** * diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/fuse/AdminInterface.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/fuse/AdminInterface.java index edafa1b635..d39b6c28f9 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/fuse/AdminInterface.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/fuse/AdminInterface.java @@ -17,9 +17,6 @@ package org.keycloak.testsuite.adapter.page.fuse; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.support.FindBy; - /** * * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/servlet/AbstractShowTokensServlet.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/servlet/AbstractShowTokensServlet.java index 403c70e0f0..370717210c 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/servlet/AbstractShowTokensServlet.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/servlet/AbstractShowTokensServlet.java @@ -17,12 +17,6 @@ package org.keycloak.testsuite.adapter.servlet; -import java.io.IOException; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; - import org.keycloak.KeycloakSecurityContext; import org.keycloak.adapters.RefreshableKeycloakSecurityContext; import org.keycloak.jose.jws.JWSInput; @@ -30,6 +24,11 @@ import org.keycloak.jose.jws.JWSInputException; import org.keycloak.representations.RefreshToken; import org.keycloak.util.JsonSerialization; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import java.io.IOException; + /** * @author Marek Posolda */ diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/servlet/KerberosCredDelegServlet.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/servlet/KerberosCredDelegServlet.java index 334591c6c7..5c93c6e464 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/servlet/KerberosCredDelegServlet.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/servlet/KerberosCredDelegServlet.java @@ -17,9 +17,10 @@ package org.keycloak.testsuite.adapter.servlet; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Hashtable; +import org.ietf.jgss.GSSCredential; +import org.keycloak.KeycloakPrincipal; +import org.keycloak.common.constants.KerberosConstants; +import org.keycloak.common.util.KerberosSerializationUtils; import javax.naming.Context; import javax.naming.NamingException; @@ -31,11 +32,9 @@ import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; - -import org.ietf.jgss.GSSCredential; -import org.keycloak.KeycloakPrincipal; -import org.keycloak.common.constants.KerberosConstants; -import org.keycloak.common.util.KerberosSerializationUtils; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.Hashtable; /** * @author Marek Posolda diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/servlet/MultiTenantResolver.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/servlet/MultiTenantResolver.java index a50c589a1e..f2e60bba22 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/servlet/MultiTenantResolver.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/servlet/MultiTenantResolver.java @@ -16,12 +16,13 @@ */ package org.keycloak.testsuite.adapter.servlet; -import java.io.InputStream; import org.keycloak.adapters.KeycloakConfigResolver; import org.keycloak.adapters.KeycloakDeployment; import org.keycloak.adapters.KeycloakDeploymentBuilder; import org.keycloak.adapters.spi.HttpFacade; +import java.io.InputStream; + /** * * @author Juraci Paixão Kröhling diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/servlet/OfflineTokenServlet.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/servlet/OfflineTokenServlet.java index c36b30e2f6..b40fc89c27 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/servlet/OfflineTokenServlet.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/servlet/OfflineTokenServlet.java @@ -1,12 +1,6 @@ package org.keycloak.testsuite.adapter.servlet; -import org.keycloak.KeycloakSecurityContext; import org.keycloak.OAuth2Constants; -import org.keycloak.adapters.RefreshableKeycloakSecurityContext; -import org.keycloak.jose.jws.JWSInput; -import org.keycloak.jose.jws.JWSInputException; -import org.keycloak.representations.RefreshToken; -import org.keycloak.util.JsonSerialization; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/servlet/SendUsernameServlet.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/servlet/SendUsernameServlet.java index 6e70f15851..aa29d0c075 100755 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/servlet/SendUsernameServlet.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/servlet/SendUsernameServlet.java @@ -26,7 +26,11 @@ import org.keycloak.saml.processing.core.saml.v2.constants.X500SAMLProfileConsta import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; -import javax.ws.rs.*; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.QueryParam; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/servlet/SessionServlet.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/servlet/SessionServlet.java index 97c23250ec..78868722d2 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/servlet/SessionServlet.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/servlet/SessionServlet.java @@ -17,15 +17,14 @@ package org.keycloak.testsuite.adapter.servlet; -import java.io.IOException; -import java.io.PrintWriter; - import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; +import java.io.IOException; +import java.io.PrintWriter; /** * @author Marek Posolda diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/servlet/TokenMinTTLServlet.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/servlet/TokenMinTTLServlet.java index 5b0e1c37c0..7d266bc887 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/servlet/TokenMinTTLServlet.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/servlet/TokenMinTTLServlet.java @@ -17,11 +17,10 @@ package org.keycloak.testsuite.adapter.servlet; -import java.io.IOException; - import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import java.io.IOException; /** * @author Marek Posolda diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/admin/Users.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/admin/Users.java index a6065f1388..5d4ee2e270 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/admin/Users.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/admin/Users.java @@ -16,11 +16,13 @@ */ package org.keycloak.testsuite.admin; +import org.keycloak.representations.idm.CredentialRepresentation; +import org.keycloak.representations.idm.UserRepresentation; + import java.util.ArrayList; import java.util.List; -import org.keycloak.representations.idm.CredentialRepresentation; + import static org.keycloak.representations.idm.CredentialRepresentation.PASSWORD; -import org.keycloak.representations.idm.UserRepresentation; /** * diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/AppServerTestEnricher.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/AppServerTestEnricher.java index 11e5fc6b34..92646f4f5e 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/AppServerTestEnricher.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/AppServerTestEnricher.java @@ -9,6 +9,7 @@ import org.jboss.arquillian.test.spi.annotation.ClassScoped; import org.jboss.arquillian.test.spi.event.suite.BeforeClass; import org.jboss.logging.Logger; import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; + import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/AuthServerTestEnricher.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/AuthServerTestEnricher.java index d958e6e8eb..ba82396aaa 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/AuthServerTestEnricher.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/AuthServerTestEnricher.java @@ -16,12 +16,6 @@ */ package org.keycloak.testsuite.arquillian; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.LinkedHashSet; -import java.util.Set; - import org.jboss.arquillian.container.spi.Container; import org.jboss.arquillian.container.spi.ContainerRegistry; import org.jboss.arquillian.container.spi.event.StartContainer; @@ -40,6 +34,12 @@ import org.jboss.logging.Logger; import org.keycloak.testsuite.util.LogChecker; import org.keycloak.testsuite.util.OAuthClient; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.LinkedHashSet; +import java.util.Set; + /** * * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/ContainerInfo.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/ContainerInfo.java index a6bcdc5841..dde3c8f365 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/ContainerInfo.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/ContainerInfo.java @@ -1,9 +1,10 @@ package org.keycloak.testsuite.arquillian; +import org.jboss.arquillian.container.spi.Container; + import java.net.URL; import java.util.Map; import java.util.Objects; -import org.jboss.arquillian.container.spi.Container; /** * diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/DeploymentArchiveProcessor.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/DeploymentArchiveProcessor.java index 4af2988d1b..d610957c29 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/DeploymentArchiveProcessor.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/DeploymentArchiveProcessor.java @@ -38,9 +38,18 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; -import static org.keycloak.testsuite.arquillian.AppServerTestEnricher.*; +import static org.keycloak.testsuite.arquillian.AppServerTestEnricher.hasAppServerContainerAnnotation; +import static org.keycloak.testsuite.arquillian.AppServerTestEnricher.isRelative; +import static org.keycloak.testsuite.arquillian.AppServerTestEnricher.isTomcatAppServer; import static org.keycloak.testsuite.arquillian.AuthServerTestEnricher.getAuthServerContextRoot; -import static org.keycloak.testsuite.util.IOUtil.*; +import static org.keycloak.testsuite.util.IOUtil.appendChildInDocument; +import static org.keycloak.testsuite.util.IOUtil.documentToString; +import static org.keycloak.testsuite.util.IOUtil.getElementTextContent; +import static org.keycloak.testsuite.util.IOUtil.loadJson; +import static org.keycloak.testsuite.util.IOUtil.loadXML; +import static org.keycloak.testsuite.util.IOUtil.modifyDocElementAttribute; +import static org.keycloak.testsuite.util.IOUtil.modifyDocElementValue; +import static org.keycloak.testsuite.util.IOUtil.removeElementFromDoc; ; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/DeploymentTargetModifier.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/DeploymentTargetModifier.java index b867c7ce4e..3a4d0b97fc 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/DeploymentTargetModifier.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/DeploymentTargetModifier.java @@ -17,12 +17,14 @@ package org.keycloak.testsuite.arquillian; -import java.util.List; import org.jboss.arquillian.container.spi.client.deployment.DeploymentDescription; import org.jboss.arquillian.container.spi.client.deployment.TargetDescription; import org.jboss.arquillian.container.test.impl.client.deployment.AnnotationDeploymentScenarioGenerator; import org.jboss.arquillian.test.spi.TestClass; import org.jboss.logging.Logger; + +import java.util.List; + import static org.keycloak.testsuite.arquillian.AppServerTestEnricher.getAppServerQualifier; /** diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/KeycloakArquillianExtension.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/KeycloakArquillianExtension.java index 899a73155f..c9a9d89f9f 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/KeycloakArquillianExtension.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/KeycloakArquillianExtension.java @@ -17,8 +17,6 @@ package org.keycloak.testsuite.arquillian; -import org.keycloak.testsuite.arquillian.provider.*; -import org.jboss.arquillian.container.spi.client.container.DeployableContainer; import org.jboss.arquillian.container.test.impl.enricher.resource.URLResourceProvider; import org.jboss.arquillian.container.test.spi.client.deployment.ApplicationArchiveProcessor; import org.jboss.arquillian.container.test.spi.client.deployment.DeploymentScenarioGenerator; @@ -29,6 +27,11 @@ import org.jboss.arquillian.test.spi.enricher.resource.ResourceProvider; import org.jboss.arquillian.test.spi.execution.TestExecutionDecider; import org.keycloak.testsuite.arquillian.h2.H2TestEnricher; import org.keycloak.testsuite.arquillian.migration.MigrationTestExecutionDecider; +import org.keycloak.testsuite.arquillian.provider.AdminClientProvider; +import org.keycloak.testsuite.arquillian.provider.OAuthClientProvider; +import org.keycloak.testsuite.arquillian.provider.SuiteContextProvider; +import org.keycloak.testsuite.arquillian.provider.TestContextProvider; +import org.keycloak.testsuite.arquillian.provider.URLProvider; /** * diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/SuiteContext.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/SuiteContext.java index d576b49a12..a9092a34a4 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/SuiteContext.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/SuiteContext.java @@ -21,7 +21,10 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; -import static org.keycloak.testsuite.util.MailServerConfiguration.*; + +import static org.keycloak.testsuite.util.MailServerConfiguration.FROM; +import static org.keycloak.testsuite.util.MailServerConfiguration.HOST; +import static org.keycloak.testsuite.util.MailServerConfiguration.PORT; /** * diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/annotation/AppServerContainer.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/annotation/AppServerContainer.java index c284d9a0e4..8be428fd3a 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/annotation/AppServerContainer.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/annotation/AppServerContainer.java @@ -20,9 +20,10 @@ package org.keycloak.testsuite.arquillian.annotation; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; -import static java.lang.annotation.RetentionPolicy.RUNTIME; import java.lang.annotation.Target; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + /** * * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/annotation/AppServerContext.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/annotation/AppServerContext.java index f66c809fc5..5b1117fce4 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/annotation/AppServerContext.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/annotation/AppServerContext.java @@ -20,9 +20,10 @@ package org.keycloak.testsuite.arquillian.annotation; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; -import static java.lang.annotation.RetentionPolicy.RUNTIME; import java.lang.annotation.Target; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + /** * * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/annotation/AuthServerContext.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/annotation/AuthServerContext.java index eeee302153..b6185831cf 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/annotation/AuthServerContext.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/annotation/AuthServerContext.java @@ -20,9 +20,10 @@ package org.keycloak.testsuite.arquillian.annotation; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; -import static java.lang.annotation.RetentionPolicy.RUNTIME; import java.lang.annotation.Target; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + /** * * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/annotation/UseServletFilter.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/annotation/UseServletFilter.java index dc0b3f4f61..a94737d486 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/annotation/UseServletFilter.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/annotation/UseServletFilter.java @@ -1,6 +1,10 @@ package org.keycloak.testsuite.arquillian.annotation; -import java.lang.annotation.*; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; import static java.lang.annotation.RetentionPolicy.RUNTIME; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/MultipleContainersExtension.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/MultipleContainersExtension.java index ef7cd7aaef..7b5e5d78b0 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/MultipleContainersExtension.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/MultipleContainersExtension.java @@ -16,8 +16,6 @@ */ package org.keycloak.testsuite.arquillian.containers; -import java.util.logging.Logger; - import org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler; import org.jboss.arquillian.container.impl.client.container.ContainerDeployController; import org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController; @@ -27,6 +25,8 @@ import org.jboss.arquillian.container.impl.context.ContainerContextImpl; import org.jboss.arquillian.container.impl.context.DeploymentContextImpl; import org.jboss.arquillian.core.spi.LoadableExtension; +import java.util.logging.Logger; + /** * Enables multiple container adapters on classpath. * diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/Registry.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/Registry.java index 6bbe084117..5bdd1cdc8c 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/Registry.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/Registry.java @@ -16,13 +16,6 @@ */ package org.keycloak.testsuite.arquillian.containers; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.logging.Level; -import java.util.logging.Logger; - import org.jboss.arquillian.config.descriptor.api.ContainerDef; import org.jboss.arquillian.container.impl.ContainerCreationException; import org.jboss.arquillian.container.impl.ContainerImpl; @@ -34,6 +27,14 @@ import org.jboss.arquillian.container.spi.client.deployment.TargetDescription; import org.jboss.arquillian.core.api.Injector; import org.jboss.arquillian.core.spi.ServiceLoader; import org.jboss.arquillian.core.spi.Validate; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; + import static org.keycloak.testsuite.arquillian.containers.RegistryCreator.ADAPTER_IMPL_CONFIG_STRING; import static org.keycloak.testsuite.arquillian.containers.RegistryCreator.getAdapterImplClassValue; import static org.keycloak.testsuite.arquillian.containers.RegistryCreator.getContainerAdapter; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/RegistryCreator.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/RegistryCreator.java index f330ab9b90..99b6772f1e 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/RegistryCreator.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/RegistryCreator.java @@ -16,10 +16,6 @@ */ package org.keycloak.testsuite.arquillian.containers; -import java.util.Collection; -import java.util.List; -import java.util.Map; - import org.jboss.arquillian.config.descriptor.api.ArquillianDescriptor; import org.jboss.arquillian.config.descriptor.api.ContainerDef; import org.jboss.arquillian.config.descriptor.api.GroupDef; @@ -34,6 +30,11 @@ import org.jboss.arquillian.core.api.annotation.Observes; import org.jboss.arquillian.core.spi.ServiceLoader; import org.jboss.arquillian.core.spi.Validate; import org.jboss.logging.Logger; + +import java.util.Collection; +import java.util.List; +import java.util.Map; + import static org.keycloak.testsuite.arquillian.containers.SecurityActions.isClassPresent; import static org.keycloak.testsuite.arquillian.containers.SecurityActions.loadClass; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/h2/H2TestEnricher.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/h2/H2TestEnricher.java index 705cbad80e..2e9d5c3c62 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/h2/H2TestEnricher.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/h2/H2TestEnricher.java @@ -1,11 +1,12 @@ package org.keycloak.testsuite.arquillian.h2; -import java.sql.SQLException; +import org.h2.tools.Server; import org.jboss.arquillian.core.api.annotation.Observes; import org.jboss.arquillian.test.spi.event.suite.AfterSuite; import org.jboss.arquillian.test.spi.event.suite.BeforeSuite; import org.jboss.logging.Logger; -import org.h2.tools.Server; + +import java.sql.SQLException; /** * Starts H2 before suite and stops it after. diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/migration/Migration.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/migration/Migration.java index d43ee65989..a9afc80b02 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/migration/Migration.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/migration/Migration.java @@ -19,9 +19,10 @@ package org.keycloak.testsuite.arquillian.migration; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; -import static java.lang.annotation.RetentionPolicy.RUNTIME; import java.lang.annotation.Target; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + /** * * @author Vlastislav Ramik diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/migration/MigrationTestExecutionDecider.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/migration/MigrationTestExecutionDecider.java index b526870431..4c75bae25b 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/migration/MigrationTestExecutionDecider.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/migration/MigrationTestExecutionDecider.java @@ -16,10 +16,11 @@ */ package org.keycloak.testsuite.arquillian.migration; -import java.lang.reflect.Method; import org.jboss.arquillian.test.spi.execution.ExecutionDecision; import org.jboss.arquillian.test.spi.execution.TestExecutionDecider; +import java.lang.reflect.Method; + /** * @author Vlastislav Ramik * @author tkyjovsk (refactoring) diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/provider/AdminClientProvider.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/provider/AdminClientProvider.java index 8d044fc6c1..be84b122d5 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/provider/AdminClientProvider.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/provider/AdminClientProvider.java @@ -17,13 +17,14 @@ package org.keycloak.testsuite.arquillian.provider; -import java.lang.annotation.Annotation; import org.jboss.arquillian.core.api.Instance; import org.jboss.arquillian.core.api.annotation.Inject; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.arquillian.test.spi.enricher.resource.ResourceProvider; import org.keycloak.admin.client.Keycloak; +import java.lang.annotation.Annotation; + /** * * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/provider/SuiteContextProvider.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/provider/SuiteContextProvider.java index ef57b8624a..90708c9ebb 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/provider/SuiteContextProvider.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/provider/SuiteContextProvider.java @@ -17,12 +17,13 @@ package org.keycloak.testsuite.arquillian.provider; -import org.keycloak.testsuite.arquillian.SuiteContext; -import java.lang.annotation.Annotation; import org.jboss.arquillian.core.api.Instance; import org.jboss.arquillian.core.api.annotation.Inject; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.arquillian.test.spi.enricher.resource.ResourceProvider; +import org.keycloak.testsuite.arquillian.SuiteContext; + +import java.lang.annotation.Annotation; /** * diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/provider/TestContextProvider.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/provider/TestContextProvider.java index 6656e5e19e..aefe3b32e2 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/provider/TestContextProvider.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/provider/TestContextProvider.java @@ -17,12 +17,13 @@ package org.keycloak.testsuite.arquillian.provider; -import org.keycloak.testsuite.arquillian.TestContext; -import java.lang.annotation.Annotation; import org.jboss.arquillian.core.api.Instance; import org.jboss.arquillian.core.api.annotation.Inject; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.arquillian.test.spi.enricher.resource.ResourceProvider; +import org.keycloak.testsuite.arquillian.TestContext; + +import java.lang.annotation.Annotation; /** * diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/AuthServer.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/AuthServer.java index 14f1e266f0..b16a8340f2 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/AuthServer.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/AuthServer.java @@ -17,10 +17,8 @@ package org.keycloak.testsuite.auth.page; -import java.net.URI; import javax.ws.rs.core.UriBuilder; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.keycloak.admin.client.Keycloak; +import java.net.URI; /** * Context path of Keycloak auth server. diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/AuthServerContextRoot.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/AuthServerContextRoot.java index efcea39d90..039d318eab 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/AuthServerContextRoot.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/AuthServerContextRoot.java @@ -17,11 +17,12 @@ package org.keycloak.testsuite.auth.page; -import java.net.URL; import org.jboss.arquillian.test.api.ArquillianResource; import org.keycloak.testsuite.arquillian.annotation.AuthServerContext; import org.keycloak.testsuite.page.AbstractPageWithInjectedUrl; +import java.net.URL; + /** * Context root of the tested Keycloak server. * diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/account/AccountFields.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/account/AccountFields.java index 8ca2531f45..706cec992d 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/account/AccountFields.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/account/AccountFields.java @@ -19,12 +19,12 @@ package org.keycloak.testsuite.auth.page.account; import org.keycloak.representations.idm.UserRepresentation; import org.keycloak.testsuite.page.Form; -import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; -import static org.keycloak.testsuite.util.WaitUtils.waitUntilElementIsNotPresent; - import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; +import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; +import static org.keycloak.testsuite.util.WaitUtils.waitUntilElementIsNotPresent; + /** * * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/account/AccountManagement.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/account/AccountManagement.java index 0de5299820..59c5026e5b 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/account/AccountManagement.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/account/AccountManagement.java @@ -16,14 +16,16 @@ */ package org.keycloak.testsuite.auth.page.account; -import javax.ws.rs.core.UriBuilder; import org.jboss.arquillian.graphene.findby.FindByJQuery; import org.keycloak.testsuite.auth.page.AuthRealm; import org.keycloak.testsuite.page.PageWithLogOutAction; -import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; +import javax.ws.rs.core.UriBuilder; + +import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; + /** * * @author Petr Mensik diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/account/ChangePassword.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/account/ChangePassword.java index 08bfb0c289..7791e06928 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/account/ChangePassword.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/account/ChangePassword.java @@ -16,9 +16,10 @@ */ package org.keycloak.testsuite.auth.page.account; -import javax.ws.rs.core.UriBuilder; import org.jboss.arquillian.graphene.page.Page; +import javax.ws.rs.core.UriBuilder; + /** * * @author Petr Mensik diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/account/PasswordFields.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/account/PasswordFields.java index fc323e97c0..bcd5de5f8d 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/account/PasswordFields.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/account/PasswordFields.java @@ -17,10 +17,11 @@ package org.keycloak.testsuite.auth.page.account; import org.keycloak.testsuite.page.Form; -import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; +import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; + /** * * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/account/Sessions.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/account/Sessions.java index ccf3e49b76..30c8a9a9aa 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/account/Sessions.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/account/Sessions.java @@ -16,13 +16,14 @@ */ package org.keycloak.testsuite.auth.page.account; -import java.util.LinkedList; -import java.util.List; -import javax.ws.rs.core.UriBuilder; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; +import javax.ws.rs.core.UriBuilder; +import java.util.LinkedList; +import java.util.List; + /** * * @author Petr Mensik diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/Authenticate.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/Authenticate.java index 0bcb72b087..c9a8a67b6c 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/Authenticate.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/Authenticate.java @@ -17,9 +17,10 @@ package org.keycloak.testsuite.auth.page.login; -import javax.ws.rs.core.UriBuilder; import org.jboss.arquillian.graphene.page.Page; +import javax.ws.rs.core.UriBuilder; + /** * * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/Login.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/Login.java index dcee089960..cccd862adc 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/Login.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/Login.java @@ -19,8 +19,6 @@ package org.keycloak.testsuite.auth.page.login; import org.jboss.arquillian.graphene.page.Page; import org.keycloak.testsuite.auth.page.AuthRealm; import org.openqa.selenium.By; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.support.FindBy; import javax.ws.rs.core.UriBuilder; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/LoginActions.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/LoginActions.java index 484072c3e7..73ec838a4a 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/LoginActions.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/LoginActions.java @@ -16,12 +16,14 @@ */ package org.keycloak.testsuite.auth.page.login; -import javax.ws.rs.core.UriBuilder; import org.keycloak.testsuite.auth.page.AuthRealm; -import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; +import javax.ws.rs.core.UriBuilder; + +import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; + /** * * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/LoginForm.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/LoginForm.java index ec92f58081..9a38cf6705 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/LoginForm.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/LoginForm.java @@ -18,15 +18,17 @@ package org.keycloak.testsuite.auth.page.login; import org.jboss.arquillian.graphene.page.Page; import org.keycloak.representations.idm.UserRepresentation; -import org.keycloak.testsuite.page.Form; -import static org.keycloak.testsuite.admin.Users.getPasswordOf; import org.keycloak.testsuite.auth.page.account.AccountFields; import org.keycloak.testsuite.auth.page.account.PasswordFields; -import static org.keycloak.testsuite.util.WaitUtils.*; - +import org.keycloak.testsuite.page.Form; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; +import static org.keycloak.testsuite.admin.Users.getPasswordOf; +import static org.keycloak.testsuite.util.WaitUtils.waitForPageToLoad; +import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; +import static org.keycloak.testsuite.util.WaitUtils.waitUntilElementIsNotPresent; + /** * * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/PageWithLoginUrl.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/PageWithLoginUrl.java index 72cafabc2d..c6a207540a 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/PageWithLoginUrl.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/PageWithLoginUrl.java @@ -17,9 +17,10 @@ package org.keycloak.testsuite.auth.page.login; -import java.net.URI; import org.openqa.selenium.WebDriver; +import java.net.URI; + /** * Used by util class LoginAssert. Implementing classes: AuthRealm, AdminConsole. * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/Registration.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/Registration.java index a0ef5ecfc6..daf812531e 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/Registration.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/Registration.java @@ -16,16 +16,16 @@ */ package org.keycloak.testsuite.auth.page.login; -import org.keycloak.testsuite.auth.page.account.AccountFields; - -import javax.ws.rs.core.UriBuilder; import org.jboss.arquillian.graphene.page.Page; import org.keycloak.representations.idm.UserRepresentation; - -import static org.keycloak.testsuite.admin.Users.getPasswordOf; +import org.keycloak.testsuite.auth.page.account.AccountFields; import org.keycloak.testsuite.auth.page.account.ContactInfoFields; import org.keycloak.testsuite.auth.page.account.PasswordFields; +import javax.ws.rs.core.UriBuilder; + +import static org.keycloak.testsuite.admin.Users.getPasswordOf; + /** * * @author Filip Kiss diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/ResetCredentials.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/ResetCredentials.java index faf56248a1..968c087ca2 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/ResetCredentials.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/ResetCredentials.java @@ -16,14 +16,16 @@ */ package org.keycloak.testsuite.auth.page.login; -import javax.ws.rs.core.UriBuilder; import org.jboss.arquillian.graphene.page.Page; import org.keycloak.testsuite.auth.page.account.AccountFields; import org.keycloak.testsuite.auth.page.account.PasswordFields; -import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; +import javax.ws.rs.core.UriBuilder; + +import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; + /** * diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/UpdateAccount.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/UpdateAccount.java index dc3ccdb0e0..fe55695916 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/UpdateAccount.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/UpdateAccount.java @@ -17,9 +17,9 @@ package org.keycloak.testsuite.auth.page.login; -import org.keycloak.testsuite.auth.page.account.AccountFields; import org.jboss.arquillian.graphene.page.Page; import org.keycloak.representations.idm.UserRepresentation; +import org.keycloak.testsuite.auth.page.account.AccountFields; /** * diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/UpdatePassword.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/UpdatePassword.java index 7a87791983..1acb5118a1 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/UpdatePassword.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/UpdatePassword.java @@ -17,8 +17,8 @@ package org.keycloak.testsuite.auth.page.login; -import org.keycloak.testsuite.auth.page.account.PasswordFields; import org.jboss.arquillian.graphene.page.Page; +import org.keycloak.testsuite.auth.page.account.PasswordFields; /** * diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/VerifyEmail.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/VerifyEmail.java index 848a9fa37d..bb0d102e6c 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/VerifyEmail.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/VerifyEmail.java @@ -16,10 +16,11 @@ */ package org.keycloak.testsuite.auth.page.login; -import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; +import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; + /** * * @author Vlastislav Ramik diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/client/resources/TestApplicationResource.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/client/resources/TestApplicationResource.java index 2d277fd6e9..04417c751d 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/client/resources/TestApplicationResource.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/client/resources/TestApplicationResource.java @@ -20,9 +20,7 @@ package org.keycloak.testsuite.client.resources; import org.keycloak.representations.adapters.action.LogoutAction; import org.keycloak.representations.adapters.action.PushNotBeforeAction; import org.keycloak.representations.adapters.action.TestAvailabilityAction; -import org.keycloak.testsuite.rest.resource.TestingOIDCEndpointsApplicationResource; -import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.Path; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/client/resources/TestExampleCompanyResource.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/client/resources/TestExampleCompanyResource.java index 00d6e28403..bc87572ff7 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/client/resources/TestExampleCompanyResource.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/client/resources/TestExampleCompanyResource.java @@ -17,7 +17,7 @@ package org.keycloak.testsuite.client.resources; -import java.util.List; +import org.keycloak.testsuite.domainextension.CompanyRepresentation; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; @@ -28,8 +28,7 @@ import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; - -import org.keycloak.testsuite.domainextension.CompanyRepresentation; +import java.util.List; /** * @author Marek Posolda diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/client/resources/TestingResource.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/client/resources/TestingResource.java index 0dbcd58f55..9638229946 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/client/resources/TestingResource.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/client/resources/TestingResource.java @@ -17,8 +17,7 @@ package org.keycloak.testsuite.client.resources; -import java.util.List; - +import org.jboss.resteasy.annotations.cache.NoCache; import org.keycloak.representations.idm.AdminEventRepresentation; import org.keycloak.representations.idm.AuthenticationFlowRepresentation; import org.keycloak.representations.idm.EventRepresentation; @@ -35,8 +34,8 @@ import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; +import java.util.List; import java.util.Map; -import org.jboss.resteasy.annotations.cache.NoCache; /** * @author Marko Strukelj diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/AdminConsole.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/AdminConsole.java index c46b59fb30..af083ed233 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/AdminConsole.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/AdminConsole.java @@ -16,12 +16,9 @@ */ package org.keycloak.testsuite.console.page; -import java.net.URI; -import org.keycloak.testsuite.auth.page.AuthServer; -import javax.ws.rs.core.UriBuilder; import org.jboss.arquillian.graphene.page.Page; import org.keycloak.protocol.oidc.OIDCLoginProtocolService; -import static org.keycloak.testsuite.auth.page.AuthRealm.MASTER; +import org.keycloak.testsuite.auth.page.AuthServer; import org.keycloak.testsuite.auth.page.login.PageWithLoginUrl; import org.keycloak.testsuite.console.page.fragment.Menu; import org.keycloak.testsuite.console.page.fragment.ModalDialog; @@ -29,6 +26,11 @@ import org.keycloak.testsuite.page.PageWithLogOutAction; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; +import javax.ws.rs.core.UriBuilder; +import java.net.URI; + +import static org.keycloak.testsuite.auth.page.AuthRealm.MASTER; + /** * * @author Petr Mensik diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/AdminConsoleCreate.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/AdminConsoleCreate.java index db854e69b3..06b591da6f 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/AdminConsoleCreate.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/AdminConsoleCreate.java @@ -18,8 +18,9 @@ package org.keycloak.testsuite.console.page; import javax.ws.rs.core.UriBuilder; -import static org.keycloak.testsuite.console.page.AdminConsoleRealm.CONSOLE_REALM; + import static org.keycloak.testsuite.auth.page.AuthRealm.TEST; +import static org.keycloak.testsuite.console.page.AdminConsoleRealm.CONSOLE_REALM; /** * diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/AdminConsoleRealm.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/AdminConsoleRealm.java index fa42371cfd..028029550c 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/AdminConsoleRealm.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/AdminConsoleRealm.java @@ -17,14 +17,13 @@ package org.keycloak.testsuite.console.page; -import org.keycloak.admin.client.resource.RealmResource; -import static org.keycloak.testsuite.auth.page.AuthRealm.TEST; - -import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; +import static org.keycloak.testsuite.auth.page.AuthRealm.TEST; +import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; + /** * * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/AdminConsoleRealmsRoot.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/AdminConsoleRealmsRoot.java index 467dc21996..f1054e56e1 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/AdminConsoleRealmsRoot.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/AdminConsoleRealmsRoot.java @@ -17,13 +17,13 @@ package org.keycloak.testsuite.console.page; -import java.util.List; -import javax.ws.rs.core.UriBuilder; -import org.keycloak.admin.client.resource.RealmsResource; import org.keycloak.testsuite.console.page.fragment.RealmSelector; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; +import javax.ws.rs.core.UriBuilder; +import java.util.List; + /** * * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/events/Config.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/events/Config.java index 60626b9664..12b6042579 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/events/Config.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/events/Config.java @@ -19,12 +19,13 @@ package org.keycloak.testsuite.console.page.events; import org.keycloak.testsuite.console.page.fragment.OnOffSwitch; import org.keycloak.testsuite.page.Form; -import static org.keycloak.testsuite.util.WaitUtils.*; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.ui.Select; +import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; + /** * @author tkyjovsk * @author mhajas diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/fragment/Breadcrumb.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/fragment/Breadcrumb.java index 63906a5ab2..9d3c57089e 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/fragment/Breadcrumb.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/fragment/Breadcrumb.java @@ -17,10 +17,11 @@ package org.keycloak.testsuite.console.page.fragment; -import java.util.List; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; +import java.util.List; + /** * * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/fragment/DataTable.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/fragment/DataTable.java index a29814d700..4f128cd59c 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/fragment/DataTable.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/fragment/DataTable.java @@ -18,6 +18,7 @@ package org.keycloak.testsuite.console.page.fragment; import org.jboss.arquillian.drone.api.annotation.Drone; +import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; @@ -25,8 +26,6 @@ import org.openqa.selenium.support.FindBy; import java.util.List; import static org.keycloak.testsuite.util.WaitUtils.waitForPageToLoad; -import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; -import org.openqa.selenium.By; import static org.openqa.selenium.By.xpath; /** diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/fragment/Dropdown.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/fragment/Dropdown.java index 070e6c7c36..e5081e6e0e 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/fragment/Dropdown.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/fragment/Dropdown.java @@ -6,7 +6,7 @@ import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; -import static org.keycloak.testsuite.util.WaitUtils.*; +import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; /** * @author Vaclav Muzikar diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/fragment/InputList.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/fragment/InputList.java index a908310e8c..164c797084 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/fragment/InputList.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/fragment/InputList.java @@ -17,12 +17,14 @@ package org.keycloak.testsuite.console.page.fragment; -import java.util.ArrayList; -import java.util.List; -import static org.keycloak.testsuite.page.Form.getInputValue; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; +import java.util.ArrayList; +import java.util.List; + +import static org.keycloak.testsuite.page.Form.getInputValue; + /** * * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/fragment/Menu.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/fragment/Menu.java index d47f9510a1..f64e685d4d 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/fragment/Menu.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/fragment/Menu.java @@ -16,13 +16,14 @@ */ package org.keycloak.testsuite.console.page.fragment; -import java.util.List; -import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; import org.openqa.selenium.By; - import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; +import java.util.List; + +import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; + /** * * @author Petr Mensik diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/fragment/ModalDialog.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/fragment/ModalDialog.java index 57918b7dc9..2796fc41d9 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/fragment/ModalDialog.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/fragment/ModalDialog.java @@ -22,7 +22,9 @@ import org.jboss.arquillian.graphene.fragment.Root; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; -import static org.keycloak.testsuite.util.WaitUtils.*; + +import static org.keycloak.testsuite.util.WaitUtils.waitForModalFadeIn; +import static org.keycloak.testsuite.util.WaitUtils.waitForModalFadeOut; /** * diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/fragment/OnOffSwitch.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/fragment/OnOffSwitch.java index 61dd84fb2f..ccb6817add 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/fragment/OnOffSwitch.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/fragment/OnOffSwitch.java @@ -18,11 +18,12 @@ package org.keycloak.testsuite.console.page.fragment; import org.jboss.arquillian.graphene.fragment.Root; import org.jboss.arquillian.test.api.ArquillianResource; -import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.interactions.Actions; +import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; + /** * * @author Petr Mensik diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/fragment/PickList.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/fragment/PickList.java index dd966c6c27..b40e103587 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/fragment/PickList.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/fragment/PickList.java @@ -21,7 +21,6 @@ import org.jboss.arquillian.graphene.fragment.Root; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; - import org.openqa.selenium.support.ui.Select; /** diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/drone/Different.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/drone/Different.java index dc78e30d5f..606c752326 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/drone/Different.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/drone/Different.java @@ -17,13 +17,13 @@ package org.keycloak.testsuite.drone; +import org.jboss.arquillian.drone.api.annotation.Qualifier; + import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.jboss.arquillian.drone.api.annotation.Qualifier; - /** * Taken from Drone example https://docs.jboss.org/author/display/ARQ/Drone * This allows you to have more than one instance of a Drone WebDriver. diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/page/AbstractAlert.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/page/AbstractAlert.java index a0c475ff43..59f1021d36 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/page/AbstractAlert.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/page/AbstractAlert.java @@ -20,7 +20,6 @@ package org.keycloak.testsuite.page; import org.jboss.arquillian.drone.api.annotation.Drone; import org.jboss.arquillian.graphene.fragment.Root; import org.jboss.logging.Logger; - import org.keycloak.testsuite.util.WaitUtils; import org.openqa.selenium.TimeoutException; import org.openqa.selenium.WebDriver; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/page/AbstractPage.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/page/AbstractPage.java index 5ed6afd27a..4d002fc3f0 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/page/AbstractPage.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/page/AbstractPage.java @@ -17,15 +17,15 @@ package org.keycloak.testsuite.page; +import org.jboss.arquillian.drone.api.annotation.Drone; +import org.jboss.logging.Logger; +import org.keycloak.testsuite.util.URLUtils; +import org.openqa.selenium.WebDriver; + +import javax.ws.rs.core.UriBuilder; import java.net.URI; import java.util.HashMap; import java.util.Map; -import javax.ws.rs.core.UriBuilder; -import org.jboss.arquillian.drone.api.annotation.Drone; -import org.jboss.logging.Logger; - -import org.keycloak.testsuite.util.URLUtils; -import org.openqa.selenium.WebDriver; /** * diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/page/Form.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/page/Form.java index 1bec1260a2..6af4998ce9 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/page/Form.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/page/Form.java @@ -18,15 +18,14 @@ package org.keycloak.testsuite.page; import org.jboss.arquillian.drone.api.annotation.Drone; -import static org.jboss.arquillian.graphene.Graphene.guardAjax; import org.jboss.logging.Logger; -import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; - import org.keycloak.testsuite.util.WaitUtils; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; +import static org.jboss.arquillian.graphene.Graphene.guardAjax; + /** * * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/AbstractAccountPage.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/AbstractAccountPage.java index 976f2115a9..e573a4bf24 100755 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/AbstractAccountPage.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/AbstractAccountPage.java @@ -17,9 +17,7 @@ package org.keycloak.testsuite.pages; -import org.jboss.arquillian.drone.api.annotation.Drone; import org.openqa.selenium.By; -import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/IOUtil.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/IOUtil.java index 89084d4b1c..015910bf4e 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/IOUtil.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/IOUtil.java @@ -33,7 +33,14 @@ import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; -import java.io.*; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.StringWriter; import java.util.concurrent.TimeUnit; /** diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/LDAPRule.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/LDAPRule.java index 86b3caecea..7aef684350 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/LDAPRule.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/LDAPRule.java @@ -17,13 +17,13 @@ package org.keycloak.testsuite.util; -import java.util.Map; -import java.util.Properties; - import org.junit.rules.ExternalResource; import org.keycloak.models.LDAPConstants; import org.keycloak.util.ldap.LDAPEmbeddedServer; +import java.util.Map; +import java.util.Properties; + /** * @author Marek Posolda */ diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/LDAPTestConfiguration.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/LDAPTestConfiguration.java index 77c990b058..b8b7940398 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/LDAPTestConfiguration.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/LDAPTestConfiguration.java @@ -17,25 +17,22 @@ package org.keycloak.testsuite.util; -import static org.keycloak.testsuite.util.IOUtil.PROJECT_BUILD_DIRECTORY; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.util.HashMap; -import java.util.Map; - import org.apache.commons.configuration.PropertiesConfiguration; import org.jboss.logging.Logger; import org.keycloak.common.constants.GenericConstants; import org.keycloak.common.constants.KerberosConstants; -import org.keycloak.common.util.FindFile; import org.keycloak.models.LDAPConstants; import org.keycloak.models.UserFederationProvider; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.HashMap; +import java.util.Map; + +import static org.keycloak.testsuite.util.IOUtil.PROJECT_BUILD_DIRECTORY; + /** * @author Marek Posolda */ diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/MessageHandlerFactoryImpl.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/MessageHandlerFactoryImpl.java index 67a2e43872..2e5bc9f9ee 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/MessageHandlerFactoryImpl.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/MessageHandlerFactoryImpl.java @@ -8,7 +8,11 @@ import org.subethamail.smtp.RejectException; import javax.mail.MessagingException; import javax.mail.Session; import javax.mail.internet.MimeMessage; -import java.io.*; +import java.io.BufferedReader; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; import java.util.Properties; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/OAuthClient.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/OAuthClient.java index 2253828bd5..8786ff095d 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/OAuthClient.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/OAuthClient.java @@ -36,11 +36,11 @@ import org.keycloak.admin.client.Keycloak; import org.keycloak.common.VerificationException; import org.keycloak.common.util.PemUtils; import org.keycloak.constants.AdapterConstants; +import org.keycloak.jose.jwk.JSONWebKeySet; import org.keycloak.jose.jws.JWSInput; import org.keycloak.jose.jws.crypto.RSAProvider; import org.keycloak.protocol.oidc.OIDCLoginProtocol; import org.keycloak.protocol.oidc.OIDCLoginProtocolService; -import org.keycloak.jose.jwk.JSONWebKeySet; import org.keycloak.protocol.oidc.utils.OIDCResponseType; import org.keycloak.representations.AccessToken; import org.keycloak.representations.IDToken; @@ -48,7 +48,6 @@ import org.keycloak.representations.RefreshToken; import org.keycloak.testsuite.arquillian.AuthServerTestEnricher; import org.keycloak.util.BasicAuthHelper; import org.keycloak.util.JsonSerialization; - import org.keycloak.util.TokenUtil; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/SecondBrowser.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/SecondBrowser.java index ce90fb2e72..ceeb7f7b0b 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/SecondBrowser.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/SecondBrowser.java @@ -16,11 +16,12 @@ */ package org.keycloak.testsuite.util; +import org.jboss.arquillian.drone.api.annotation.Qualifier; + import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.jboss.arquillian.drone.api.annotation.Qualifier; /** * diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/Timer.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/Timer.java index a23acb6224..82c8084331 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/Timer.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/Timer.java @@ -16,6 +16,15 @@ */ package org.keycloak.testsuite.util; +import org.apache.commons.io.IOUtils; +import org.jboss.logging.Logger; +import org.jfree.chart.ChartFactory; +import org.jfree.chart.ChartUtilities; +import org.jfree.chart.JFreeChart; +import org.jfree.chart.plot.PlotOrientation; +import org.jfree.data.xy.XYSeries; +import org.jfree.data.xy.XYSeriesCollection; + import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; @@ -26,14 +35,7 @@ import java.util.Date; import java.util.List; import java.util.Map; import java.util.TreeMap; -import org.apache.commons.io.IOUtils; -import org.jboss.logging.Logger; -import org.jfree.chart.ChartFactory; -import org.jfree.chart.ChartUtilities; -import org.jfree.chart.JFreeChart; -import org.jfree.chart.plot.PlotOrientation; -import org.jfree.data.xy.XYSeries; -import org.jfree.data.xy.XYSeriesCollection; + import static org.keycloak.testsuite.util.IOUtil.PROJECT_BUILD_DIRECTORY; /** diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/URLUtils.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/URLUtils.java index 1147bc7250..ea7d72c911 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/URLUtils.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/URLUtils.java @@ -10,7 +10,10 @@ import org.openqa.selenium.support.ui.WebDriverWait; import java.util.regex.Pattern; -import static org.openqa.selenium.support.ui.ExpectedConditions.*; +import static org.openqa.selenium.support.ui.ExpectedConditions.not; +import static org.openqa.selenium.support.ui.ExpectedConditions.or; +import static org.openqa.selenium.support.ui.ExpectedConditions.urlMatches; +import static org.openqa.selenium.support.ui.ExpectedConditions.urlToBe; /** * @author Vaclav Muzikar diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/UserInfoClientUtil.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/UserInfoClientUtil.java index b5af7c9012..fc540231b4 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/UserInfoClientUtil.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/UserInfoClientUtil.java @@ -17,18 +17,17 @@ package org.keycloak.testsuite.util; -import java.net.URI; +import org.junit.Assert; +import org.keycloak.protocol.oidc.OIDCLoginProtocolService; +import org.keycloak.representations.UserInfo; +import org.keycloak.utils.MediaType; import javax.ws.rs.client.Client; import javax.ws.rs.client.WebTarget; import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriBuilder; - -import org.junit.Assert; -import org.keycloak.protocol.oidc.OIDCLoginProtocolService; -import org.keycloak.representations.UserInfo; -import org.keycloak.utils.MediaType; +import java.net.URI; /** * @author Marek Posolda diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/WaitUtils.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/WaitUtils.java index 17a8485108..280eaf894b 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/WaitUtils.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/WaitUtils.java @@ -16,10 +16,6 @@ */ package org.keycloak.testsuite.util; -import java.util.Collections; -import java.util.logging.Level; -import java.util.logging.Logger; -import static org.jboss.arquillian.graphene.Graphene.waitGui; import org.jboss.arquillian.graphene.wait.ElementBuilder; import org.openqa.selenium.By; import org.openqa.selenium.TimeoutException; @@ -27,8 +23,15 @@ import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.WebDriverWait; -import static org.jboss.arquillian.graphene.Graphene.waitModel; -import static org.openqa.selenium.support.ui.ExpectedConditions.*; +import java.util.Collections; +import java.util.logging.Level; +import java.util.logging.Logger; + +import static org.jboss.arquillian.graphene.Graphene.waitGui; +import static org.openqa.selenium.support.ui.ExpectedConditions.invisibilityOfAllElements; +import static org.openqa.selenium.support.ui.ExpectedConditions.javaScriptThrowsNoExceptions; +import static org.openqa.selenium.support.ui.ExpectedConditions.not; +import static org.openqa.selenium.support.ui.ExpectedConditions.urlContains; /** * diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/AbstractKeycloakTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/AbstractKeycloakTest.java index 2ee8f73c10..5bd733cfdf 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/AbstractKeycloakTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/AbstractKeycloakTest.java @@ -18,19 +18,6 @@ package org.keycloak.testsuite; import org.apache.commons.configuration.ConfigurationException; import org.apache.commons.configuration.PropertiesConfiguration; -import org.keycloak.common.util.KeycloakUriBuilder; -import org.keycloak.common.util.Time; -import org.keycloak.testsuite.arquillian.TestContext; - -import java.net.URI; -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.ws.rs.NotFoundException; import org.jboss.arquillian.container.test.api.RunAsClient; import org.jboss.arquillian.drone.api.annotation.Drone; import org.jboss.arquillian.graphene.page.Page; @@ -46,6 +33,8 @@ import org.keycloak.admin.client.resource.RealmResource; import org.keycloak.admin.client.resource.RealmsResource; import org.keycloak.admin.client.resource.UserResource; import org.keycloak.admin.client.resource.UsersResource; +import org.keycloak.common.util.KeycloakUriBuilder; +import org.keycloak.common.util.Time; import org.keycloak.models.Constants; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.representations.idm.RequiredActionProviderRepresentation; @@ -53,25 +42,33 @@ import org.keycloak.representations.idm.UserRepresentation; import org.keycloak.testsuite.admin.ApiUtil; import org.keycloak.testsuite.arquillian.AuthServerTestEnricher; import org.keycloak.testsuite.arquillian.SuiteContext; -import org.keycloak.testsuite.auth.page.WelcomePage; -import org.keycloak.testsuite.client.KeycloakTestingClient; -import org.keycloak.testsuite.util.OAuthClient; -import org.openqa.selenium.WebDriver; +import org.keycloak.testsuite.arquillian.TestContext; +import org.keycloak.testsuite.auth.page.AuthRealm; import org.keycloak.testsuite.auth.page.AuthServer; import org.keycloak.testsuite.auth.page.AuthServerContextRoot; -import org.keycloak.testsuite.auth.page.AuthRealm; - -import static org.keycloak.testsuite.auth.page.AuthRealm.ADMIN; -import static org.keycloak.testsuite.auth.page.AuthRealm.MASTER; - +import org.keycloak.testsuite.auth.page.WelcomePage; import org.keycloak.testsuite.auth.page.account.Account; import org.keycloak.testsuite.auth.page.login.OIDCLogin; import org.keycloak.testsuite.auth.page.login.UpdatePassword; +import org.keycloak.testsuite.client.KeycloakTestingClient; +import org.keycloak.testsuite.util.OAuthClient; +import org.keycloak.testsuite.util.TestEventsLogger; import org.keycloak.testsuite.util.WaitUtils; +import org.openqa.selenium.WebDriver; + +import javax.ws.rs.NotFoundException; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; import static org.keycloak.testsuite.admin.Users.setPasswordFor; - -import org.keycloak.testsuite.util.TestEventsLogger; +import static org.keycloak.testsuite.auth.page.AuthRealm.ADMIN; +import static org.keycloak.testsuite.auth.page.AuthRealm.MASTER; /** * diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/Assert.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/Assert.java index fda999015d..1a9c997b1f 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/Assert.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/Assert.java @@ -22,8 +22,8 @@ import org.keycloak.representations.idm.ConfigPropertyRepresentation; import org.keycloak.representations.idm.IdentityProviderRepresentation; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.representations.idm.RoleRepresentation; -import org.keycloak.representations.idm.UserRepresentation; import org.keycloak.representations.idm.UserFederationProviderFactoryRepresentation; +import org.keycloak.representations.idm.UserRepresentation; import java.util.Arrays; import java.util.LinkedList; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/TestRealmKeycloakTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/TestRealmKeycloakTest.java index 040bb4c593..869ea1ddf6 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/TestRealmKeycloakTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/TestRealmKeycloakTest.java @@ -17,19 +17,18 @@ package org.keycloak.testsuite; -import org.keycloak.OAuth2Constants; +import org.keycloak.admin.client.resource.RealmResource; import org.keycloak.common.util.reflections.Reflections; import org.keycloak.events.Details; import org.keycloak.representations.IDToken; import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.representations.idm.EventRepresentation; import org.keycloak.representations.idm.RealmRepresentation; +import org.keycloak.representations.idm.UserRepresentation; +import org.keycloak.testsuite.util.OAuthClient; import java.lang.reflect.Field; import java.util.List; -import org.keycloak.admin.client.resource.RealmResource; -import org.keycloak.representations.idm.UserRepresentation; -import org.keycloak.testsuite.util.OAuthClient; import static org.keycloak.testsuite.admin.AbstractAdminTest.loadJson; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/account/AccountTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/account/AccountTest.java index 35d11d15f4..7a65a0b2b2 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/account/AccountTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/account/AccountTest.java @@ -16,6 +16,8 @@ */ package org.keycloak.testsuite.account; +import org.jboss.arquillian.drone.api.annotation.Drone; +import org.jboss.arquillian.graphene.page.Page; import org.junit.Assert; import org.junit.Before; import org.junit.Rule; @@ -24,9 +26,15 @@ import org.keycloak.events.Details; import org.keycloak.events.Errors; import org.keycloak.events.EventType; import org.keycloak.models.utils.TimeBasedOTP; +import org.keycloak.representations.idm.EventRepresentation; +import org.keycloak.representations.idm.RealmRepresentation; +import org.keycloak.representations.idm.UserRepresentation; import org.keycloak.services.resources.AccountService; import org.keycloak.services.resources.RealmsResource; import org.keycloak.testsuite.AssertEvents; +import org.keycloak.testsuite.TestRealmKeycloakTest; +import org.keycloak.testsuite.admin.ApiUtil; +import org.keycloak.testsuite.drone.Different; import org.keycloak.testsuite.pages.AccountApplicationsPage; import org.keycloak.testsuite.pages.AccountLogPage; import org.keycloak.testsuite.pages.AccountPasswordPage; @@ -38,6 +46,9 @@ import org.keycloak.testsuite.pages.AppPage.RequestType; import org.keycloak.testsuite.pages.ErrorPage; import org.keycloak.testsuite.pages.LoginPage; import org.keycloak.testsuite.pages.RegisterPage; +import org.keycloak.testsuite.util.OAuthClient; +import org.keycloak.testsuite.util.RealmBuilder; +import org.keycloak.testsuite.util.UserBuilder; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; @@ -46,18 +57,6 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; -import org.jboss.arquillian.drone.api.annotation.Drone; -import org.jboss.arquillian.graphene.page.Page; -import org.keycloak.representations.idm.EventRepresentation; -import org.keycloak.representations.idm.RealmRepresentation; -import org.keycloak.representations.idm.UserRepresentation; -import org.keycloak.testsuite.TestRealmKeycloakTest; -import org.keycloak.testsuite.admin.ApiUtil; -import org.keycloak.testsuite.drone.Different; -import org.keycloak.testsuite.util.OAuthClient; -import org.keycloak.testsuite.util.RealmBuilder; -import org.keycloak.testsuite.util.UserBuilder; - /** * @author Stian Thorgersen * @author Stan Silvert ssilvert@redhat.com (C) 2016 Red Hat Inc. diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/account/ProfileTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/account/ProfileTest.java index a1a1813f01..4d83bd94c6 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/account/ProfileTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/account/ProfileTest.java @@ -23,14 +23,31 @@ import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.DefaultHttpClient; +import org.jboss.arquillian.graphene.page.Page; +import org.junit.Before; import org.junit.Test; import org.keycloak.OAuth2Constants; +import org.keycloak.admin.client.resource.ClientResource; +import org.keycloak.admin.client.resource.RoleMappingResource; +import org.keycloak.admin.client.resource.RoleScopeResource; +import org.keycloak.models.AccountRoles; +import org.keycloak.representations.idm.RealmRepresentation; +import org.keycloak.representations.idm.RoleRepresentation; +import org.keycloak.representations.idm.UserRepresentation; import org.keycloak.services.resources.RealmsResource; +import org.keycloak.testsuite.TestRealmKeycloakTest; +import org.keycloak.testsuite.admin.ApiUtil; import org.keycloak.testsuite.pages.AccountApplicationsPage; import org.keycloak.testsuite.pages.AccountUpdateProfilePage; import org.keycloak.testsuite.pages.LoginPage; import org.keycloak.testsuite.pages.OAuthGrantPage; +import org.keycloak.testsuite.util.ClientBuilder; +import org.keycloak.testsuite.util.RealmBuilder; +import org.keycloak.testsuite.util.RealmRepUtil; +import org.keycloak.testsuite.util.UserBuilder; import org.openqa.selenium.JavascriptExecutor; +import twitter4j.JSONArray; +import twitter4j.JSONObject; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.UriBuilder; @@ -40,23 +57,6 @@ import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.jboss.arquillian.graphene.page.Page; -import org.junit.Before; -import org.keycloak.admin.client.resource.ClientResource; -import org.keycloak.admin.client.resource.RoleMappingResource; -import org.keycloak.admin.client.resource.RoleScopeResource; -import org.keycloak.models.AccountRoles; -import org.keycloak.representations.idm.RealmRepresentation; -import org.keycloak.representations.idm.RoleRepresentation; -import org.keycloak.representations.idm.UserRepresentation; -import org.keycloak.testsuite.TestRealmKeycloakTest; -import org.keycloak.testsuite.admin.ApiUtil; -import org.keycloak.testsuite.util.ClientBuilder; -import org.keycloak.testsuite.util.RealmBuilder; -import org.keycloak.testsuite.util.RealmRepUtil; -import org.keycloak.testsuite.util.UserBuilder; -import twitter4j.JSONArray; -import twitter4j.JSONObject; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/account/TrustStoreEmailTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/account/TrustStoreEmailTest.java index 75ba24ebf1..987982e14c 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/account/TrustStoreEmailTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/account/TrustStoreEmailTest.java @@ -21,14 +21,14 @@ import org.junit.After; import org.junit.Test; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.representations.idm.UserRepresentation; - import org.keycloak.testsuite.TestRealmKeycloakTest; import org.keycloak.testsuite.auth.page.AuthRealm; import org.keycloak.testsuite.auth.page.account.AccountManagement; import org.keycloak.testsuite.auth.page.login.OIDCLogin; import org.keycloak.testsuite.auth.page.login.VerifyEmail; -import org.keycloak.testsuite.util.*; - +import org.keycloak.testsuite.util.MailServerConfiguration; +import org.keycloak.testsuite.util.RealmRepUtil; +import org.keycloak.testsuite.util.SslMailServer; import static org.junit.Assert.assertEquals; import static org.keycloak.testsuite.util.MailAssert.assertEmailAndGetUrl; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/account/custom/AbstractAccountManagementTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/account/custom/AbstractAccountManagementTest.java index 8122e0ab2c..9eda4a4f5f 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/account/custom/AbstractAccountManagementTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/account/custom/AbstractAccountManagementTest.java @@ -18,14 +18,15 @@ package org.keycloak.testsuite.account.custom; import org.jboss.arquillian.graphene.page.Page; -import static org.junit.Assert.assertTrue; import org.junit.Before; import org.keycloak.testsuite.AbstractAuthTest; -import static org.keycloak.testsuite.auth.page.AuthRealm.TEST; import org.keycloak.testsuite.auth.page.account.AccountManagement; import org.keycloak.testsuite.auth.page.account.fragment.AccountManagementAlert; import org.openqa.selenium.support.FindBy; +import static org.junit.Assert.assertTrue; +import static org.keycloak.testsuite.auth.page.AuthRealm.TEST; + /** * * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/account/custom/AbstractCustomAccountManagementTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/account/custom/AbstractCustomAccountManagementTest.java index 9b59a6048c..265b23183b 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/account/custom/AbstractCustomAccountManagementTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/account/custom/AbstractCustomAccountManagementTest.java @@ -17,13 +17,13 @@ package org.keycloak.testsuite.account.custom; -import java.util.List; - import org.junit.Before; import org.keycloak.admin.client.resource.AuthenticationManagementResource; import org.keycloak.models.AuthenticationExecutionModel; import org.keycloak.representations.idm.AuthenticationExecutionInfoRepresentation; +import java.util.List; + /** * * @author Vlastislav Ramik diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/account/custom/CustomAuthFlowCookieTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/account/custom/CustomAuthFlowCookieTest.java index 1755cb0a2e..aa86133777 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/account/custom/CustomAuthFlowCookieTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/account/custom/CustomAuthFlowCookieTest.java @@ -16,13 +16,14 @@ */ package org.keycloak.testsuite.account.custom; -import java.util.Arrays; -import static org.junit.Assert.assertEquals; -import org.junit.Test; - import org.junit.Before; +import org.junit.Test; import org.keycloak.models.AuthenticationExecutionModel.Requirement; import org.keycloak.representations.idm.ClientRepresentation; + +import java.util.Arrays; + +import static org.junit.Assert.assertEquals; import static org.keycloak.testsuite.util.OAuthClient.APP_ROOT; /** diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/account/custom/CustomAuthFlowOTPTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/account/custom/CustomAuthFlowOTPTest.java index 9334bb968a..8d34b0233e 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/account/custom/CustomAuthFlowOTPTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/account/custom/CustomAuthFlowOTPTest.java @@ -16,17 +16,26 @@ */ package org.keycloak.testsuite.account.custom; +import org.jboss.arquillian.graphene.page.Page; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.keycloak.models.AuthenticationExecutionModel.Requirement; +import org.keycloak.models.utils.TimeBasedOTP; +import org.keycloak.representations.idm.AuthenticationFlowRepresentation; +import org.keycloak.representations.idm.AuthenticatorConfigRepresentation; +import org.keycloak.representations.idm.RealmRepresentation; +import org.keycloak.representations.idm.RoleRepresentation; +import org.keycloak.testsuite.admin.Users; +import org.keycloak.testsuite.auth.page.login.OneTimeCode; + +import javax.ws.rs.core.Response; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.ws.rs.core.Response; -import org.jboss.arquillian.graphene.page.Page; -import org.junit.Assert; -import static org.junit.Assert.assertTrue; -import org.junit.Test; -import org.junit.Before; +import static org.junit.Assert.assertTrue; import static org.keycloak.authentication.authenticators.browser.ConditionalOtpFormAuthenticator.DEFAULT_OTP_OUTCOME; import static org.keycloak.authentication.authenticators.browser.ConditionalOtpFormAuthenticator.FORCE; import static org.keycloak.authentication.authenticators.browser.ConditionalOtpFormAuthenticator.FORCE_OTP_FOR_HTTP_HEADER; @@ -35,16 +44,8 @@ import static org.keycloak.authentication.authenticators.browser.ConditionalOtpF import static org.keycloak.authentication.authenticators.browser.ConditionalOtpFormAuthenticator.SKIP; import static org.keycloak.authentication.authenticators.browser.ConditionalOtpFormAuthenticator.SKIP_OTP_FOR_HTTP_HEADER; import static org.keycloak.authentication.authenticators.browser.ConditionalOtpFormAuthenticator.SKIP_OTP_ROLE; -import org.keycloak.models.AuthenticationExecutionModel.Requirement; import static org.keycloak.models.UserModel.RequiredAction.CONFIGURE_TOTP; -import org.keycloak.models.utils.TimeBasedOTP; -import org.keycloak.representations.idm.AuthenticationFlowRepresentation; -import org.keycloak.representations.idm.AuthenticatorConfigRepresentation; import static org.keycloak.representations.idm.CredentialRepresentation.PASSWORD; -import org.keycloak.representations.idm.RealmRepresentation; -import org.keycloak.representations.idm.RoleRepresentation; -import org.keycloak.testsuite.admin.Users; -import org.keycloak.testsuite.auth.page.login.OneTimeCode; import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWith; /** diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/actions/ActionUtil.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/actions/ActionUtil.java index 3b984a7c0c..a6a03ab1c7 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/actions/ActionUtil.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/actions/ActionUtil.java @@ -17,14 +17,15 @@ package org.keycloak.testsuite.actions; -import java.util.LinkedList; -import java.util.List; import org.keycloak.admin.client.Keycloak; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.representations.idm.RequiredActionProviderRepresentation; import org.keycloak.representations.idm.UserRepresentation; import org.keycloak.testsuite.util.UserBuilder; +import java.util.LinkedList; +import java.util.List; + /** * * @author Stan Silvert ssilvert@redhat.com (C) 2016 Red Hat Inc. diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/actions/RequiredActionEmailVerificationTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/actions/RequiredActionEmailVerificationTest.java index 7f14fb4dbe..54da2cb328 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/actions/RequiredActionEmailVerificationTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/actions/RequiredActionEmailVerificationTest.java @@ -16,6 +16,7 @@ */ package org.keycloak.testsuite.actions; +import org.jboss.arquillian.graphene.page.Page; import org.junit.Assert; import org.junit.Before; import org.junit.Rule; @@ -24,25 +25,23 @@ import org.keycloak.common.util.KeycloakUriBuilder; import org.keycloak.events.Details; import org.keycloak.events.Errors; import org.keycloak.events.EventType; +import org.keycloak.representations.idm.EventRepresentation; +import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.testsuite.AssertEvents; +import org.keycloak.testsuite.TestRealmKeycloakTest; import org.keycloak.testsuite.pages.AppPage; import org.keycloak.testsuite.pages.AppPage.RequestType; import org.keycloak.testsuite.pages.InfoPage; import org.keycloak.testsuite.pages.LoginPage; import org.keycloak.testsuite.pages.RegisterPage; import org.keycloak.testsuite.pages.VerifyEmailPage; +import org.keycloak.testsuite.util.GreenMailRule; +import org.keycloak.testsuite.util.MailUtils; import javax.mail.MessagingException; import javax.mail.Multipart; import javax.mail.internet.MimeMessage; - import java.io.IOException; -import org.jboss.arquillian.graphene.page.Page; -import org.keycloak.representations.idm.EventRepresentation; -import org.keycloak.representations.idm.RealmRepresentation; -import org.keycloak.testsuite.TestRealmKeycloakTest; -import org.keycloak.testsuite.util.GreenMailRule; -import org.keycloak.testsuite.util.MailUtils; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/actions/RequiredActionMultipleActionsTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/actions/RequiredActionMultipleActionsTest.java index 3c454b0602..00fb383efb 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/actions/RequiredActionMultipleActionsTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/actions/RequiredActionMultipleActionsTest.java @@ -26,8 +26,11 @@ import org.keycloak.models.UserModel.RequiredAction; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.testsuite.AssertEvents; import org.keycloak.testsuite.TestRealmKeycloakTest; -import org.keycloak.testsuite.pages.*; +import org.keycloak.testsuite.pages.AppPage; import org.keycloak.testsuite.pages.AppPage.RequestType; +import org.keycloak.testsuite.pages.LoginPage; +import org.keycloak.testsuite.pages.LoginPasswordUpdatePage; +import org.keycloak.testsuite.pages.LoginUpdateProfileEditUsernameAllowedPage; /** * @author Stian Thorgersen diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/actions/RequiredActionTotpSetupTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/actions/RequiredActionTotpSetupTest.java index 5501262088..2a1778b5c0 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/actions/RequiredActionTotpSetupTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/actions/RequiredActionTotpSetupTest.java @@ -16,8 +16,6 @@ */ package org.keycloak.testsuite.actions; -import java.util.LinkedList; -import java.util.List; import org.jboss.arquillian.graphene.page.Page; import org.junit.Assert; import org.junit.Before; @@ -45,6 +43,9 @@ import org.keycloak.testsuite.pages.LoginTotpPage; import org.keycloak.testsuite.pages.RegisterPage; import org.keycloak.testsuite.util.RealmBuilder; +import java.util.LinkedList; +import java.util.List; + /** * @author Stian Thorgersen */ diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/actions/RequiredActionUpdateProfileTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/actions/RequiredActionUpdateProfileTest.java index 2181eeaffb..df4d387012 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/actions/RequiredActionUpdateProfileTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/actions/RequiredActionUpdateProfileTest.java @@ -17,7 +17,9 @@ package org.keycloak.testsuite.actions; import org.jboss.arquillian.graphene.page.Page; -import org.junit.*; +import org.junit.Assert; +import org.junit.Rule; +import org.junit.Test; import org.keycloak.events.Details; import org.keycloak.events.EventType; import org.keycloak.models.UserModel; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/actions/TermsAndConditionsTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/actions/TermsAndConditionsTest.java index ee5f6c9996..6fbd6141df 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/actions/TermsAndConditionsTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/actions/TermsAndConditionsTest.java @@ -16,31 +16,33 @@ */ package org.keycloak.testsuite.actions; +import org.jboss.arquillian.graphene.page.Page; import org.junit.Assert; +import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.keycloak.authentication.requiredactions.TermsAndConditions; import org.keycloak.events.Details; import org.keycloak.events.Errors; import org.keycloak.events.EventType; -import org.keycloak.models.RequiredActionProviderModel; +import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.representations.idm.RequiredActionProviderRepresentation; import org.keycloak.representations.idm.UserRepresentation; import org.keycloak.testsuite.AssertEvents; +import org.keycloak.testsuite.TestRealmKeycloakTest; import org.keycloak.testsuite.pages.AppPage; import org.keycloak.testsuite.pages.AppPage.RequestType; import org.keycloak.testsuite.pages.LoginPage; import org.keycloak.testsuite.pages.TermsAndConditionsPage; +import org.keycloak.testsuite.util.UserBuilder; import java.util.List; import java.util.Map; -import org.jboss.arquillian.graphene.page.Page; -import org.junit.Before; -import org.keycloak.representations.idm.RealmRepresentation; -import org.keycloak.testsuite.TestRealmKeycloakTest; -import org.keycloak.testsuite.util.UserBuilder; -import static org.junit.Assert.*; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; /** * @author Stian Thorgersen diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/AbstractPhotozExampleAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/AbstractPhotozExampleAdapterTest.java index 9d25421724..e89b950362 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/AbstractPhotozExampleAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/AbstractPhotozExampleAdapterTest.java @@ -23,7 +23,13 @@ import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.Before; import org.junit.Test; -import org.keycloak.admin.client.resource.*; +import org.keycloak.admin.client.resource.AuthorizationResource; +import org.keycloak.admin.client.resource.ClientResource; +import org.keycloak.admin.client.resource.ClientsResource; +import org.keycloak.admin.client.resource.ResourcesResource; +import org.keycloak.admin.client.resource.RoleResource; +import org.keycloak.admin.client.resource.UserResource; +import org.keycloak.admin.client.resource.UsersResource; import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.representations.idm.RoleRepresentation; @@ -39,7 +45,11 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; -import java.util.*; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import java.util.function.Predicate; import java.util.stream.Collectors; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/EnforcerConfigTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/EnforcerConfigTest.java index 4236b2e14f..3231beb7ea 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/EnforcerConfigTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/authorization/EnforcerConfigTest.java @@ -16,7 +16,6 @@ */ package org.keycloak.testsuite.adapter.example.authorization; -import org.junit.Assert; import org.junit.Test; import org.keycloak.adapters.KeycloakDeployment; import org.keycloak.adapters.KeycloakDeploymentBuilder; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/federation/AbstractKerberosAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/federation/AbstractKerberosAdapterTest.java index 09b81b42bf..11d2f6457e 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/federation/AbstractKerberosAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/federation/AbstractKerberosAdapterTest.java @@ -17,17 +17,6 @@ package org.keycloak.testsuite.adapter.federation; -import static org.keycloak.testsuite.auth.page.AuthRealm.DEMO; -import static org.keycloak.testsuite.util.IOUtil.loadRealm; - -import java.security.Principal; -import java.util.List; -import java.util.Map; -import java.util.Properties; - -import javax.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.Response; - import org.apache.http.auth.AuthScope; import org.apache.http.auth.Credentials; import org.apache.http.client.params.AuthPolicy; @@ -67,6 +56,15 @@ import org.keycloak.testsuite.util.LDAPTestConfiguration; import org.keycloak.util.ldap.KerberosEmbeddedServer; import org.keycloak.util.ldap.LDAPEmbeddedServer; +import javax.ws.rs.core.HttpHeaders; +import javax.ws.rs.core.Response; +import java.security.Principal; +import java.util.List; +import java.util.Map; +import java.util.Properties; + +import static org.keycloak.testsuite.util.IOUtil.loadRealm; + /** * @author Marek Posolda */ diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/federation/AbstractKerberosLdapAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/federation/AbstractKerberosLdapAdapterTest.java index 127f90a4b3..e7d97b6ce7 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/federation/AbstractKerberosLdapAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/federation/AbstractKerberosLdapAdapterTest.java @@ -17,11 +17,6 @@ package org.keycloak.testsuite.adapter.federation; -import java.util.Arrays; -import java.util.Map; - -import javax.ws.rs.core.Response; - import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -36,6 +31,10 @@ import org.keycloak.representations.idm.UserFederationProviderRepresentation; import org.keycloak.representations.idm.UserRepresentation; import org.keycloak.testsuite.admin.ApiUtil; +import javax.ws.rs.core.Response; +import java.util.Arrays; +import java.util.Map; + /** * Test of LDAPFederationProvider (Kerberos backed by LDAP) * diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/federation/AbstractKerberosStandaloneAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/federation/AbstractKerberosStandaloneAdapterTest.java index cf83762ff0..08b97e7920 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/federation/AbstractKerberosStandaloneAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/federation/AbstractKerberosStandaloneAdapterTest.java @@ -17,11 +17,6 @@ package org.keycloak.testsuite.adapter.federation; -import java.util.Arrays; -import java.util.Map; - -import javax.ws.rs.core.Response; - import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -32,8 +27,10 @@ import org.keycloak.federation.kerberos.KerberosFederationProviderFactory; import org.keycloak.models.UserFederationProviderModel; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.representations.idm.UserFederationProviderRepresentation; -import org.openqa.selenium.firefox.FirefoxDriver; -import org.openqa.selenium.firefox.FirefoxProfile; + +import javax.ws.rs.core.Response; +import java.util.Arrays; +import java.util.Map; /** * Test of KerberosFederationProvider (Kerberos not backed by LDAP) diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/federation/KeycloakSPNegoSchemeFactory.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/federation/KeycloakSPNegoSchemeFactory.java index 502bfe0b99..fdd5f3feae 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/federation/KeycloakSPNegoSchemeFactory.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/federation/KeycloakSPNegoSchemeFactory.java @@ -17,10 +17,6 @@ package org.keycloak.testsuite.adapter.federation; -import java.security.PrivilegedExceptionAction; - -import javax.security.auth.Subject; - import org.apache.http.auth.AuthScheme; import org.apache.http.auth.Credentials; import org.apache.http.impl.auth.SPNegoScheme; @@ -34,6 +30,9 @@ import org.ietf.jgss.Oid; import org.keycloak.federation.kerberos.CommonKerberosConfig; import org.keycloak.federation.kerberos.impl.KerberosUsernamePasswordAuthenticator; +import javax.security.auth.Subject; +import java.security.PrivilegedExceptionAction; + /** * Usable for testing only. Username and password are shared for the whole factory * diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/AbstractDemoServletsAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/AbstractDemoServletsAdapterTest.java index 065de7768d..cfb1818c76 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/AbstractDemoServletsAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/AbstractDemoServletsAdapterTest.java @@ -40,7 +40,15 @@ import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.representations.idm.UserRepresentation; import org.keycloak.testsuite.adapter.AbstractServletsAdapterTest; import org.keycloak.testsuite.adapter.filter.AdapterActionsFilter; -import org.keycloak.testsuite.adapter.page.*; +import org.keycloak.testsuite.adapter.page.BasicAuth; +import org.keycloak.testsuite.adapter.page.CustomerDb; +import org.keycloak.testsuite.adapter.page.CustomerDbErrorPage; +import org.keycloak.testsuite.adapter.page.CustomerPortal; +import org.keycloak.testsuite.adapter.page.CustomerPortalSubsystem; +import org.keycloak.testsuite.adapter.page.InputPortal; +import org.keycloak.testsuite.adapter.page.ProductPortal; +import org.keycloak.testsuite.adapter.page.SecurePortal; +import org.keycloak.testsuite.adapter.page.TokenMinTTLPage; import org.keycloak.testsuite.admin.ApiUtil; import org.keycloak.testsuite.auth.page.account.Applications; import org.keycloak.testsuite.auth.page.login.OAuthGrant; @@ -70,7 +78,11 @@ import java.util.concurrent.TimeUnit; import java.util.regex.Matcher; import java.util.regex.Pattern; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; import static org.keycloak.testsuite.auth.page.AuthRealm.DEMO; import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlEquals; import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWithLoginUrlOf; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/AbstractSAMLServletsAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/AbstractSAMLServletsAdapterTest.java index 5bdd305b6a..9db0e516ac 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/AbstractSAMLServletsAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/AbstractSAMLServletsAdapterTest.java @@ -34,7 +34,26 @@ import org.keycloak.saml.BaseSAML2BindingBuilder; import org.keycloak.saml.SAML2ErrorResponseBuilder; import org.keycloak.saml.common.constants.JBossSAMLURIConstants; import org.keycloak.testsuite.adapter.AbstractServletsAdapterTest; -import org.keycloak.testsuite.adapter.page.*; +import org.keycloak.testsuite.adapter.page.BadAssertionSalesPostSig; +import org.keycloak.testsuite.adapter.page.BadClientSalesPostSigServlet; +import org.keycloak.testsuite.adapter.page.BadRealmSalesPostSigServlet; +import org.keycloak.testsuite.adapter.page.Employee2Servlet; +import org.keycloak.testsuite.adapter.page.EmployeeServlet; +import org.keycloak.testsuite.adapter.page.EmployeeSigFrontServlet; +import org.keycloak.testsuite.adapter.page.EmployeeSigServlet; +import org.keycloak.testsuite.adapter.page.InputPortal; +import org.keycloak.testsuite.adapter.page.MissingAssertionSig; +import org.keycloak.testsuite.adapter.page.SAMLServlet; +import org.keycloak.testsuite.adapter.page.SalesMetadataServlet; +import org.keycloak.testsuite.adapter.page.SalesPost2Servlet; +import org.keycloak.testsuite.adapter.page.SalesPostAssertionAndResponseSig; +import org.keycloak.testsuite.adapter.page.SalesPostEncServlet; +import org.keycloak.testsuite.adapter.page.SalesPostPassiveServlet; +import org.keycloak.testsuite.adapter.page.SalesPostServlet; +import org.keycloak.testsuite.adapter.page.SalesPostSigEmailServlet; +import org.keycloak.testsuite.adapter.page.SalesPostSigPersistentServlet; +import org.keycloak.testsuite.adapter.page.SalesPostSigServlet; +import org.keycloak.testsuite.adapter.page.SalesPostSigTransientServlet; import org.keycloak.testsuite.admin.ApiUtil; import org.keycloak.testsuite.auth.page.login.Login; import org.keycloak.testsuite.auth.page.login.SAMLIDPInitiatedLogin; @@ -56,7 +75,9 @@ import java.util.Map; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.keycloak.testsuite.auth.page.AuthRealm.SAMLSERVLETDEMO; -import static org.keycloak.testsuite.util.IOUtil.*; +import static org.keycloak.testsuite.util.IOUtil.loadRealm; +import static org.keycloak.testsuite.util.IOUtil.loadXML; +import static org.keycloak.testsuite.util.IOUtil.modifyDocElementAttribute; import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWith; import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/AbstractSessionServletAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/AbstractSessionServletAdapterTest.java index 0bce8a6780..a018bddc7b 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/AbstractSessionServletAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/AbstractSessionServletAdapterTest.java @@ -17,17 +17,11 @@ package org.keycloak.testsuite.adapter.servlet; -import org.keycloak.testsuite.adapter.AbstractServletsAdapterTest; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.drone.api.annotation.Drone; import org.jboss.arquillian.graphene.page.Page; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.After; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - import org.junit.Test; import org.keycloak.OAuth2Constants; import org.keycloak.admin.client.resource.ClientResource; @@ -35,21 +29,21 @@ import org.keycloak.protocol.oidc.OIDCLoginProtocolService; import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.representations.idm.UserRepresentation; +import org.keycloak.testsuite.adapter.AbstractServletsAdapterTest; import org.keycloak.testsuite.adapter.page.SessionPortal; - -import static org.keycloak.testsuite.auth.page.AuthRealm.DEMO; - import org.keycloak.testsuite.auth.page.account.Sessions; import org.keycloak.testsuite.auth.page.login.Login; - -import static org.keycloak.testsuite.admin.ApiUtil.findClientResourceByClientId; -import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlEquals; -import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWithLoginUrlOf; - import org.keycloak.testsuite.util.SecondBrowser; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.keycloak.testsuite.auth.page.AuthRealm.DEMO; +import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlEquals; +import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWithLoginUrlOf; + /** * * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/AbstractAdminTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/AbstractAdminTest.java index e538dcc5e5..b09209d5fe 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/AbstractAdminTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/AbstractAdminTest.java @@ -17,29 +17,23 @@ package org.keycloak.testsuite.admin; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.List; -import java.util.Map; import org.junit.After; import org.junit.Before; import org.junit.Rule; import org.keycloak.admin.client.resource.RealmResource; import org.keycloak.events.log.JBossLoggingEventListenerProviderFactory; -import org.keycloak.representations.idm.ClientRepresentation; -import org.keycloak.representations.idm.IdentityProviderRepresentation; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.testsuite.TestRealmKeycloakTest; import org.keycloak.testsuite.events.EventsListenerProviderFactory; import org.keycloak.testsuite.util.AssertAdminEvents; import org.keycloak.util.JsonSerialization; -import static org.junit.Assert.assertArrayEquals; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * This class adapts the functionality from the old testsuite to make tests diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/ApiUtil.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/ApiUtil.java index 006dc920ec..4d55e976b4 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/ApiUtil.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/ApiUtil.java @@ -24,22 +24,21 @@ import org.keycloak.admin.client.resource.RoleResource; import org.keycloak.admin.client.resource.UserResource; import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.representations.idm.CredentialRepresentation; +import org.keycloak.representations.idm.GroupRepresentation; import org.keycloak.representations.idm.ProtocolMapperRepresentation; import org.keycloak.representations.idm.RoleRepresentation; import org.keycloak.representations.idm.UserRepresentation; import javax.ws.rs.core.Response; +import javax.ws.rs.core.Response.Status; +import javax.ws.rs.core.Response.StatusType; import java.net.URI; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import javax.ws.rs.core.Response.Status; -import javax.ws.rs.core.Response.StatusType; import static org.keycloak.representations.idm.CredentialRepresentation.PASSWORD; -import org.keycloak.representations.idm.GroupRepresentation; - /** * @author Stan Silvert ssilvert@redhat.com (C) 2016 Red Hat Inc. */ diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/ClientRegTrustedHostTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/ClientRegTrustedHostTest.java index f430e6ac3c..3d237b64dd 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/ClientRegTrustedHostTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/ClientRegTrustedHostTest.java @@ -17,10 +17,6 @@ package org.keycloak.testsuite.admin; -import java.util.List; - -import javax.ws.rs.core.Response; - import org.junit.Before; import org.junit.Test; import org.keycloak.admin.client.resource.ClientRegistrationTrustedHostResource; @@ -30,6 +26,9 @@ import org.keycloak.representations.idm.ClientRegistrationTrustedHostRepresentat import org.keycloak.testsuite.Assert; import org.keycloak.testsuite.util.AdminEventPaths; +import javax.ws.rs.core.Response; +import java.util.List; + /** * @author Marek Posolda */ diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/ClientTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/ClientTest.java index b6f9bdea8b..35892914f4 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/ClientTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/ClientTest.java @@ -31,16 +31,12 @@ import org.keycloak.protocol.oidc.OIDCLoginProtocolFactory; import org.keycloak.representations.adapters.action.GlobalRequestResult; import org.keycloak.representations.adapters.action.PushNotBeforeAction; import org.keycloak.representations.adapters.action.TestAvailabilityAction; -import org.keycloak.representations.idm.*; - -import javax.ws.rs.BadRequestException; -import javax.ws.rs.NotFoundException; -import javax.ws.rs.core.Response; - -import java.io.IOException; -import java.util.*; - -import org.keycloak.services.ErrorResponseException; +import org.keycloak.representations.idm.ClientRepresentation; +import org.keycloak.representations.idm.OAuth2ErrorRepresentation; +import org.keycloak.representations.idm.ProtocolMapperRepresentation; +import org.keycloak.representations.idm.RoleRepresentation; +import org.keycloak.representations.idm.UserRepresentation; +import org.keycloak.representations.idm.UserSessionRepresentation; import org.keycloak.testsuite.Assert; import org.keycloak.testsuite.util.AdminEventPaths; import org.keycloak.testsuite.util.ClientBuilder; @@ -50,6 +46,16 @@ import org.keycloak.testsuite.util.OAuthClient.AccessTokenResponse; import org.keycloak.testsuite.util.RoleBuilder; import org.keycloak.testsuite.util.UserBuilder; +import javax.ws.rs.BadRequestException; +import javax.ws.rs.NotFoundException; +import javax.ws.rs.core.Response; +import java.io.IOException; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/ConcurrencyTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/ConcurrencyTest.java index aae27943a0..157a98d71d 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/ConcurrencyTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/ConcurrencyTest.java @@ -37,7 +37,8 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; -import static org.junit.Assert.*; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.fail; /** * @author Stian Thorgersen diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/IdentityProviderTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/IdentityProviderTest.java index b9102e118a..13f15f845e 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/IdentityProviderTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/IdentityProviderTest.java @@ -39,7 +39,6 @@ import org.keycloak.testsuite.util.AdminEventPaths; import javax.ws.rs.NotFoundException; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; - import java.io.ByteArrayInputStream; import java.io.IOException; import java.net.URI; @@ -55,7 +54,10 @@ import java.util.List; import java.util.Map; import java.util.Set; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; /** * @author Stian Thorgersen diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/PermissionsTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/PermissionsTest.java index b6fca90ed3..b2369c77c4 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/PermissionsTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/PermissionsTest.java @@ -17,7 +17,6 @@ package org.keycloak.testsuite.admin; -import org.apache.bcel.generic.RETURN; import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataOutput; import org.junit.Rule; import org.junit.Test; @@ -73,7 +72,9 @@ import java.util.List; import java.util.Map; import java.util.concurrent.atomic.AtomicReference; -import static org.junit.Assert.*; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.fail; import static org.keycloak.services.resources.admin.RealmAuth.Resource.AUTHORIZATION; import static org.keycloak.services.resources.admin.RealmAuth.Resource.CLIENT; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/RoleByIdResourceTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/RoleByIdResourceTest.java index 9297b0fe4e..77c4ea742e 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/RoleByIdResourceTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/RoleByIdResourceTest.java @@ -36,7 +36,11 @@ import java.util.List; import java.util.Map; import java.util.Set; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; /** * @author Stian Thorgersen diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/ServerInfoTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/ServerInfoTest.java index ae17a70223..cd8fbf38e2 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/ServerInfoTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/ServerInfoTest.java @@ -25,7 +25,8 @@ import org.keycloak.testsuite.AbstractKeycloakTest; import java.util.List; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; /** * @author Stian Thorgersen diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/UserFederationLdapConnectionTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/UserFederationLdapConnectionTest.java index dc48b7d92b..52bfc69b08 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/UserFederationLdapConnectionTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/UserFederationLdapConnectionTest.java @@ -17,14 +17,14 @@ package org.keycloak.testsuite.admin; -import javax.ws.rs.core.Response; - import org.junit.ClassRule; import org.junit.Test; import org.keycloak.services.managers.LDAPConnectionTestManager; import org.keycloak.testsuite.Assert; import org.keycloak.testsuite.util.LDAPRule; +import javax.ws.rs.core.Response; + /** * @author Marek Posolda */ diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/UserFederationMapperTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/UserFederationMapperTest.java index 6ee35a76c2..dce490ec95 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/UserFederationMapperTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/UserFederationMapperTest.java @@ -17,17 +17,6 @@ package org.keycloak.testsuite.admin; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.ws.rs.BadRequestException; -import javax.ws.rs.NotFoundException; -import javax.ws.rs.core.Response; - import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -48,6 +37,16 @@ import org.keycloak.testsuite.federation.DummyUserFederationMapper; import org.keycloak.testsuite.util.AdminEventPaths; import org.keycloak.testsuite.util.UserFederationProviderBuilder; +import javax.ws.rs.BadRequestException; +import javax.ws.rs.NotFoundException; +import javax.ws.rs.core.Response; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + /** * @author Marek Posolda */ diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/UserFederationTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/UserFederationTest.java index 8cef8a1bbc..48db1b509f 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/UserFederationTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/UserFederationTest.java @@ -17,15 +17,6 @@ package org.keycloak.testsuite.admin; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -import javax.ws.rs.BadRequestException; -import javax.ws.rs.NotFoundException; -import javax.ws.rs.core.Response; - import org.junit.Test; import org.keycloak.admin.client.resource.UserFederationProvidersResource; import org.keycloak.common.constants.KerberosConstants; @@ -43,6 +34,14 @@ import org.keycloak.testsuite.admin.authentication.AbstractAuthenticationTest; import org.keycloak.testsuite.util.AdminEventPaths; import org.keycloak.testsuite.util.UserFederationProviderBuilder; +import javax.ws.rs.BadRequestException; +import javax.ws.rs.NotFoundException; +import javax.ws.rs.core.Response; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + /** * @author Marek Posolda */ diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/UserTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/UserTest.java index c87bdf13fe..c3f6c0d86d 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/UserTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/UserTest.java @@ -66,7 +66,10 @@ import java.util.Collections; import java.util.LinkedList; import java.util.List; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; import static org.keycloak.testsuite.Assert.assertNames; /** diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/UserTotpTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/UserTotpTest.java index 28f0305d7c..5ebe415c59 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/UserTotpTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/UserTotpTest.java @@ -21,7 +21,6 @@ import org.jboss.arquillian.graphene.page.Page; import org.junit.Assert; import org.junit.Rule; import org.junit.Test; -import org.keycloak.admin.client.resource.UsersResource; import org.keycloak.events.Details; import org.keycloak.events.EventType; import org.keycloak.events.admin.OperationType; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/authentication/AbstractAuthenticationTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/authentication/AbstractAuthenticationTest.java index c32ba08618..540a5dc135 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/authentication/AbstractAuthenticationTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/authentication/AbstractAuthenticationTest.java @@ -34,12 +34,11 @@ import org.keycloak.testsuite.util.AdminEventPaths; import org.keycloak.testsuite.util.AssertAdminEvents; import org.keycloak.testsuite.util.RealmBuilder; +import javax.ws.rs.core.Response; import java.util.Arrays; import java.util.LinkedHashMap; import java.util.List; -import javax.ws.rs.core.Response; - /** * @author Marko Strukelj diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/authentication/AuthenticatorConfigTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/authentication/AuthenticatorConfigTest.java index 00c1943479..64f862205f 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/authentication/AuthenticatorConfigTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/authentication/AuthenticatorConfigTest.java @@ -17,16 +17,8 @@ package org.keycloak.testsuite.admin.authentication; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.ws.rs.NotFoundException; -import javax.ws.rs.core.Response; - import org.junit.Before; import org.junit.Test; -import org.keycloak.authentication.authenticators.broker.IdpCreateUserIfUniqueAuthenticator; import org.keycloak.authentication.authenticators.broker.IdpCreateUserIfUniqueAuthenticatorFactory; import org.keycloak.events.admin.OperationType; import org.keycloak.events.admin.ResourceType; @@ -36,7 +28,12 @@ import org.keycloak.representations.idm.AuthenticatorConfigRepresentation; import org.keycloak.testsuite.Assert; import org.keycloak.testsuite.admin.ApiUtil; import org.keycloak.testsuite.util.AdminEventPaths; -import org.keycloak.testsuite.util.AssertAdminEvents; + +import javax.ws.rs.NotFoundException; +import javax.ws.rs.core.Response; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * @author Marek Posolda diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/authentication/InitialFlowsTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/authentication/InitialFlowsTest.java index ee79c27213..0ec5c8c0aa 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/authentication/InitialFlowsTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/authentication/InitialFlowsTest.java @@ -24,8 +24,6 @@ import org.keycloak.representations.idm.AuthenticationExecutionInfoRepresentatio import org.keycloak.representations.idm.AuthenticationFlowRepresentation; import org.keycloak.representations.idm.AuthenticatorConfigRepresentation; -import javax.ws.rs.core.GenericType; -import javax.ws.rs.core.Response; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/authentication/ProvidersTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/authentication/ProvidersTest.java index 4e07e6fbcc..9604d03dd8 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/authentication/ProvidersTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/authentication/ProvidersTest.java @@ -23,6 +23,7 @@ import org.keycloak.representations.idm.AuthenticatorConfigInfoRepresentation; import org.keycloak.representations.idm.ConfigPropertyRepresentation; import org.keycloak.testsuite.Assert; +import javax.ws.rs.NotFoundException; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; @@ -31,8 +32,6 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; -import javax.ws.rs.NotFoundException; - /** * @author Marko Strukelj */ diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/authentication/RegistrationFlowTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/authentication/RegistrationFlowTest.java index c38086ba01..ce5f344d5f 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/authentication/RegistrationFlowTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/authentication/RegistrationFlowTest.java @@ -17,12 +17,6 @@ package org.keycloak.testsuite.admin.authentication; -import java.util.HashMap; -import java.util.Map; - -import javax.ws.rs.BadRequestException; -import javax.ws.rs.core.Response; - import org.junit.Assert; import org.junit.Test; import org.keycloak.events.admin.OperationType; @@ -30,6 +24,10 @@ import org.keycloak.events.admin.ResourceType; import org.keycloak.representations.idm.AuthenticationFlowRepresentation; import org.keycloak.testsuite.util.AdminEventPaths; +import javax.ws.rs.BadRequestException; +import java.util.HashMap; +import java.util.Map; + /** * @author Marek Posolda */ diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/authentication/RequiredActionsTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/authentication/RequiredActionsTest.java index 1b7f79f144..6d28c121e7 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/authentication/RequiredActionsTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/authentication/RequiredActionsTest.java @@ -26,6 +26,7 @@ import org.keycloak.representations.idm.RequiredActionProviderSimpleRepresentati import org.keycloak.testsuite.actions.DummyRequiredActionFactory; import org.keycloak.testsuite.util.AdminEventPaths; +import javax.ws.rs.NotFoundException; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; @@ -33,8 +34,6 @@ import java.util.Iterator; import java.util.List; import java.util.Map; -import javax.ws.rs.NotFoundException; - /** * @author Marko Strukelj */ diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/authentication/ShiftExecutionTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/authentication/ShiftExecutionTest.java index ac2ab44366..b4c9a701a5 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/authentication/ShiftExecutionTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/authentication/ShiftExecutionTest.java @@ -24,8 +24,8 @@ import org.keycloak.events.admin.ResourceType; import org.keycloak.representations.idm.AuthenticationExecutionInfoRepresentation; import org.keycloak.testsuite.util.AdminEventPaths; -import javax.ws.rs.NotFoundException; import javax.ws.rs.BadRequestException; +import javax.ws.rs.NotFoundException; import javax.ws.rs.core.Response; import java.util.HashMap; import java.util.List; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/AbstractClientTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/AbstractClientTest.java index 813f0678b6..75818b2427 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/AbstractClientTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/AbstractClientTest.java @@ -17,9 +17,6 @@ package org.keycloak.testsuite.admin.client; -import java.util.List; -import javax.ws.rs.core.Response; - import org.junit.After; import org.junit.Before; import org.junit.Rule; @@ -36,6 +33,9 @@ import org.keycloak.testsuite.util.AdminEventPaths; import org.keycloak.testsuite.util.AssertAdminEvents; import org.keycloak.testsuite.util.RealmBuilder; +import javax.ws.rs.core.Response; +import java.util.List; + /** * * @author Stan Silvert ssilvert@redhat.com (C) 2016 Red Hat Inc. diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/AbstractProtocolMapperTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/AbstractProtocolMapperTest.java index af7cf3b517..c807f475bf 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/AbstractProtocolMapperTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/AbstractProtocolMapperTest.java @@ -17,13 +17,6 @@ package org.keycloak.testsuite.admin.client; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - import com.fasterxml.jackson.core.type.TypeReference; import org.keycloak.admin.client.resource.ProtocolMappersResource; import org.keycloak.events.admin.OperationType; @@ -33,6 +26,13 @@ import org.keycloak.representations.idm.ProtocolMapperRepresentation; import org.keycloak.testsuite.Assert; import org.keycloak.util.JsonSerialization; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/ClientProtocolMapperTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/ClientProtocolMapperTest.java index 3f609b7477..53098ffb58 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/ClientProtocolMapperTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/ClientProtocolMapperTest.java @@ -17,8 +17,6 @@ package org.keycloak.testsuite.admin.client; -import javax.ws.rs.NotFoundException; -import javax.ws.rs.core.Response; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -31,6 +29,9 @@ import org.keycloak.testsuite.Assert; import org.keycloak.testsuite.admin.ApiUtil; import org.keycloak.testsuite.util.AdminEventPaths; +import javax.ws.rs.NotFoundException; +import javax.ws.rs.core.Response; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/ClientTemplateProtocolMapperTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/ClientTemplateProtocolMapperTest.java index 5a82f0d939..b8a47961f4 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/ClientTemplateProtocolMapperTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/ClientTemplateProtocolMapperTest.java @@ -17,9 +17,6 @@ package org.keycloak.testsuite.admin.client; -import javax.ws.rs.NotFoundException; -import javax.ws.rs.core.Response; - import org.junit.After; import org.junit.Assert; import org.junit.Before; @@ -37,6 +34,9 @@ import org.keycloak.representations.idm.ProtocolMapperRepresentation; import org.keycloak.testsuite.admin.ApiUtil; import org.keycloak.testsuite.util.AdminEventPaths; +import javax.ws.rs.NotFoundException; +import javax.ws.rs.core.Response; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/ClientTemplateTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/ClientTemplateTest.java index 113630a828..cb13681add 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/ClientTemplateTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/ClientTemplateTest.java @@ -17,16 +17,6 @@ package org.keycloak.testsuite.admin.client; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import javax.ws.rs.BadRequestException; -import javax.ws.rs.NotFoundException; -import javax.ws.rs.core.Response; - import org.junit.Assert; import org.junit.Test; import org.keycloak.admin.client.resource.ClientTemplatesResource; @@ -45,6 +35,15 @@ import org.keycloak.representations.idm.RoleRepresentation; import org.keycloak.testsuite.admin.ApiUtil; import org.keycloak.testsuite.util.AdminEventPaths; +import javax.ws.rs.BadRequestException; +import javax.ws.rs.NotFoundException; +import javax.ws.rs.core.Response; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + import static org.junit.Assert.assertEquals; /** diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/ClientTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/ClientTest.java index 5dddbc5126..4adee16752 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/ClientTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/ClientTest.java @@ -17,8 +17,6 @@ package org.keycloak.testsuite.admin.client; -import java.util.List; - import org.junit.Test; import org.keycloak.admin.client.resource.ClientResource; import org.keycloak.events.admin.OperationType; @@ -26,6 +24,8 @@ import org.keycloak.events.admin.ResourceType; import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.testsuite.util.AdminEventPaths; +import java.util.List; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/CredentialsTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/CredentialsTest.java index b76e6704a7..c6468d6008 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/CredentialsTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/CredentialsTest.java @@ -22,17 +22,16 @@ import org.junit.Before; import org.junit.Test; import org.keycloak.admin.client.resource.ClientAttributeCertificateResource; import org.keycloak.admin.client.resource.ClientResource; +import org.keycloak.events.admin.OperationType; import org.keycloak.events.admin.ResourceType; import org.keycloak.models.utils.KeycloakModelUtils; import org.keycloak.representations.KeyStoreConfig; -import org.keycloak.events.admin.OperationType; import org.keycloak.representations.idm.CertificateRepresentation; import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.representations.idm.CredentialRepresentation; import org.keycloak.testsuite.util.AdminEventPaths; import javax.ws.rs.core.MediaType; - import java.io.ByteArrayInputStream; import java.net.URL; import java.nio.charset.Charset; @@ -44,8 +43,8 @@ import java.security.cert.Certificate; import java.security.cert.X509Certificate; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/InstallationTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/InstallationTest.java index c7339ed12d..bac5fc0fc8 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/InstallationTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/InstallationTest.java @@ -24,8 +24,8 @@ import org.keycloak.admin.client.resource.ClientResource; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.testsuite.arquillian.AuthServerTestEnricher; -import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; /** * Test getting the installation/configuration files for OIDC and SAML. diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/SessionTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/SessionTest.java index 0ba2a41ad8..e25533fc93 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/SessionTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/SessionTest.java @@ -17,7 +17,6 @@ package org.keycloak.testsuite.admin.client; -import java.util.List; import org.jboss.arquillian.graphene.page.Page; import org.junit.Before; import org.junit.Test; @@ -29,6 +28,8 @@ import org.keycloak.representations.idm.UserSessionRepresentation; import org.keycloak.testsuite.auth.page.account.AccountManagement; import org.keycloak.testsuite.util.AdminEventPaths; +import java.util.List; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/event/AbstractEventTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/event/AbstractEventTest.java index 597556cea5..03df30e9f2 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/event/AbstractEventTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/event/AbstractEventTest.java @@ -17,12 +17,13 @@ package org.keycloak.testsuite.admin.event; -import java.util.Collections; import org.junit.Before; import org.keycloak.admin.client.resource.RealmResource; import org.keycloak.representations.idm.RealmEventsConfigRepresentation; import org.keycloak.testsuite.AbstractAuthTest; +import java.util.Collections; + /** * * @author Stan Silvert ssilvert@redhat.com (C) 2016 Red Hat Inc. diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/event/AdminEventAuthDetailsTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/event/AdminEventAuthDetailsTest.java index 195f733665..3c388bb354 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/event/AdminEventAuthDetailsTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/event/AdminEventAuthDetailsTest.java @@ -17,9 +17,6 @@ package org.keycloak.testsuite.admin.event; -import java.util.Collections; -import java.util.List; - import org.junit.Before; import org.junit.ComparisonFailure; import org.junit.Rule; @@ -43,6 +40,9 @@ import org.keycloak.testsuite.util.ClientBuilder; import org.keycloak.testsuite.util.RealmBuilder; import org.keycloak.testsuite.util.UserBuilder; +import java.util.Collections; +import java.util.List; + import static org.keycloak.testsuite.auth.page.AuthRealm.ADMIN; import static org.keycloak.testsuite.auth.page.AuthRealm.MASTER; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/event/AdminEventTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/event/AdminEventTest.java index d7c0845626..2d48ccc3c8 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/event/AdminEventTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/event/AdminEventTest.java @@ -17,9 +17,6 @@ package org.keycloak.testsuite.admin.event; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; import org.junit.Before; import org.junit.Test; import org.keycloak.representations.idm.AdminEventRepresentation; @@ -28,6 +25,10 @@ import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.representations.idm.UserRepresentation; import org.keycloak.testsuite.admin.ApiUtil; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/event/EventConfigTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/event/EventConfigTest.java index 53a07ccf34..07e371567e 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/event/EventConfigTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/event/EventConfigTest.java @@ -17,10 +17,11 @@ package org.keycloak.testsuite.admin.event; +import org.junit.Test; + import java.util.Arrays; import java.util.Collections; import java.util.List; -import org.junit.Test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/event/LoginEventsTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/event/LoginEventsTest.java index fa44674e3c..a4fa8be87e 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/event/LoginEventsTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/event/LoginEventsTest.java @@ -17,15 +17,16 @@ package org.keycloak.testsuite.admin.event; -import java.util.Arrays; -import java.util.List; -import java.util.Map; import org.jboss.arquillian.graphene.page.Page; import org.junit.Before; import org.junit.Test; import org.keycloak.representations.idm.EventRepresentation; import org.keycloak.testsuite.console.page.events.LoginEvents; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/group/AbstractGroupTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/group/AbstractGroupTest.java index b7c98c3bbc..4574de1331 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/group/AbstractGroupTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/group/AbstractGroupTest.java @@ -17,7 +17,6 @@ package org.keycloak.testsuite.admin.group; -import org.junit.Before; import org.junit.Rule; import org.keycloak.OAuth2Constants; import org.keycloak.RSATokenVerifier; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/group/GroupTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/group/GroupTest.java index 0543238e03..f44cc2e668 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/group/GroupTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/group/GroupTest.java @@ -17,7 +17,6 @@ package org.keycloak.testsuite.admin.group; -import org.hamcrest.Matchers; import org.junit.Assert; import org.junit.Test; import org.keycloak.admin.client.resource.RealmResource; @@ -25,7 +24,6 @@ import org.keycloak.admin.client.resource.RoleMappingResource; import org.keycloak.events.admin.OperationType; import org.keycloak.events.admin.ResourceType; import org.keycloak.models.Constants; -import org.keycloak.models.RoleModel; import org.keycloak.representations.AccessToken; import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.representations.idm.CredentialRepresentation; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/partialimport/PartialImportTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/partialimport/PartialImportTest.java index 168a6e1e20..bd3d785e78 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/partialimport/PartialImportTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/partialimport/PartialImportTest.java @@ -16,16 +16,6 @@ */ package org.keycloak.testsuite.admin.partialimport; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.ws.rs.core.Response; - import org.junit.After; import org.junit.Before; import org.junit.Rule; @@ -42,24 +32,31 @@ import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.representations.idm.GroupRepresentation; import org.keycloak.representations.idm.IdentityProviderRepresentation; import org.keycloak.representations.idm.PartialImportRepresentation; +import org.keycloak.representations.idm.PartialImportRepresentation.Policy; import org.keycloak.representations.idm.RealmRepresentation; +import org.keycloak.representations.idm.RoleRepresentation; +import org.keycloak.representations.idm.RolesRepresentation; import org.keycloak.representations.idm.UserRepresentation; import org.keycloak.testsuite.AbstractAuthTest; +import org.keycloak.testsuite.Assert; +import org.keycloak.testsuite.admin.ApiUtil; +import org.keycloak.testsuite.util.AssertAdminEvents; +import org.keycloak.testsuite.util.RealmBuilder; + +import javax.ws.rs.core.Response; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; -import org.keycloak.representations.idm.PartialImportRepresentation.Policy; -import org.keycloak.representations.idm.RoleRepresentation; -import org.keycloak.representations.idm.RolesRepresentation; -import org.keycloak.testsuite.Assert; -import org.keycloak.testsuite.admin.ApiUtil; -import org.keycloak.testsuite.util.AdminEventPaths; -import org.keycloak.testsuite.util.AssertAdminEvents; -import org.keycloak.testsuite.util.RealmBuilder; - /** * Tests for the partial import endpoint in admin client. Also tests the * server side functionality of each resource along with "fail, skip, overwrite" diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/realm/RealmTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/realm/RealmTest.java index 926d31d5ad..522f79478a 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/realm/RealmTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/realm/RealmTest.java @@ -52,15 +52,21 @@ import javax.ws.rs.BadRequestException; import javax.ws.rs.NotFoundException; import javax.ws.rs.core.Response; import java.io.IOException; +import java.util.Arrays; import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; import java.util.LinkedList; import java.util.List; -import java.util.HashSet; -import java.util.Arrays; -import java.util.HashMap; import java.util.Map; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; /** * @author Stian Thorgersen diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/AbstractBrokerTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/AbstractBrokerTest.java index 29f796f6f5..18852804de 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/AbstractBrokerTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/AbstractBrokerTest.java @@ -1,13 +1,5 @@ package org.keycloak.testsuite.broker; -import static org.junit.Assert.assertEquals; -import static org.keycloak.testsuite.admin.ApiUtil.createUserWithAdminClient; -import static org.keycloak.testsuite.admin.ApiUtil.resetUserPassword; - -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.util.List; - import org.jboss.arquillian.graphene.page.Page; import org.junit.Before; import org.junit.Test; @@ -31,6 +23,14 @@ import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.ExpectedCondition; import org.openqa.selenium.support.ui.WebDriverWait; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.List; + +import static org.junit.Assert.assertEquals; +import static org.keycloak.testsuite.admin.ApiUtil.createUserWithAdminClient; +import static org.keycloak.testsuite.admin.ApiUtil.resetUserPassword; + public abstract class AbstractBrokerTest extends AbstractKeycloakTest { protected abstract RealmRepresentation createProviderRealm(); diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcOidcBrokerTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcOidcBrokerTest.java index 24ef5960e1..917e5662ea 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcOidcBrokerTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcOidcBrokerTest.java @@ -8,7 +8,15 @@ import java.util.Collections; import java.util.List; import java.util.Map; -import static org.keycloak.testsuite.broker.BrokerTestConstants.*; +import static org.keycloak.testsuite.broker.BrokerTestConstants.CLIENT_ID; +import static org.keycloak.testsuite.broker.BrokerTestConstants.CLIENT_SECRET; +import static org.keycloak.testsuite.broker.BrokerTestConstants.IDP_OIDC_ALIAS; +import static org.keycloak.testsuite.broker.BrokerTestConstants.IDP_OIDC_PROVIDER_ID; +import static org.keycloak.testsuite.broker.BrokerTestConstants.REALM_CONS_NAME; +import static org.keycloak.testsuite.broker.BrokerTestConstants.REALM_PROV_NAME; +import static org.keycloak.testsuite.broker.BrokerTestConstants.USER_EMAIL; +import static org.keycloak.testsuite.broker.BrokerTestConstants.USER_LOGIN; +import static org.keycloak.testsuite.broker.BrokerTestConstants.USER_PASSWORD; public class KcOidcBrokerTest extends AbstractBrokerTest { diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcSamlBrokerTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcSamlBrokerTest.java index 7a8fb9ceb3..b2c83c7613 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcSamlBrokerTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcSamlBrokerTest.java @@ -11,7 +11,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import static org.keycloak.testsuite.broker.BrokerTestConstants.*; +import static org.keycloak.testsuite.broker.BrokerTestConstants.IDP_SAML_ALIAS; +import static org.keycloak.testsuite.broker.BrokerTestConstants.IDP_SAML_PROVIDER_ID; +import static org.keycloak.testsuite.broker.BrokerTestConstants.REALM_CONS_NAME; +import static org.keycloak.testsuite.broker.BrokerTestConstants.REALM_PROV_NAME; +import static org.keycloak.testsuite.broker.BrokerTestConstants.USER_EMAIL; +import static org.keycloak.testsuite.broker.BrokerTestConstants.USER_LOGIN; +import static org.keycloak.testsuite.broker.BrokerTestConstants.USER_PASSWORD; @Ignore public class KcSamlBrokerTest extends AbstractBrokerTest { diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcSamlSignedBrokerTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcSamlSignedBrokerTest.java index 1a2eca83d5..8a64633b46 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcSamlSignedBrokerTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcSamlSignedBrokerTest.java @@ -9,7 +9,10 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import static org.keycloak.testsuite.broker.BrokerTestConstants.*; +import static org.keycloak.testsuite.broker.BrokerTestConstants.IDP_SAML_SIGN_CERT; +import static org.keycloak.testsuite.broker.BrokerTestConstants.IDP_SAML_SIGN_KEY; +import static org.keycloak.testsuite.broker.BrokerTestConstants.REALM_PRIVATE_KEY; +import static org.keycloak.testsuite.broker.BrokerTestConstants.REALM_PUBLIC_KEY; @Ignore public class KcSamlSignedBrokerTest extends KcSamlBrokerTest { diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/AdapterInstallationConfigTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/AdapterInstallationConfigTest.java index 818a84a992..b2b2eb46ab 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/AdapterInstallationConfigTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/AdapterInstallationConfigTest.java @@ -25,7 +25,9 @@ import org.keycloak.common.enums.SslRequired; import org.keycloak.representations.adapters.config.AdapterConfig; import org.keycloak.representations.idm.ClientRepresentation; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.fail; /** * @author Stian Thorgersen diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/ClientRedirectTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/ClientRedirectTest.java index dea5e29f67..42ab6c26e6 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/ClientRedirectTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/ClientRedirectTest.java @@ -23,7 +23,7 @@ import org.keycloak.testsuite.TestRealmKeycloakTest; import org.keycloak.testsuite.util.ClientBuilder; import org.keycloak.testsuite.util.RealmBuilder; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; /** * @author Thomas Darimont diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/ClientRegistrationTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/ClientRegistrationTest.java index 75acfac82e..5d1f4aef26 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/ClientRegistrationTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/ClientRegistrationTest.java @@ -28,7 +28,10 @@ import org.keycloak.representations.idm.ClientRepresentation; import javax.ws.rs.NotFoundException; import java.util.Collections; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.fail; /** * @author Stian Thorgersen diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/OIDCClientRegistrationTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/OIDCClientRegistrationTest.java index e88c5381dd..394ad86e52 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/OIDCClientRegistrationTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/OIDCClientRegistrationTest.java @@ -54,13 +54,21 @@ import org.keycloak.testsuite.client.resources.TestApplicationResourceUrls; import org.keycloak.testsuite.client.resources.TestOIDCEndpointsApplicationResource; import org.keycloak.testsuite.rest.resource.TestingOIDCEndpointsApplicationResource; import org.keycloak.testsuite.util.OAuthClient; -import java.security.PrivateKey; -import java.util.*; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriBuilder; +import java.security.PrivateKey; +import java.util.Arrays; +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; /** * @author Stian Thorgersen diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/OIDCPairwiseClientRegistrationTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/OIDCPairwiseClientRegistrationTest.java index 6d8e18c361..ca4553d69e 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/OIDCPairwiseClientRegistrationTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/OIDCPairwiseClientRegistrationTest.java @@ -18,12 +18,6 @@ package org.keycloak.testsuite.client; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import javax.ws.rs.core.Response; - import org.junit.Before; import org.junit.Test; import org.keycloak.admin.client.resource.ClientResource; @@ -45,6 +39,11 @@ import org.keycloak.testsuite.client.resources.TestOIDCEndpointsApplicationResou import org.keycloak.testsuite.util.ClientManager; import org.keycloak.testsuite.util.OAuthClient; +import javax.ws.rs.core.Response; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + import static org.junit.Assert.assertTrue; public class OIDCPairwiseClientRegistrationTest extends AbstractClientRegistrationTest { diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/RegistrationAccessTokenTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/RegistrationAccessTokenTest.java index 96a0010c93..23de485b8e 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/RegistrationAccessTokenTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/RegistrationAccessTokenTest.java @@ -24,7 +24,11 @@ import org.keycloak.client.registration.ClientRegistrationException; import org.keycloak.client.registration.HttpErrorException; import org.keycloak.representations.idm.ClientRepresentation; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.fail; /** * @author Stian Thorgersen diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/SAMLClientRegistrationTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/SAMLClientRegistrationTest.java index f4e0b2e81c..c3e60a258c 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/SAMLClientRegistrationTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/SAMLClientRegistrationTest.java @@ -25,12 +25,11 @@ import org.keycloak.client.registration.ClientRegistrationException; import org.keycloak.representations.idm.ClientInitialAccessCreatePresentation; import org.keycloak.representations.idm.ClientInitialAccessPresentation; import org.keycloak.representations.idm.ClientRepresentation; -import org.keycloak.representations.oidc.OIDCClientRepresentation; import java.io.IOException; -import java.util.Collections; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; /** * @author Stian Thorgersen diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cluster/AbstractClusterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cluster/AbstractClusterTest.java index 24b505aa5a..25abe65b22 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cluster/AbstractClusterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cluster/AbstractClusterTest.java @@ -1,19 +1,21 @@ package org.keycloak.testsuite.cluster; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; import org.jboss.arquillian.container.test.api.ContainerController; import org.jboss.arquillian.test.api.ArquillianResource; -import static org.junit.Assert.assertTrue; import org.junit.Before; import org.keycloak.admin.client.Keycloak; import org.keycloak.models.Constants; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.testsuite.AbstractKeycloakTest; import org.keycloak.testsuite.arquillian.ContainerInfo; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import static org.junit.Assert.assertTrue; import static org.keycloak.testsuite.auth.page.AuthRealm.ADMIN; import static org.keycloak.testsuite.auth.page.AuthRealm.MASTER; import static org.keycloak.testsuite.util.WaitUtils.pause; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cluster/AbstractInvalidationClusterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cluster/AbstractInvalidationClusterTest.java index 89ac45027a..657ad5bab7 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cluster/AbstractInvalidationClusterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cluster/AbstractInvalidationClusterTest.java @@ -1,17 +1,19 @@ package org.keycloak.testsuite.cluster; -import java.util.ArrayList; -import java.util.List; import org.apache.commons.lang.RandomStringUtils; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.builder.EqualsBuilder; import org.apache.commons.lang.builder.ReflectionToStringBuilder; import org.apache.commons.lang.builder.ToStringStyle; -import static org.junit.Assert.assertFalse; import org.junit.Test; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.testsuite.arquillian.ContainerInfo; +import java.util.ArrayList; +import java.util.List; + +import static org.junit.Assert.assertFalse; + /** * * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cluster/ClientInvalidationClusterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cluster/ClientInvalidationClusterTest.java index 506b626619..1344d77e8f 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cluster/ClientInvalidationClusterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cluster/ClientInvalidationClusterTest.java @@ -1,9 +1,6 @@ package org.keycloak.testsuite.cluster; -import javax.ws.rs.NotFoundException; -import javax.ws.rs.core.Response; import org.apache.commons.lang.RandomStringUtils; -import static org.junit.Assert.assertNull; import org.junit.Before; import org.keycloak.admin.client.resource.ClientResource; import org.keycloak.admin.client.resource.ClientsResource; @@ -11,6 +8,11 @@ import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.testsuite.admin.ApiUtil; import org.keycloak.testsuite.arquillian.ContainerInfo; +import javax.ws.rs.NotFoundException; +import javax.ws.rs.core.Response; + +import static org.junit.Assert.assertNull; + /** * * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cluster/GroupInvalidationClusterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cluster/GroupInvalidationClusterTest.java index 4b9495aa04..28f13b4ae5 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cluster/GroupInvalidationClusterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cluster/GroupInvalidationClusterTest.java @@ -1,14 +1,6 @@ package org.keycloak.testsuite.cluster; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import javax.ws.rs.NotFoundException; -import javax.ws.rs.core.Response; import org.apache.commons.lang.RandomStringUtils; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; import org.junit.Before; import org.keycloak.admin.client.resource.GroupResource; import org.keycloak.admin.client.resource.GroupsResource; @@ -16,6 +8,16 @@ import org.keycloak.representations.idm.GroupRepresentation; import org.keycloak.testsuite.admin.ApiUtil; import org.keycloak.testsuite.arquillian.ContainerInfo; +import javax.ws.rs.NotFoundException; +import javax.ws.rs.core.Response; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + /** * * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cluster/RealmInvalidationClusterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cluster/RealmInvalidationClusterTest.java index 667dde9e70..a054e7efbb 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cluster/RealmInvalidationClusterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cluster/RealmInvalidationClusterTest.java @@ -1,13 +1,15 @@ package org.keycloak.testsuite.cluster; -import javax.ws.rs.NotFoundException; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNull; import org.keycloak.admin.client.resource.RealmResource; import org.keycloak.admin.client.resource.RealmsResource; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.testsuite.arquillian.ContainerInfo; +import javax.ws.rs.NotFoundException; + +import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertNull; + /** * * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cluster/RoleInvalidationClusterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cluster/RoleInvalidationClusterTest.java index 6ae26950d7..c3ae0ea9dd 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cluster/RoleInvalidationClusterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cluster/RoleInvalidationClusterTest.java @@ -1,13 +1,15 @@ package org.keycloak.testsuite.cluster; -import javax.ws.rs.NotFoundException; import org.apache.commons.lang.RandomStringUtils; -import static org.junit.Assert.assertNull; import org.keycloak.admin.client.resource.RoleResource; import org.keycloak.admin.client.resource.RolesResource; import org.keycloak.representations.idm.RoleRepresentation; import org.keycloak.testsuite.arquillian.ContainerInfo; +import javax.ws.rs.NotFoundException; + +import static org.junit.Assert.assertNull; + /** * * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cluster/SessionFailoverClusterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cluster/SessionFailoverClusterTest.java index f15444d8f8..ca9417982e 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cluster/SessionFailoverClusterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cluster/SessionFailoverClusterTest.java @@ -1,19 +1,21 @@ package org.keycloak.testsuite.cluster; -import java.util.List; +import org.junit.Before; import org.junit.Test; import org.keycloak.representations.idm.RealmRepresentation; -import static org.keycloak.testsuite.auth.page.AuthRealm.ADMIN; -import static org.keycloak.testsuite.util.WaitUtils.pause; -import org.openqa.selenium.Cookie; import org.keycloak.testsuite.page.AbstractPage; import org.keycloak.testsuite.page.PageWithLogOutAction; -import org.junit.Before; +import org.openqa.selenium.Cookie; + +import java.util.List; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; +import static org.keycloak.testsuite.auth.page.AuthRealm.ADMIN; import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWith; +import static org.keycloak.testsuite.util.WaitUtils.pause; /** * diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cluster/UserInvalidationClusterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cluster/UserInvalidationClusterTest.java index 440848e938..2e586f5aed 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cluster/UserInvalidationClusterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cluster/UserInvalidationClusterTest.java @@ -1,15 +1,17 @@ package org.keycloak.testsuite.cluster; -import javax.ws.rs.NotFoundException; -import javax.ws.rs.core.Response; import org.apache.commons.lang.RandomStringUtils; -import static org.junit.Assert.assertNull; import org.keycloak.admin.client.resource.UserResource; import org.keycloak.admin.client.resource.UsersResource; import org.keycloak.representations.idm.UserRepresentation; import org.keycloak.testsuite.admin.ApiUtil; import org.keycloak.testsuite.arquillian.ContainerInfo; +import javax.ws.rs.NotFoundException; +import javax.ws.rs.core.Response; + +import static org.junit.Assert.assertNull; + /** * * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/composites/CompositeImportRoleTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/composites/CompositeImportRoleTest.java index 854f6ce376..e2951882f6 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/composites/CompositeImportRoleTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/composites/CompositeImportRoleTest.java @@ -16,16 +16,17 @@ */ package org.keycloak.testsuite.composites; +import org.jboss.arquillian.graphene.page.Page; import org.junit.Assert; import org.junit.Test; import org.keycloak.OAuth2Constants; import org.keycloak.representations.AccessToken; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.testsuite.pages.LoginPage; -import java.util.List; -import org.jboss.arquillian.graphene.page.Page; import org.keycloak.testsuite.util.OAuthClient.AccessTokenResponse; +import java.util.List; + import static org.keycloak.testsuite.admin.AbstractAdminTest.loadJson; /** diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/composites/CompositeRoleTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/composites/CompositeRoleTest.java index a43aae8475..e94edce040 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/composites/CompositeRoleTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/composites/CompositeRoleTest.java @@ -16,24 +16,20 @@ */ package org.keycloak.testsuite.composites; +import org.jboss.arquillian.graphene.page.Page; import org.junit.Assert; +import org.junit.Before; import org.junit.Test; import org.keycloak.OAuth2Constants; -import org.keycloak.representations.AccessToken; -import org.keycloak.testsuite.pages.LoginPage; - -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; -import org.jboss.arquillian.graphene.page.Page; -import org.junit.Before; import org.keycloak.admin.client.resource.ClientResource; import org.keycloak.admin.client.resource.RoleResource; import org.keycloak.admin.client.resource.UserResource; import org.keycloak.common.enums.SslRequired; +import org.keycloak.representations.AccessToken; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.representations.idm.RoleRepresentation; import org.keycloak.testsuite.admin.ApiUtil; +import org.keycloak.testsuite.pages.LoginPage; import org.keycloak.testsuite.util.ClientBuilder; import org.keycloak.testsuite.util.OAuthClient.AccessTokenResponse; import org.keycloak.testsuite.util.RealmBuilder; @@ -41,6 +37,10 @@ import org.keycloak.testsuite.util.RoleBuilder; import org.keycloak.testsuite.util.RolesBuilder; import org.keycloak.testsuite.util.UserBuilder; +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; + /** * @author Stian Thorgersen * @author Stan Silvert ssilvert@redhat.com (C) 2016 Red Hat Inc. diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/domainextension/CustomExtensionTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/domainextension/CustomExtensionTest.java index 36b5702cc5..24a652b493 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/domainextension/CustomExtensionTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/domainextension/CustomExtensionTest.java @@ -17,10 +17,6 @@ package org.keycloak.testsuite.domainextension; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - import org.junit.Test; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.testsuite.AbstractKeycloakTest; @@ -28,6 +24,10 @@ import org.keycloak.testsuite.Assert; import org.keycloak.testsuite.client.resources.TestExampleCompanyResource; import org.keycloak.testsuite.util.RealmBuilder; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + /** * @author Marek Posolda */ diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/events/AbstractEventsTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/events/AbstractEventsTest.java index d94353e4ca..09fd435f79 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/events/AbstractEventsTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/events/AbstractEventsTest.java @@ -17,12 +17,13 @@ package org.keycloak.testsuite.events; -import java.util.ArrayList; -import java.util.List; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.testsuite.AbstractKeycloakTest; import org.keycloak.testsuite.client.resources.TestingResource; +import java.util.ArrayList; +import java.util.List; + /** * * @author Stan Silvert ssilvert@redhat.com (C) 2016 Red Hat Inc. diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/events/AdminEventStoreProviderTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/events/AdminEventStoreProviderTest.java index 497fe97658..055ed5d605 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/events/AdminEventStoreProviderTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/events/AdminEventStoreProviderTest.java @@ -17,10 +17,6 @@ package org.keycloak.testsuite.events; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; - import org.junit.After; import org.junit.Assert; import org.junit.Test; @@ -28,6 +24,10 @@ import org.keycloak.events.admin.OperationType; import org.keycloak.representations.idm.AdminEventRepresentation; import org.keycloak.representations.idm.AuthDetailsRepresentation; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; + /** * @author Giriraj Sharma * @author Stan Silvert ssilvert@redhat.com (C) 2016 Red Hat Inc. diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/events/EventStoreProviderTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/events/EventStoreProviderTest.java index d8a08fc366..5839854c31 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/events/EventStoreProviderTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/events/EventStoreProviderTest.java @@ -18,17 +18,17 @@ package org.keycloak.testsuite.events; import org.apache.commons.lang3.StringUtils; +import org.junit.After; import org.junit.Assert; import org.junit.Test; import org.keycloak.events.EventType; +import org.keycloak.representations.idm.EventRepresentation; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.HashMap; import java.util.Map; -import org.junit.After; -import org.keycloak.representations.idm.EventRepresentation; /** * @author Stian Thorgersen diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/exportimport/AbstractExportImportTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/exportimport/AbstractExportImportTest.java index 26f5bc9956..838174d521 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/exportimport/AbstractExportImportTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/exportimport/AbstractExportImportTest.java @@ -17,15 +17,15 @@ package org.keycloak.testsuite.exportimport; -import java.util.HashSet; -import java.util.Properties; -import java.util.Set; - import org.jboss.arquillian.container.spi.Container; import org.jboss.arquillian.container.spi.client.container.LifecycleException; import org.keycloak.exportimport.ExportImportConfig; import org.keycloak.testsuite.AbstractKeycloakTest; +import java.util.HashSet; +import java.util.Properties; +import java.util.Set; + /** * @author Marek Posolda */ diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/exportimport/ExportImportTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/exportimport/ExportImportTest.java index 43c6fa9bb9..d79d4dc6f6 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/exportimport/ExportImportTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/exportimport/ExportImportTest.java @@ -17,8 +17,11 @@ package org.keycloak.testsuite.exportimport; +import org.jboss.arquillian.container.spi.client.container.LifecycleException; +import org.junit.After; import org.junit.Assert; import org.junit.Test; +import org.keycloak.admin.client.resource.RealmResource; import org.keycloak.common.util.MultivaluedHashMap; import org.keycloak.exportimport.ExportImportConfig; import org.keycloak.exportimport.dir.DirExportProvider; @@ -26,16 +29,12 @@ import org.keycloak.exportimport.dir.DirExportProviderFactory; import org.keycloak.exportimport.singlefile.SingleFileExportProviderFactory; import org.keycloak.representations.idm.ComponentRepresentation; import org.keycloak.representations.idm.RealmRepresentation; +import org.keycloak.representations.idm.UserRepresentation; +import org.keycloak.testsuite.util.UserBuilder; import java.io.File; import java.net.URL; import java.util.List; -import java.util.regex.Matcher; -import org.jboss.arquillian.container.spi.client.container.LifecycleException; -import org.junit.After; -import org.keycloak.admin.client.resource.RealmResource; -import org.keycloak.representations.idm.UserRepresentation; -import org.keycloak.testsuite.util.UserBuilder; import static org.keycloak.testsuite.admin.AbstractAdminTest.loadJson; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/exportimport/ExportImportUtil.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/exportimport/ExportImportUtil.java index 19aee3fece..030330c665 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/exportimport/ExportImportUtil.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/exportimport/ExportImportUtil.java @@ -17,15 +17,6 @@ package org.keycloak.testsuite.exportimport; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.function.Predicate; - import org.junit.Assert; import org.keycloak.admin.client.Keycloak; import org.keycloak.admin.client.resource.AuthorizationResource; @@ -62,6 +53,15 @@ import org.keycloak.testsuite.admin.ApiUtil; import org.keycloak.testsuite.client.KeycloakTestingClient; import org.keycloak.testsuite.util.RealmRepUtil; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Predicate; + /** * * @author Stan Silvert ssilvert@redhat.com (C) 2016 Red Hat Inc. diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/exportimport/LegacyImportTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/exportimport/LegacyImportTest.java index c648f5f1b0..45808a3a5a 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/exportimport/LegacyImportTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/exportimport/LegacyImportTest.java @@ -17,12 +17,6 @@ package org.keycloak.testsuite.exportimport; -import java.io.File; -import java.net.URL; -import java.util.Collection; -import java.util.List; -import java.util.Set; - import org.jboss.arquillian.container.spi.client.container.LifecycleException; import org.junit.After; import org.junit.Assert; @@ -40,6 +34,12 @@ import org.keycloak.representations.idm.ProtocolMapperRepresentation; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.representations.idm.RoleRepresentation; +import java.io.File; +import java.net.URL; +import java.util.Collection; +import java.util.List; +import java.util.Set; + /** * Test importing JSON files exported from previous adminClient versions * diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/BruteForceTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/BruteForceTest.java index 31c297f9d5..c6d0a8c384 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/BruteForceTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/BruteForceTest.java @@ -16,7 +16,7 @@ */ package org.keycloak.testsuite.forms; -import com.fasterxml.jackson.jaxrs.json.annotation.JSONP; +import org.jboss.arquillian.graphene.page.Page; import org.junit.After; import org.junit.Assert; import org.junit.Before; @@ -27,25 +27,22 @@ import org.keycloak.events.Errors; import org.keycloak.models.Constants; import org.keycloak.models.utils.TimeBasedOTP; import org.keycloak.representations.idm.CredentialRepresentation; -import org.keycloak.services.managers.DefaultBruteForceProtector; +import org.keycloak.representations.idm.RealmRepresentation; +import org.keycloak.representations.idm.UserRepresentation; import org.keycloak.testsuite.AssertEvents; import org.keycloak.testsuite.AssertEvents.ExpectedEvent; +import org.keycloak.testsuite.TestRealmKeycloakTest; import org.keycloak.testsuite.pages.AppPage; import org.keycloak.testsuite.pages.AppPage.RequestType; import org.keycloak.testsuite.pages.LoginPage; import org.keycloak.testsuite.pages.LoginTotpPage; import org.keycloak.testsuite.pages.RegisterPage; - -import java.net.MalformedURLException; - -import org.jboss.arquillian.graphene.page.Page; -import org.keycloak.representations.idm.RealmRepresentation; -import org.keycloak.representations.idm.UserRepresentation; -import org.keycloak.testsuite.TestRealmKeycloakTest; import org.keycloak.testsuite.util.GreenMailRule; import org.keycloak.testsuite.util.OAuthClient; -import org.keycloak.testsuite.util.UserBuilder; import org.keycloak.testsuite.util.RealmRepUtil; +import org.keycloak.testsuite.util.UserBuilder; + +import java.net.MalformedURLException; /** * @author Stian Thorgersen diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/LoginHotpTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/LoginHotpTest.java index d478f04ccb..eb444f4685 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/LoginHotpTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/LoginHotpTest.java @@ -16,31 +16,29 @@ */ package org.keycloak.testsuite.forms; +import org.jboss.arquillian.graphene.page.Page; import org.junit.Assert; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.keycloak.events.Details; import org.keycloak.models.OTPPolicy; +import org.keycloak.models.UserCredentialModel; import org.keycloak.models.utils.HmacOTP; +import org.keycloak.representations.idm.RealmRepresentation; +import org.keycloak.representations.idm.UserRepresentation; import org.keycloak.testsuite.AssertEvents; +import org.keycloak.testsuite.TestRealmKeycloakTest; import org.keycloak.testsuite.pages.AppPage; import org.keycloak.testsuite.pages.AppPage.RequestType; import org.keycloak.testsuite.pages.LoginPage; import org.keycloak.testsuite.pages.LoginTotpPage; - -import java.net.MalformedURLException; -import java.util.List; - -import org.jboss.arquillian.graphene.page.Page; -import org.keycloak.models.UserCredentialModel; -import org.keycloak.representations.idm.RealmRepresentation; -import org.keycloak.representations.idm.UserRepresentation; -import org.keycloak.testsuite.TestRealmKeycloakTest; import org.keycloak.testsuite.util.GreenMailRule; import org.keycloak.testsuite.util.RealmRepUtil; import org.keycloak.testsuite.util.UserBuilder; +import java.net.MalformedURLException; + /** * @author Stian Thorgersen * @author Stan Silvert ssilvert@redhat.com (C) 2016 Red Hat Inc. diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/LoginTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/LoginTest.java index 01f585446f..c4522c6df7 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/LoginTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/LoginTest.java @@ -37,12 +37,11 @@ import org.keycloak.testsuite.pages.LoginPage; import org.keycloak.testsuite.pages.LoginPasswordUpdatePage; import org.keycloak.testsuite.util.RealmBuilder; import org.keycloak.testsuite.util.UserBuilder; -import org.keycloak.common.util.Time; -import java.util.Map; import javax.ws.rs.client.Client; import javax.ws.rs.client.ClientBuilder; import javax.ws.rs.core.Response; +import java.util.Map; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/LoginTotpTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/LoginTotpTest.java index 66e6badbae..06ebacd883 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/LoginTotpTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/LoginTotpTest.java @@ -16,27 +16,27 @@ */ package org.keycloak.testsuite.forms; +import org.jboss.arquillian.graphene.page.Page; import org.junit.Assert; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.keycloak.events.Details; import org.keycloak.models.utils.TimeBasedOTP; +import org.keycloak.representations.idm.RealmRepresentation; +import org.keycloak.representations.idm.UserRepresentation; import org.keycloak.testsuite.AssertEvents; +import org.keycloak.testsuite.TestRealmKeycloakTest; import org.keycloak.testsuite.pages.AppPage; import org.keycloak.testsuite.pages.AppPage.RequestType; import org.keycloak.testsuite.pages.LoginPage; import org.keycloak.testsuite.pages.LoginTotpPage; - -import java.net.MalformedURLException; -import org.jboss.arquillian.graphene.page.Page; -import org.keycloak.representations.idm.RealmRepresentation; -import org.keycloak.representations.idm.UserRepresentation; -import org.keycloak.testsuite.TestRealmKeycloakTest; import org.keycloak.testsuite.util.GreenMailRule; import org.keycloak.testsuite.util.RealmRepUtil; import org.keycloak.testsuite.util.UserBuilder; +import java.net.MalformedURLException; + /** * @author Stian Thorgersen * @author Stan Silvert ssilvert@redhat.com (C) 2016 Red Hat Inc. diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/LogoutTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/LogoutTest.java index 087d35ed26..1dd7aac924 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/LogoutTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/LogoutTest.java @@ -16,19 +16,21 @@ */ package org.keycloak.testsuite.forms; +import org.jboss.arquillian.graphene.page.Page; import org.junit.Rule; import org.junit.Test; import org.keycloak.events.Details; +import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.testsuite.AssertEvents; +import org.keycloak.testsuite.TestRealmKeycloakTest; import org.keycloak.testsuite.pages.AppPage; import org.keycloak.testsuite.pages.LoginPage; import java.io.IOException; -import org.jboss.arquillian.graphene.page.Page; -import org.keycloak.representations.idm.RealmRepresentation; -import org.keycloak.testsuite.TestRealmKeycloakTest; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertTrue; /** * @author Stian Thorgersen diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/RegisterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/RegisterTest.java index ff1f66a32d..707b765290 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/RegisterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/RegisterTest.java @@ -17,7 +17,9 @@ package org.keycloak.testsuite.forms; import org.jboss.arquillian.graphene.page.Page; -import org.junit.*; +import org.junit.Assert; +import org.junit.Rule; +import org.junit.Test; import org.keycloak.events.Details; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.representations.idm.UserRepresentation; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/ResetPasswordTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/ResetPasswordTest.java index 78d20d9ceb..870af00a33 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/ResetPasswordTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/ResetPasswordTest.java @@ -16,34 +16,43 @@ */ package org.keycloak.testsuite.forms; -import org.junit.*; +import org.jboss.arquillian.graphene.page.Page; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; import org.keycloak.events.Details; import org.keycloak.events.Errors; import org.keycloak.events.EventType; +import org.keycloak.representations.idm.EventRepresentation; +import org.keycloak.representations.idm.RealmRepresentation; +import org.keycloak.representations.idm.UserRepresentation; import org.keycloak.testsuite.AssertEvents; -//import org.keycloak.testsuite.Constants; -import org.keycloak.testsuite.util.MailUtils; -import org.keycloak.testsuite.pages.*; +import org.keycloak.testsuite.TestRealmKeycloakTest; +import org.keycloak.testsuite.pages.AppPage; import org.keycloak.testsuite.pages.AppPage.RequestType; +import org.keycloak.testsuite.pages.ErrorPage; +import org.keycloak.testsuite.pages.InfoPage; +import org.keycloak.testsuite.pages.LoginPage; +import org.keycloak.testsuite.pages.LoginPasswordResetPage; +import org.keycloak.testsuite.pages.LoginPasswordUpdatePage; +import org.keycloak.testsuite.pages.VerifyEmailPage; +import org.keycloak.testsuite.util.GreenMailRule; +import org.keycloak.testsuite.util.MailUtils; +import org.keycloak.testsuite.util.OAuthClient; +import org.keycloak.testsuite.util.UserBuilder; import javax.mail.MessagingException; import javax.mail.Multipart; import javax.mail.internet.MimeMessage; - import java.io.IOException; import java.util.HashMap; import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; -import org.jboss.arquillian.graphene.page.Page; -import org.keycloak.representations.idm.EventRepresentation; -import org.keycloak.representations.idm.RealmRepresentation; -import org.keycloak.representations.idm.UserRepresentation; -import org.keycloak.testsuite.TestRealmKeycloakTest; -import org.keycloak.testsuite.util.GreenMailRule; -import org.keycloak.testsuite.util.OAuthClient; -import org.keycloak.testsuite.util.UserBuilder; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +//import org.keycloak.testsuite.Constants; /** * @author Stian Thorgersen diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/i18n/EmailTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/i18n/EmailTest.java index 7babb68511..d42a91b6f9 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/i18n/EmailTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/i18n/EmailTest.java @@ -16,22 +16,22 @@ */ package org.keycloak.testsuite.i18n; +import org.jboss.arquillian.graphene.page.Page; import org.junit.Assert; import org.junit.Rule; import org.junit.Test; import org.keycloak.models.UserModel; +import org.keycloak.representations.idm.UserRepresentation; +import org.keycloak.testsuite.admin.ApiUtil; import org.keycloak.testsuite.pages.LoginPage; import org.keycloak.testsuite.pages.LoginPasswordResetPage; +import org.keycloak.testsuite.util.GreenMailRule; import javax.mail.MessagingException; import javax.mail.internet.MimeMessage; import java.io.IOException; import java.util.Collections; import java.util.HashMap; -import org.jboss.arquillian.graphene.page.Page; -import org.keycloak.representations.idm.UserRepresentation; -import org.keycloak.testsuite.admin.ApiUtil; -import org.keycloak.testsuite.util.GreenMailRule; import static org.junit.Assert.assertEquals; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/i18n/LoginPageTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/i18n/LoginPageTest.java index 2cd04fa5f3..7c47446394 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/i18n/LoginPageTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/i18n/LoginPageTest.java @@ -17,6 +17,7 @@ package org.keycloak.testsuite.i18n; import org.apache.http.impl.client.DefaultHttpClient; +import org.jboss.arquillian.graphene.page.Page; import org.jboss.resteasy.client.jaxrs.ResteasyClient; import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder; import org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine; @@ -26,7 +27,6 @@ import org.keycloak.adapters.HttpClientBuilder; import org.keycloak.testsuite.pages.LoginPage; import javax.ws.rs.core.Response; -import org.jboss.arquillian.graphene.page.Page; /** * @author Michael Gerber diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/migration/MigrationTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/migration/MigrationTest.java index 41a3d446f0..be9df1598c 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/migration/MigrationTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/migration/MigrationTest.java @@ -16,7 +16,6 @@ */ package org.keycloak.testsuite.migration; -import java.util.List; import org.junit.Before; import org.junit.Test; import org.keycloak.admin.client.resource.RealmResource; @@ -25,6 +24,8 @@ import org.keycloak.testsuite.AbstractKeycloakTest; import org.keycloak.testsuite.Assert; import org.keycloak.testsuite.arquillian.migration.Migration; +import java.util.List; + /** * @author Vlastislav Ramik */ diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/migration/MigrationUtil.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/migration/MigrationUtil.java index 51e8c651b9..f5a1e426ba 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/migration/MigrationUtil.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/migration/MigrationUtil.java @@ -16,12 +16,14 @@ */ package org.keycloak.testsuite.migration; -import java.io.File; import org.keycloak.exportimport.ExportImportConfig; import org.keycloak.exportimport.singlefile.SingleFileExportProviderFactory; -import static org.keycloak.testsuite.arquillian.migration.MigrationTestExecutionDecider.MIGRATED_AUTH_SERVER_VERSION_PROPERTY; import org.keycloak.testsuite.client.KeycloakTestingClient; +import java.io.File; + +import static org.keycloak.testsuite.arquillian.migration.MigrationTestExecutionDecider.MIGRATED_AUTH_SERVER_VERSION_PROPERTY; + /** * @author Vlastislav Ramik */ diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/AccessTokenTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/AccessTokenTest.java index dfade959ed..13c1ea45ad 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/AccessTokenTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/AccessTokenTest.java @@ -73,7 +73,6 @@ import javax.ws.rs.core.Form; import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriBuilder; - import java.io.IOException; import java.net.URI; import java.util.Arrays; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/ClientAuthPostMethodTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/ClientAuthPostMethodTest.java index a7d395adae..3cee8ccaaf 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/ClientAuthPostMethodTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/ClientAuthPostMethodTest.java @@ -17,10 +17,6 @@ package org.keycloak.testsuite.oauth; -import java.io.UnsupportedEncodingException; -import java.util.LinkedList; -import java.util.List; - import org.apache.http.NameValuePair; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.HttpPost; @@ -40,6 +36,10 @@ import org.keycloak.testsuite.AssertEvents; import org.keycloak.testsuite.admin.AbstractAdminTest; import org.keycloak.testsuite.util.OAuthClient; +import java.io.UnsupportedEncodingException; +import java.util.LinkedList; +import java.util.List; + import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.greaterThanOrEqualTo; import static org.hamcrest.Matchers.lessThanOrEqualTo; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/ClientAuthSignedJWTTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/ClientAuthSignedJWTTest.java index c1cbdea6ac..300d08d9d8 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/ClientAuthSignedJWTTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/ClientAuthSignedJWTTest.java @@ -24,7 +24,6 @@ import org.apache.http.NameValuePair; import org.apache.http.client.HttpClient; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.ContentType; import org.apache.http.entity.mime.MultipartEntityBuilder; import org.apache.http.entity.mime.content.FileBody; import org.apache.http.impl.client.CloseableHttpClient; @@ -32,7 +31,6 @@ import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.message.BasicNameValuePair; import org.junit.BeforeClass; -import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.keycloak.OAuth2Constants; @@ -42,7 +40,11 @@ import org.keycloak.admin.client.resource.ClientAttributeCertificateResource; import org.keycloak.admin.client.resource.ClientResource; import org.keycloak.authentication.authenticators.client.JWTClientAuthenticator; import org.keycloak.common.constants.ServiceAccountConstants; -import org.keycloak.common.util.*; +import org.keycloak.common.util.BouncyIntegration; +import org.keycloak.common.util.KeycloakUriBuilder; +import org.keycloak.common.util.KeystoreUtil; +import org.keycloak.common.util.Time; +import org.keycloak.common.util.UriUtils; import org.keycloak.constants.ServiceUrlConstants; import org.keycloak.events.Details; import org.keycloak.events.Errors; @@ -67,14 +69,22 @@ import org.keycloak.testsuite.util.OAuthClient; import org.keycloak.testsuite.util.RealmBuilder; import org.keycloak.testsuite.util.UserBuilder; -import java.io.*; +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; import java.net.URL; import java.nio.file.Files; import java.security.KeyStore; import java.security.PrivateKey; import java.security.PublicKey; import java.security.cert.X509Certificate; -import java.util.*; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/LoginStatusIframeEndpointTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/LoginStatusIframeEndpointTest.java index 958362a88a..437e7d88ab 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/LoginStatusIframeEndpointTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/LoginStatusIframeEndpointTest.java @@ -42,7 +42,10 @@ import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; /** * @author Stian Thorgersen diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/OfflineTokenTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/OfflineTokenTest.java index 9ad2b71742..36cab0bd1a 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/OfflineTokenTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/OfflineTokenTest.java @@ -27,7 +27,6 @@ import org.keycloak.admin.client.resource.RealmResource; import org.keycloak.admin.client.resource.RoleResource; import org.keycloak.admin.client.resource.UserResource; import org.keycloak.common.constants.ServiceAccountConstants; -import org.keycloak.common.util.Time; import org.keycloak.events.Details; import org.keycloak.events.Errors; import org.keycloak.models.Constants; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/RefreshTokenTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/RefreshTokenTest.java index 8ae9ab1ede..517cc67ae6 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/RefreshTokenTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/RefreshTokenTest.java @@ -23,7 +23,6 @@ import org.junit.Test; import org.keycloak.OAuth2Constants; import org.keycloak.admin.client.resource.RealmResource; import org.keycloak.common.enums.SslRequired; -import org.keycloak.common.util.Time; import org.keycloak.events.Details; import org.keycloak.events.Errors; import org.keycloak.protocol.oidc.OIDCLoginProtocolService; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/ResourceOwnerPasswordCredentialsGrantTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/ResourceOwnerPasswordCredentialsGrantTest.java index 6796d12ce7..de83d4e18a 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/ResourceOwnerPasswordCredentialsGrantTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/ResourceOwnerPasswordCredentialsGrantTest.java @@ -25,10 +25,8 @@ import org.junit.Test; import org.keycloak.OAuth2Constants; import org.keycloak.admin.client.resource.RealmResource; import org.keycloak.authentication.authenticators.client.ClientIdAndSecretAuthenticator; -import org.keycloak.common.util.Time; import org.keycloak.events.Details; import org.keycloak.events.Errors; -import org.keycloak.models.PasswordPolicy; import org.keycloak.models.UserModel; import org.keycloak.models.utils.KeycloakModelUtils; import org.keycloak.models.utils.TimeBasedOTP; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/TokenIntrospectionTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/TokenIntrospectionTest.java index ec800edffc..e557c08b0b 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/TokenIntrospectionTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/TokenIntrospectionTest.java @@ -39,7 +39,10 @@ import org.keycloak.util.JsonSerialization; import java.util.ArrayList; import java.util.List; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; /** * @author Pedro Igor diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/OIDCAdvancedRequestParamsTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/OIDCAdvancedRequestParamsTest.java index e01057d418..560f597440 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/OIDCAdvancedRequestParamsTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/OIDCAdvancedRequestParamsTest.java @@ -17,8 +17,6 @@ package org.keycloak.testsuite.oidc; -import java.util.List; - import org.jboss.arquillian.graphene.page.Page; import org.junit.Before; import org.junit.Rule; @@ -54,6 +52,8 @@ import org.keycloak.testsuite.rest.resource.TestingOIDCEndpointsApplicationResou import org.keycloak.testsuite.util.ClientManager; import org.keycloak.testsuite.util.OAuthClient; +import java.util.List; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/OIDCWellKnownProviderTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/OIDCWellKnownProviderTest.java index e1877b89ba..572d5d2772 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/OIDCWellKnownProviderTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/OIDCWellKnownProviderTest.java @@ -17,15 +17,6 @@ package org.keycloak.testsuite.oidc; -import java.net.URI; -import java.util.List; - -import javax.ws.rs.client.Client; -import javax.ws.rs.client.ClientBuilder; -import javax.ws.rs.client.WebTarget; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriBuilder; - import org.junit.Before; import org.junit.Test; import org.keycloak.OAuth2Constants; @@ -45,6 +36,14 @@ import org.keycloak.testsuite.admin.AbstractAdminTest; import org.keycloak.testsuite.util.ClientManager; import org.keycloak.testsuite.util.OAuthClient; +import javax.ws.rs.client.Client; +import javax.ws.rs.client.ClientBuilder; +import javax.ws.rs.client.WebTarget; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.UriBuilder; +import java.net.URI; +import java.util.List; + /** * @author Marek Posolda */ diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/flows/AbstractOIDCResponseTypeTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/flows/AbstractOIDCResponseTypeTest.java index 28c6ff5077..6c2189c0f5 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/flows/AbstractOIDCResponseTypeTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/flows/AbstractOIDCResponseTypeTest.java @@ -17,12 +17,6 @@ package org.keycloak.testsuite.oidc.flows; -import java.io.IOException; -import java.net.MalformedURLException; -import java.util.List; - -import javax.ws.rs.core.UriBuilder; - import org.jboss.arquillian.graphene.page.Page; import org.junit.Rule; import org.junit.Test; @@ -42,6 +36,10 @@ import org.keycloak.testsuite.pages.LoginPage; import org.keycloak.testsuite.util.ClientManager; import org.keycloak.testsuite.util.OAuthClient; +import javax.ws.rs.core.UriBuilder; +import java.io.IOException; +import java.util.List; + import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/flows/OIDCBasicResponseTypeCodeTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/flows/OIDCBasicResponseTypeCodeTest.java index 355aa42bab..73e9cb847d 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/flows/OIDCBasicResponseTypeCodeTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/flows/OIDCBasicResponseTypeCodeTest.java @@ -17,9 +17,6 @@ package org.keycloak.testsuite.oidc.flows; -import java.util.Collections; -import java.util.List; - import org.junit.Before; import org.junit.Test; import org.keycloak.events.Details; @@ -27,9 +24,11 @@ import org.keycloak.protocol.oidc.utils.OIDCResponseType; import org.keycloak.representations.IDToken; import org.keycloak.representations.idm.EventRepresentation; import org.keycloak.testsuite.Assert; -import org.keycloak.testsuite.util.ClientManager; import org.keycloak.testsuite.util.OAuthClient; +import java.util.Collections; +import java.util.List; + /** * Test for response_type=code * diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/flows/OIDCHybridResponseTypeCodeIDTokenTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/flows/OIDCHybridResponseTypeCodeIDTokenTest.java index ebad58aff3..3fca3b25dc 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/flows/OIDCHybridResponseTypeCodeIDTokenTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/flows/OIDCHybridResponseTypeCodeIDTokenTest.java @@ -17,9 +17,6 @@ package org.keycloak.testsuite.oidc.flows; -import java.util.Arrays; -import java.util.List; - import org.junit.Before; import org.junit.Test; import org.keycloak.events.Details; @@ -30,6 +27,9 @@ import org.keycloak.representations.idm.EventRepresentation; import org.keycloak.testsuite.Assert; import org.keycloak.testsuite.util.OAuthClient; +import java.util.Arrays; +import java.util.List; + /** * Tests with response_type=code id_token * diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/flows/OIDCHybridResponseTypeCodeIDTokenTokenTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/flows/OIDCHybridResponseTypeCodeIDTokenTokenTest.java index dd56c7d956..63a9f7885b 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/flows/OIDCHybridResponseTypeCodeIDTokenTokenTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/flows/OIDCHybridResponseTypeCodeIDTokenTokenTest.java @@ -17,9 +17,6 @@ package org.keycloak.testsuite.oidc.flows; -import java.util.Arrays; -import java.util.List; - import org.junit.Before; import org.junit.Test; import org.keycloak.events.Details; @@ -30,6 +27,9 @@ import org.keycloak.representations.idm.EventRepresentation; import org.keycloak.testsuite.Assert; import org.keycloak.testsuite.util.OAuthClient; +import java.util.Arrays; +import java.util.List; + /** * Tests with response_type=code id_token token * diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/flows/OIDCHybridResponseTypeCodeTokenTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/flows/OIDCHybridResponseTypeCodeTokenTest.java index 4ce4a28bbc..4b4ba7e336 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/flows/OIDCHybridResponseTypeCodeTokenTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/flows/OIDCHybridResponseTypeCodeTokenTest.java @@ -17,9 +17,6 @@ package org.keycloak.testsuite.oidc.flows; -import java.util.Collections; -import java.util.List; - import org.junit.Before; import org.junit.Test; import org.keycloak.events.Details; @@ -29,6 +26,9 @@ import org.keycloak.representations.idm.EventRepresentation; import org.keycloak.testsuite.Assert; import org.keycloak.testsuite.util.OAuthClient; +import java.util.Collections; +import java.util.List; + /** * Tests with response_type=code token * diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/flows/OIDCImplicitResponseTypeIDTokenTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/flows/OIDCImplicitResponseTypeIDTokenTest.java index 2a82cd9057..103c91f388 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/flows/OIDCImplicitResponseTypeIDTokenTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/flows/OIDCImplicitResponseTypeIDTokenTest.java @@ -17,9 +17,6 @@ package org.keycloak.testsuite.oidc.flows; -import java.util.Collections; -import java.util.List; - import org.junit.Before; import org.junit.Test; import org.keycloak.events.Details; @@ -29,6 +26,9 @@ import org.keycloak.representations.idm.EventRepresentation; import org.keycloak.testsuite.Assert; import org.keycloak.testsuite.util.OAuthClient; +import java.util.Collections; +import java.util.List; + /** * Tests with response_type=id_token * diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/flows/OIDCImplicitResponseTypeIDTokenTokenTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/flows/OIDCImplicitResponseTypeIDTokenTokenTest.java index 899d406d96..578b1a7e07 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/flows/OIDCImplicitResponseTypeIDTokenTokenTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/flows/OIDCImplicitResponseTypeIDTokenTokenTest.java @@ -17,9 +17,6 @@ package org.keycloak.testsuite.oidc.flows; -import java.util.Collections; -import java.util.List; - import org.junit.Before; import org.junit.Test; import org.keycloak.events.Details; @@ -30,6 +27,9 @@ import org.keycloak.representations.idm.EventRepresentation; import org.keycloak.testsuite.Assert; import org.keycloak.testsuite.util.OAuthClient; +import java.util.Collections; +import java.util.List; + /** * Tests with response_type=id_token token * diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/user/AbstractUserTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/user/AbstractUserTest.java index d7dbbdc328..87a93a1ed7 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/user/AbstractUserTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/user/AbstractUserTest.java @@ -1,14 +1,16 @@ package org.keycloak.testsuite.user; -import javax.ws.rs.core.Response; -import static javax.ws.rs.core.Response.Status.CREATED; import org.keycloak.admin.client.resource.UserResource; import org.keycloak.admin.client.resource.UsersResource; import org.keycloak.representations.idm.UserRepresentation; -import static org.keycloak.testsuite.admin.ApiUtil.getCreatedId; -import static org.junit.Assert.assertEquals; import org.keycloak.testsuite.AbstractAuthTest; +import javax.ws.rs.core.Response; + +import static javax.ws.rs.core.Response.Status.CREATED; +import static org.junit.Assert.assertEquals; +import static org.keycloak.testsuite.admin.ApiUtil.getCreatedId; + /** * * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/AdminEventPaths.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/AdminEventPaths.java index eddd1713e6..5e5547f73e 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/AdminEventPaths.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/AdminEventPaths.java @@ -17,10 +17,6 @@ package org.keycloak.testsuite.util; -import java.net.URI; - -import javax.ws.rs.core.UriBuilder; - import org.keycloak.admin.client.resource.AttackDetectionResource; import org.keycloak.admin.client.resource.AuthenticationManagementResource; import org.keycloak.admin.client.resource.ClientAttributeCertificateResource; @@ -44,6 +40,9 @@ import org.keycloak.admin.client.resource.UserFederationProvidersResource; import org.keycloak.admin.client.resource.UserResource; import org.keycloak.admin.client.resource.UsersResource; +import javax.ws.rs.core.UriBuilder; +import java.net.URI; + /** * @author Marek Posolda */ diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/AssertAdminEvents.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/AssertAdminEvents.java index c50c022837..4736165ad2 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/AssertAdminEvents.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/AssertAdminEvents.java @@ -17,17 +17,6 @@ package org.keycloak.testsuite.util; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.lang.reflect.Method; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.ws.rs.core.Response; - import com.fasterxml.jackson.core.type.TypeReference; import org.hamcrest.Description; import org.hamcrest.Matcher; @@ -44,13 +33,20 @@ import org.keycloak.jose.jws.JWSInputException; import org.keycloak.representations.AccessToken; import org.keycloak.representations.idm.AdminEventRepresentation; import org.keycloak.representations.idm.AuthDetailsRepresentation; -import org.keycloak.representations.idm.ProtocolMapperRepresentation; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.representations.idm.RoleRepresentation; import org.keycloak.testsuite.AbstractKeycloakTest; import org.keycloak.testsuite.Assert; import org.keycloak.util.JsonSerialization; +import javax.ws.rs.core.Response; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.lang.reflect.Method; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + /** * @author Marek Posolda */ diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/AttributesAssert.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/AttributesAssert.java index b2aa9f9f94..6990fb0f7b 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/AttributesAssert.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/AttributesAssert.java @@ -18,6 +18,7 @@ package org.keycloak.testsuite.util; import java.util.List; + import static org.junit.Assert.assertEquals; /** diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/ClientBuilder.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/ClientBuilder.java index b1562dfe56..9de5ae2bda 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/ClientBuilder.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/ClientBuilder.java @@ -17,8 +17,6 @@ package org.keycloak.testsuite.util; -import java.util.ArrayList; -import org.keycloak.dom.saml.v2.ac.BooleanType; import org.keycloak.representations.idm.ClientRepresentation; import java.util.Arrays; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/CredentialBuilder.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/CredentialBuilder.java index 038f4fbcb4..ea3adb0b95 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/CredentialBuilder.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/CredentialBuilder.java @@ -18,11 +18,6 @@ package org.keycloak.testsuite.util; import org.keycloak.representations.idm.CredentialRepresentation; -import org.keycloak.representations.idm.UserRepresentation; - -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; /** * @author Stian Thorgersen diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/FederatedIdentityBuilder.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/FederatedIdentityBuilder.java index 2374f7fddb..2ce100c31b 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/FederatedIdentityBuilder.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/FederatedIdentityBuilder.java @@ -18,7 +18,6 @@ package org.keycloak.testsuite.util; import org.keycloak.representations.idm.FederatedIdentityRepresentation; -import org.keycloak.services.util.P3PHelper; /** * @author Stian Thorgersen diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/MailAssert.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/MailAssert.java index ac90ea8418..5d3099b6a5 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/MailAssert.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/MailAssert.java @@ -17,14 +17,17 @@ package org.keycloak.testsuite.util; -import java.io.IOException; -import javax.mail.MessagingException; +import org.jboss.logging.Logger; +import javax.mail.MessagingException; import javax.mail.internet.MimeMessage; import javax.mail.internet.MimeMessage.RecipientType; import javax.mail.internet.MimeMultipart; -import org.jboss.logging.Logger; -import static org.junit.Assert.*; +import java.io.IOException; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; public class MailAssert { diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/MailServer.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/MailServer.java index 2a7306c0a7..985f449223 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/MailServer.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/MailServer.java @@ -19,16 +19,18 @@ package org.keycloak.testsuite.util; import com.icegreen.greenmail.util.GreenMail; import com.icegreen.greenmail.util.ServerSetup; -import java.io.IOException; -import java.lang.Thread.UncaughtExceptionHandler; -import java.net.SocketException; -import javax.mail.MessagingException; +import org.jboss.logging.Logger; +import javax.mail.MessagingException; import javax.mail.internet.MimeMessage; import javax.mail.internet.MimeMessage.RecipientType; import javax.mail.internet.MimeMultipart; -import org.jboss.logging.Logger; -import static org.keycloak.testsuite.util.MailServerConfiguration.*; +import java.io.IOException; +import java.lang.Thread.UncaughtExceptionHandler; +import java.net.SocketException; + +import static org.keycloak.testsuite.util.MailServerConfiguration.HOST; +import static org.keycloak.testsuite.util.MailServerConfiguration.PORT; public class MailServer { diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/RealmBuilder.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/RealmBuilder.java index 3653065d66..1a4c8bede3 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/RealmBuilder.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/RealmBuilder.java @@ -17,16 +17,16 @@ package org.keycloak.testsuite.util; -import java.util.Collections; import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.representations.idm.RealmRepresentation; +import org.keycloak.representations.idm.RolesRepresentation; import org.keycloak.representations.idm.UserRepresentation; import org.keycloak.testsuite.events.EventsListenerProviderFactory; +import java.util.Collections; import java.util.HashMap; import java.util.LinkedList; import java.util.Map; -import org.keycloak.representations.idm.RolesRepresentation; /** * @author Stian Thorgersen diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/RealmRepUtil.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/RealmRepUtil.java index 7d5b0c0a2b..5d767472bf 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/RealmRepUtil.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/RealmRepUtil.java @@ -16,13 +16,14 @@ */ package org.keycloak.testsuite.util; -import java.util.HashSet; -import java.util.Set; import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.representations.idm.RoleRepresentation; import org.keycloak.representations.idm.UserRepresentation; +import java.util.HashSet; +import java.util.Set; + /** * * @author Stan Silvert ssilvert@redhat.com (C) 2016 Red Hat Inc. diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/RoleBuilder.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/RoleBuilder.java index 84f38b92a8..ceadc0c39f 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/RoleBuilder.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/RoleBuilder.java @@ -17,12 +17,13 @@ package org.keycloak.testsuite.util; +import org.keycloak.representations.idm.RoleRepresentation; +import org.keycloak.representations.idm.RoleRepresentation.Composites; + import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; import java.util.List; -import org.keycloak.representations.idm.RoleRepresentation; -import org.keycloak.representations.idm.RoleRepresentation.Composites; /** * @author Stian Thorgersen diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/RolesBuilder.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/RolesBuilder.java index 75bd6a0066..1544bd11fb 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/RolesBuilder.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/RolesBuilder.java @@ -17,11 +17,12 @@ package org.keycloak.testsuite.util; +import org.keycloak.representations.idm.RoleRepresentation; +import org.keycloak.representations.idm.RolesRepresentation; + import java.util.HashMap; import java.util.LinkedList; import java.util.List; -import org.keycloak.representations.idm.RoleRepresentation; -import org.keycloak.representations.idm.RolesRepresentation; /** * diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/SslMailServer.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/SslMailServer.java index 0f87d49ab7..cfaf5e26bc 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/SslMailServer.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/SslMailServer.java @@ -17,22 +17,33 @@ package org.keycloak.testsuite.util; +import org.jboss.logging.Logger; +import org.subethamail.smtp.server.SMTPServer; + +import javax.mail.internet.MimeMessage; +import javax.net.ssl.KeyManagerFactory; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLSocket; +import javax.net.ssl.SSLSocketFactory; +import javax.net.ssl.TrustManagerFactory; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; -import java.net.*; -import java.security.*; +import java.net.InetSocketAddress; +import java.net.Socket; +import java.net.SocketException; +import java.security.KeyManagementException; +import java.security.KeyStore; +import java.security.KeyStoreException; +import java.security.NoSuchAlgorithmException; +import java.security.UnrecoverableKeyException; import java.security.cert.CertificateException; import java.util.HashMap; import java.util.Map; -import javax.mail.internet.MimeMessage; -import javax.net.ssl.*; - -import org.jboss.logging.Logger; -import org.subethamail.smtp.server.SMTPServer; - -import static org.keycloak.testsuite.util.MailServerConfiguration.*; +import static org.keycloak.testsuite.util.MailServerConfiguration.FROM; +import static org.keycloak.testsuite.util.MailServerConfiguration.HOST; +import static org.keycloak.testsuite.util.MailServerConfiguration.PORT; import static org.keycloak.testsuite.util.MailServerConfiguration.PORT_SSL; import static org.keycloak.testsuite.util.MailServerConfiguration.STARTTLS; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/TestEventsLogger.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/TestEventsLogger.java index 23a8138f24..92f3085e48 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/TestEventsLogger.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/TestEventsLogger.java @@ -16,8 +16,6 @@ */ package org.keycloak.testsuite.util; -import java.io.File; -import java.io.IOException; import org.apache.commons.io.FileUtils; import org.jboss.logging.Logger; import org.junit.runner.Description; @@ -25,6 +23,9 @@ import org.junit.runner.notification.Failure; import org.junit.runner.notification.RunListener; import org.openqa.selenium.WebDriver; +import java.io.File; +import java.io.IOException; + /** * * @author Petr Mensik diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/URLAssert.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/URLAssert.java index 573a3340c8..1b0f8c0c1c 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/URLAssert.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/URLAssert.java @@ -24,13 +24,10 @@ import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.junit.Assert; -import org.keycloak.testsuite.page.AbstractPage; -import static org.junit.Assert.assertTrue; import org.keycloak.testsuite.auth.page.login.PageWithLoginUrl; +import org.keycloak.testsuite.page.AbstractPage; import org.openqa.selenium.WebDriver; -import static org.keycloak.testsuite.util.URLUtils.*; - import java.io.IOException; import java.io.InputStreamReader; import java.io.Reader; @@ -38,6 +35,11 @@ import java.io.StringWriter; import java.net.URI; import java.nio.charset.Charset; +import static org.junit.Assert.assertTrue; +import static org.keycloak.testsuite.util.URLUtils.currentUrlDoesntStartWith; +import static org.keycloak.testsuite.util.URLUtils.currentUrlEqual; +import static org.keycloak.testsuite.util.URLUtils.currentUrlStartWith; + /** * * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/UserFederationProviderBuilder.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/UserFederationProviderBuilder.java index 61f45c76a9..1f11dd2151 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/UserFederationProviderBuilder.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/UserFederationProviderBuilder.java @@ -17,11 +17,11 @@ package org.keycloak.testsuite.util; +import org.keycloak.representations.idm.UserFederationProviderRepresentation; + import java.util.HashMap; import java.util.Map; -import org.keycloak.representations.idm.UserFederationProviderRepresentation; - /** * @author Marek Posolda */ diff --git a/testsuite/integration-arquillian/tests/base/src/test/resources/admin-test/saml-idp-metadata.xml b/testsuite/integration-arquillian/tests/base/src/test/resources/admin-test/saml-idp-metadata.xml index aa3cff1c68..2bcfc211ec 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/resources/admin-test/saml-idp-metadata.xml +++ b/testsuite/integration-arquillian/tests/base/src/test/resources/admin-test/saml-idp-metadata.xml @@ -1,7 +1,7 @@ + xmlns="urn:oasis:names:tc:SAML:2.0:metadata" +> urn:oasis:names:tc:SAML:2.0:nameid-format:persistent diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPOIDCAdapterTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPOIDCAdapterTest.java index 8c663f2cb5..169cc6e835 100644 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPOIDCAdapterTest.java +++ b/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPOIDCAdapterTest.java @@ -1,7 +1,7 @@ package org.keycloak.testsuite.adapter; -import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; import org.keycloak.testsuite.adapter.servlet.AbstractDemoServletsAdapterTest; +import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; /** * diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPOIDCKerberosLdapAdapterTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPOIDCKerberosLdapAdapterTest.java index 1b0d44b014..f9bdaf4221 100644 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPOIDCKerberosLdapAdapterTest.java +++ b/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPOIDCKerberosLdapAdapterTest.java @@ -1,9 +1,7 @@ package org.keycloak.testsuite.adapter; -import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; -import org.junit.Ignore; import org.keycloak.testsuite.adapter.federation.AbstractKerberosLdapAdapterTest; -import org.keycloak.testsuite.adapter.servlet.AbstractDemoServletsAdapterTest; +import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; /** * diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPOIDCKerberosStandaloneAdapterTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPOIDCKerberosStandaloneAdapterTest.java index 6503467e63..2fbc5185f6 100644 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPOIDCKerberosStandaloneAdapterTest.java +++ b/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPOIDCKerberosStandaloneAdapterTest.java @@ -1,9 +1,7 @@ package org.keycloak.testsuite.adapter; -import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; -import org.junit.Ignore; import org.keycloak.testsuite.adapter.federation.AbstractKerberosStandaloneAdapterTest; -import org.keycloak.testsuite.adapter.servlet.AbstractDemoServletsAdapterTest; +import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; /** * diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPSAMLFilterAdapterTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPSAMLFilterAdapterTest.java index bf739a73e9..28455cd5ee 100644 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPSAMLFilterAdapterTest.java +++ b/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/EAPSAMLFilterAdapterTest.java @@ -2,7 +2,6 @@ package org.keycloak.testsuite.adapter; import org.keycloak.testsuite.adapter.servlet.AbstractSAMLFilterServletAdapterTest; import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; -import org.keycloak.testsuite.arquillian.annotation.UseServletFilter; /** * @author mhajas diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/example/authorization/EAPServletAuthzAdapterTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/example/authorization/EAPServletAuthzAdapterTest.java index 3c789a4b34..8355037f1c 100644 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/example/authorization/EAPServletAuthzAdapterTest.java +++ b/testsuite/integration-arquillian/tests/other/adapters/jboss/eap/src/test/java/org/keycloak/testsuite/adapter/example/authorization/EAPServletAuthzAdapterTest.java @@ -17,7 +17,6 @@ package org.keycloak.testsuite.adapter.example.authorization; import org.jboss.arquillian.container.test.api.RunAsClient; -import org.keycloak.testsuite.adapter.example.authorization.AbstractDefaultAuthzConfigAdapterTest; import org.keycloak.testsuite.adapter.example.authorization.AbstractServletAuthzAdapterTest; import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap6/src/test/java/org/keycloak/testsuite/adapter/EAP6OIDCAdapterTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/eap6/src/test/java/org/keycloak/testsuite/adapter/EAP6OIDCAdapterTest.java index a834596452..4afd228ac4 100644 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap6/src/test/java/org/keycloak/testsuite/adapter/EAP6OIDCAdapterTest.java +++ b/testsuite/integration-arquillian/tests/other/adapters/jboss/eap6/src/test/java/org/keycloak/testsuite/adapter/EAP6OIDCAdapterTest.java @@ -1,7 +1,7 @@ package org.keycloak.testsuite.adapter; -import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; import org.keycloak.testsuite.adapter.servlet.AbstractDemoServletsAdapterTest; +import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; /** * diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap6/src/test/java/org/keycloak/testsuite/adapter/EAP6OIDCKerberosLdapAdapterTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/eap6/src/test/java/org/keycloak/testsuite/adapter/EAP6OIDCKerberosLdapAdapterTest.java index 88364d6ba9..4dc41e5a32 100644 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap6/src/test/java/org/keycloak/testsuite/adapter/EAP6OIDCKerberosLdapAdapterTest.java +++ b/testsuite/integration-arquillian/tests/other/adapters/jboss/eap6/src/test/java/org/keycloak/testsuite/adapter/EAP6OIDCKerberosLdapAdapterTest.java @@ -1,9 +1,7 @@ package org.keycloak.testsuite.adapter; -import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; -import org.junit.Ignore; import org.keycloak.testsuite.adapter.federation.AbstractKerberosLdapAdapterTest; -import org.keycloak.testsuite.adapter.servlet.AbstractDemoServletsAdapterTest; +import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; /** * diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap6/src/test/java/org/keycloak/testsuite/adapter/EAP6OIDCKerberosStandaloneAdapterTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/eap6/src/test/java/org/keycloak/testsuite/adapter/EAP6OIDCKerberosStandaloneAdapterTest.java index 266b1c80ec..5bcd83444c 100644 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap6/src/test/java/org/keycloak/testsuite/adapter/EAP6OIDCKerberosStandaloneAdapterTest.java +++ b/testsuite/integration-arquillian/tests/other/adapters/jboss/eap6/src/test/java/org/keycloak/testsuite/adapter/EAP6OIDCKerberosStandaloneAdapterTest.java @@ -1,9 +1,7 @@ package org.keycloak.testsuite.adapter; -import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; -import org.junit.Ignore; import org.keycloak.testsuite.adapter.federation.AbstractKerberosStandaloneAdapterTest; -import org.keycloak.testsuite.adapter.servlet.AbstractDemoServletsAdapterTest; +import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; /** * diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap6/src/test/java/org/keycloak/testsuite/adapter/EAP6SAMLFilterAdapterTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/eap6/src/test/java/org/keycloak/testsuite/adapter/EAP6SAMLFilterAdapterTest.java index 1dcf846eb3..71866d674a 100644 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap6/src/test/java/org/keycloak/testsuite/adapter/EAP6SAMLFilterAdapterTest.java +++ b/testsuite/integration-arquillian/tests/other/adapters/jboss/eap6/src/test/java/org/keycloak/testsuite/adapter/EAP6SAMLFilterAdapterTest.java @@ -2,7 +2,6 @@ package org.keycloak.testsuite.adapter; import org.keycloak.testsuite.adapter.servlet.AbstractSAMLFilterServletAdapterTest; import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; -import org.keycloak.testsuite.arquillian.annotation.UseServletFilter; /** * @author mhajas diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap6/src/test/java/org/keycloak/testsuite/adapter/example/EAP6CorsExampleAdapterTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/eap6/src/test/java/org/keycloak/testsuite/adapter/example/EAP6CorsExampleAdapterTest.java index 80c7dad811..d8a29a22c4 100644 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/eap6/src/test/java/org/keycloak/testsuite/adapter/example/EAP6CorsExampleAdapterTest.java +++ b/testsuite/integration-arquillian/tests/other/adapters/jboss/eap6/src/test/java/org/keycloak/testsuite/adapter/example/EAP6CorsExampleAdapterTest.java @@ -1,7 +1,7 @@ package org.keycloak.testsuite.adapter.example; -import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; import org.junit.Ignore; +import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; /** * @author fkiss diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/main/java/org/keycloak/testsuite/performance/page/AppProfileJEE.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/main/java/org/keycloak/testsuite/performance/page/AppProfileJEE.java index 799c8a97bd..334731190f 100644 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/main/java/org/keycloak/testsuite/performance/page/AppProfileJEE.java +++ b/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/main/java/org/keycloak/testsuite/performance/page/AppProfileJEE.java @@ -1,10 +1,11 @@ package org.keycloak.testsuite.performance.page; -import java.net.URL; import org.jboss.arquillian.container.test.api.OperateOnDeployment; import org.jboss.arquillian.test.api.ArquillianResource; import org.keycloak.testsuite.page.AbstractPageWithInjectedUrl; +import java.net.URL; + /** * * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/test/java/org/keycloak/testsuite/performance/PerformanceMeasurement.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/test/java/org/keycloak/testsuite/performance/PerformanceMeasurement.java index 32ec4a2528..2cac1176bb 100644 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/test/java/org/keycloak/testsuite/performance/PerformanceMeasurement.java +++ b/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/test/java/org/keycloak/testsuite/performance/PerformanceMeasurement.java @@ -1,5 +1,9 @@ package org.keycloak.testsuite.performance; +import org.apache.commons.csv.CSVFormat; +import org.apache.commons.csv.CSVPrinter; +import org.keycloak.testsuite.performance.statistics.SimpleStatistics; + import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; @@ -10,10 +14,8 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.List; -import org.apache.commons.csv.CSVFormat; -import org.apache.commons.csv.CSVPrinter; + import static org.keycloak.testsuite.performance.PerformanceTest.LOG; -import org.keycloak.testsuite.performance.statistics.SimpleStatistics; import static org.keycloak.testsuite.util.IOUtil.PROJECT_BUILD_DIRECTORY; /** diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/test/java/org/keycloak/testsuite/performance/PerformanceStatistics.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/test/java/org/keycloak/testsuite/performance/PerformanceStatistics.java index 5209bbb529..af881c0988 100644 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/test/java/org/keycloak/testsuite/performance/PerformanceStatistics.java +++ b/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/test/java/org/keycloak/testsuite/performance/PerformanceStatistics.java @@ -1,11 +1,12 @@ package org.keycloak.testsuite.performance; -import java.util.concurrent.ConcurrentHashMap; import org.keycloak.testsuite.performance.statistics.DataHoldingUpdatableStatistic; import org.keycloak.testsuite.performance.statistics.MovingUpdatableStatistic; import org.keycloak.testsuite.performance.statistics.SimpleStatistics; -import org.keycloak.testsuite.performance.statistics.UpdatableStatistics; import org.keycloak.testsuite.performance.statistics.UpdatableStatistic; +import org.keycloak.testsuite.performance.statistics.UpdatableStatistics; + +import java.util.concurrent.ConcurrentHashMap; /** * PerformanceStatistics. Concurrent hash map of UpdatableStatistic objects, diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/test/java/org/keycloak/testsuite/performance/PerformanceTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/test/java/org/keycloak/testsuite/performance/PerformanceTest.java index 24c2d90fc2..caf3afe03d 100644 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/test/java/org/keycloak/testsuite/performance/PerformanceTest.java +++ b/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/test/java/org/keycloak/testsuite/performance/PerformanceTest.java @@ -1,16 +1,18 @@ package org.keycloak.testsuite.performance; +import org.jboss.logging.Logger; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.keycloak.testsuite.adapter.AbstractExampleAdapterTest; + import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; -import org.jboss.logging.Logger; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.keycloak.testsuite.adapter.AbstractExampleAdapterTest; + import static org.keycloak.testsuite.util.WaitUtils.pause; /** diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/test/java/org/keycloak/testsuite/performance/htmlunit/HtmlUnitLoginLogoutPerfTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/test/java/org/keycloak/testsuite/performance/htmlunit/HtmlUnitLoginLogoutPerfTest.java index de8e29f7a2..22726d8afa 100644 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/test/java/org/keycloak/testsuite/performance/htmlunit/HtmlUnitLoginLogoutPerfTest.java +++ b/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/test/java/org/keycloak/testsuite/performance/htmlunit/HtmlUnitLoginLogoutPerfTest.java @@ -1,8 +1,5 @@ package org.keycloak.testsuite.performance.htmlunit; -import java.io.File; -import java.io.IOException; -import java.util.List; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.graphene.page.Page; import org.jboss.logging.Logger; @@ -11,19 +8,24 @@ import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.Before; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; +import org.keycloak.testsuite.performance.LoginLogoutTestParameters; +import org.keycloak.testsuite.performance.OperationTimeoutException; +import org.keycloak.testsuite.performance.PerformanceMeasurement; +import org.keycloak.testsuite.performance.PerformanceTest; import org.keycloak.testsuite.performance.page.AppProfileJEE; import org.openqa.selenium.By; -import static org.keycloak.testsuite.performance.LoginLogoutTestParameters.LOGIN_REQUEST_TIME; -import static org.keycloak.testsuite.performance.LoginLogoutTestParameters.LOGOUT_REQUEST_TIME; -import static org.keycloak.testsuite.performance.LoginLogoutTestParameters.ACCESS_REQUEST_TIME; -import static org.keycloak.testsuite.performance.LoginLogoutTestParameters.LOGIN_VERIFY_REQUEST_TIME; -import static org.keycloak.testsuite.performance.LoginLogoutTestParameters.LOGOUT_VERIFY_REQUEST_TIME; -import org.keycloak.testsuite.performance.PerformanceTest; -import org.keycloak.testsuite.performance.OperationTimeoutException; import org.openqa.selenium.TimeoutException; -import org.keycloak.testsuite.performance.PerformanceMeasurement; -import org.keycloak.testsuite.performance.LoginLogoutTestParameters; + +import java.io.File; +import java.io.IOException; +import java.util.List; + import static org.junit.Assert.assertTrue; +import static org.keycloak.testsuite.performance.LoginLogoutTestParameters.ACCESS_REQUEST_TIME; +import static org.keycloak.testsuite.performance.LoginLogoutTestParameters.LOGIN_REQUEST_TIME; +import static org.keycloak.testsuite.performance.LoginLogoutTestParameters.LOGIN_VERIFY_REQUEST_TIME; +import static org.keycloak.testsuite.performance.LoginLogoutTestParameters.LOGOUT_REQUEST_TIME; +import static org.keycloak.testsuite.performance.LoginLogoutTestParameters.LOGOUT_VERIFY_REQUEST_TIME; import static org.keycloak.testsuite.performance.LoginLogoutTestParameters.PASSWORD_HASH_ITERATIONS; import static org.keycloak.testsuite.util.IOUtil.loadRealm; diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/test/java/org/keycloak/testsuite/performance/httpclient/HttpClientLoginLogoutPerfTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/test/java/org/keycloak/testsuite/performance/httpclient/HttpClientLoginLogoutPerfTest.java index 95909580f4..a853e2b447 100644 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/test/java/org/keycloak/testsuite/performance/httpclient/HttpClientLoginLogoutPerfTest.java +++ b/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/test/java/org/keycloak/testsuite/performance/httpclient/HttpClientLoginLogoutPerfTest.java @@ -1,15 +1,5 @@ package org.keycloak.testsuite.performance.httpclient; -import java.io.File; -import java.io.IOException; -import static java.net.HttpURLConnection.HTTP_OK; -import java.net.SocketException; -import java.net.SocketTimeoutException; -import java.net.URI; -import java.util.ArrayList; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import org.apache.http.Header; import org.apache.http.NameValuePair; import org.apache.http.client.entity.UrlEncodedFormEntity; @@ -26,19 +16,31 @@ import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.Before; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; -import org.keycloak.testsuite.performance.page.AppProfileJEE; -import static org.keycloak.testsuite.performance.LoginLogoutTestParameters.ACCESS_REQUEST_TIME; -import static org.keycloak.testsuite.performance.LoginLogoutTestParameters.LOGIN_VERIFY_REQUEST_TIME; -import static org.keycloak.testsuite.performance.LoginLogoutTestParameters.LOGOUT_VERIFY_REQUEST_TIME; -import org.keycloak.testsuite.performance.PerformanceTest; -import org.keycloak.testsuite.performance.OperationTimeoutException; -import static org.keycloak.testsuite.performance.LoginLogoutTestParameters.LOGIN_REQUEST_TIME; -import static org.keycloak.testsuite.performance.LoginLogoutTestParameters.LOGOUT_REQUEST_TIME; -import org.keycloak.testsuite.performance.PerformanceMeasurement; import org.keycloak.testsuite.performance.LoginLogoutTestParameters; +import org.keycloak.testsuite.performance.OperationTimeoutException; +import org.keycloak.testsuite.performance.PerformanceMeasurement; +import org.keycloak.testsuite.performance.PerformanceTest; +import org.keycloak.testsuite.performance.page.AppProfileJEE; + +import java.io.File; +import java.io.IOException; +import java.net.SocketException; +import java.net.SocketTimeoutException; +import java.net.URI; +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static java.net.HttpURLConnection.HTTP_OK; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; +import static org.keycloak.testsuite.performance.LoginLogoutTestParameters.ACCESS_REQUEST_TIME; +import static org.keycloak.testsuite.performance.LoginLogoutTestParameters.LOGIN_REQUEST_TIME; +import static org.keycloak.testsuite.performance.LoginLogoutTestParameters.LOGIN_VERIFY_REQUEST_TIME; +import static org.keycloak.testsuite.performance.LoginLogoutTestParameters.LOGOUT_REQUEST_TIME; +import static org.keycloak.testsuite.performance.LoginLogoutTestParameters.LOGOUT_VERIFY_REQUEST_TIME; import static org.keycloak.testsuite.performance.LoginLogoutTestParameters.PASSWORD_HASH_ITERATIONS; import static org.keycloak.testsuite.util.IOUtil.loadRealm; diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/test/java/org/keycloak/testsuite/performance/httpclient/HttpClientPerformanceTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/test/java/org/keycloak/testsuite/performance/httpclient/HttpClientPerformanceTest.java index e6504e5bea..6e159e477f 100644 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/test/java/org/keycloak/testsuite/performance/httpclient/HttpClientPerformanceTest.java +++ b/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/src/test/java/org/keycloak/testsuite/performance/httpclient/HttpClientPerformanceTest.java @@ -1,6 +1,5 @@ package org.keycloak.testsuite.performance.httpclient; -import java.io.IOException; import org.apache.http.client.config.CookieSpecs; import org.apache.http.client.config.RequestConfig; import org.apache.http.client.methods.HttpDelete; @@ -19,6 +18,9 @@ import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; import org.junit.After; import org.junit.Before; import org.keycloak.testsuite.performance.PerformanceTest; + +import java.io.IOException; + import static org.keycloak.testsuite.performance.PerformanceTest.MAX_THREADS; /** diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/wildfly/src/test/java/org/keycloak/testsuite/adapter/WildflyOIDCKerberosLdapAdapterTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/wildfly/src/test/java/org/keycloak/testsuite/adapter/WildflyOIDCKerberosLdapAdapterTest.java index 64dcb602db..166ae2c491 100644 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/wildfly/src/test/java/org/keycloak/testsuite/adapter/WildflyOIDCKerberosLdapAdapterTest.java +++ b/testsuite/integration-arquillian/tests/other/adapters/jboss/wildfly/src/test/java/org/keycloak/testsuite/adapter/WildflyOIDCKerberosLdapAdapterTest.java @@ -1,9 +1,7 @@ package org.keycloak.testsuite.adapter; -import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; -import org.junit.Ignore; import org.keycloak.testsuite.adapter.federation.AbstractKerberosLdapAdapterTest; -import org.keycloak.testsuite.adapter.servlet.AbstractDemoServletsAdapterTest; +import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; /** * diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/wildfly/src/test/java/org/keycloak/testsuite/adapter/WildflyOIDCKerberosStandaloneAdapterTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/wildfly/src/test/java/org/keycloak/testsuite/adapter/WildflyOIDCKerberosStandaloneAdapterTest.java index ce2c796396..91711b52d9 100644 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/wildfly/src/test/java/org/keycloak/testsuite/adapter/WildflyOIDCKerberosStandaloneAdapterTest.java +++ b/testsuite/integration-arquillian/tests/other/adapters/jboss/wildfly/src/test/java/org/keycloak/testsuite/adapter/WildflyOIDCKerberosStandaloneAdapterTest.java @@ -1,9 +1,7 @@ package org.keycloak.testsuite.adapter; -import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; -import org.junit.Ignore; import org.keycloak.testsuite.adapter.federation.AbstractKerberosStandaloneAdapterTest; -import org.keycloak.testsuite.adapter.servlet.AbstractDemoServletsAdapterTest; +import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; /** * diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/wildfly/src/test/java/org/keycloak/testsuite/adapter/example/authorization/WildflyServletAuthzAdapterTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/wildfly/src/test/java/org/keycloak/testsuite/adapter/example/authorization/WildflyServletAuthzAdapterTest.java index d50cf29c54..6ff0e1f86c 100644 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/wildfly/src/test/java/org/keycloak/testsuite/adapter/example/authorization/WildflyServletAuthzAdapterTest.java +++ b/testsuite/integration-arquillian/tests/other/adapters/jboss/wildfly/src/test/java/org/keycloak/testsuite/adapter/example/authorization/WildflyServletAuthzAdapterTest.java @@ -17,7 +17,6 @@ package org.keycloak.testsuite.adapter.example.authorization; import org.jboss.arquillian.container.test.api.RunAsClient; -import org.keycloak.testsuite.adapter.example.authorization.AbstractDefaultAuthzConfigAdapterTest; import org.keycloak.testsuite.adapter.example.authorization.AbstractServletAuthzAdapterTest; import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/wildfly9/src/test/java/org/keycloak/testsuite/adapter/Wildfly9SAMLFilterAdapterTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/wildfly9/src/test/java/org/keycloak/testsuite/adapter/Wildfly9SAMLFilterAdapterTest.java index 230cafabef..97cb6c6920 100644 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/wildfly9/src/test/java/org/keycloak/testsuite/adapter/Wildfly9SAMLFilterAdapterTest.java +++ b/testsuite/integration-arquillian/tests/other/adapters/jboss/wildfly9/src/test/java/org/keycloak/testsuite/adapter/Wildfly9SAMLFilterAdapterTest.java @@ -2,7 +2,6 @@ package org.keycloak.testsuite.adapter; import org.keycloak.testsuite.adapter.servlet.AbstractSAMLFilterServletAdapterTest; import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; -import org.keycloak.testsuite.arquillian.annotation.UseServletFilter; /** * @author mhajas diff --git a/testsuite/integration-arquillian/tests/other/clean-start/src/test/java/org/keycloak/testsuite/clean/start/CleanStartTest.java b/testsuite/integration-arquillian/tests/other/clean-start/src/test/java/org/keycloak/testsuite/clean/start/CleanStartTest.java index 31b230f116..2fbe818b98 100644 --- a/testsuite/integration-arquillian/tests/other/clean-start/src/test/java/org/keycloak/testsuite/clean/start/CleanStartTest.java +++ b/testsuite/integration-arquillian/tests/other/clean-start/src/test/java/org/keycloak/testsuite/clean/start/CleanStartTest.java @@ -19,10 +19,11 @@ package org.keycloak.testsuite.clean.start; import org.jboss.arquillian.container.test.api.RunAsClient; import org.jboss.arquillian.junit.Arquillian; -import static org.junit.Assert.assertTrue; import org.junit.Test; import org.junit.runner.RunWith; +import static org.junit.Assert.assertTrue; + /** * @author Vlastislav Ramik */ diff --git a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/authentication/Authentication.java b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/authentication/Authentication.java index fd700bae63..c2bbe103cb 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/authentication/Authentication.java +++ b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/authentication/Authentication.java @@ -3,6 +3,7 @@ package org.keycloak.testsuite.console.page.authentication; import org.keycloak.testsuite.console.page.AdminConsoleRealm; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; + import static org.keycloak.testsuite.util.WaitUtils.*; /** diff --git a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/authentication/PasswordPolicy.java b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/authentication/PasswordPolicy.java index aef6e93c3d..501583f79f 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/authentication/PasswordPolicy.java +++ b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/authentication/PasswordPolicy.java @@ -1,14 +1,11 @@ package org.keycloak.testsuite.console.page.authentication; -import org.jboss.arquillian.graphene.findby.ByJQuery; import org.keycloak.testsuite.page.Form; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.ui.Select; -import java.util.List; - import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; /** diff --git a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/authentication/bindings/BindingsForm.java b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/authentication/bindings/BindingsForm.java index d3e2f66d5d..77f1fe8c40 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/authentication/bindings/BindingsForm.java +++ b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/authentication/bindings/BindingsForm.java @@ -21,7 +21,6 @@ */ package org.keycloak.testsuite.console.page.authentication.bindings; -import org.keycloak.testsuite.console.page.authentication.bindings.BindingsForm.BindingsSelect; import org.keycloak.testsuite.page.Form; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.ui.Select; diff --git a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/authentication/flows/FlowsTable.java b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/authentication/flows/FlowsTable.java index 03c008e857..1e3401b0a6 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/authentication/flows/FlowsTable.java +++ b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/authentication/flows/FlowsTable.java @@ -21,11 +21,12 @@ */ package org.keycloak.testsuite.console.page.authentication.flows; -import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; +import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; + /** * * @author Vlastislav Ramik diff --git a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/authentication/otppolicy/OTPPolicyForm.java b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/authentication/otppolicy/OTPPolicyForm.java index 8414de9ce6..db3ee9da64 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/authentication/otppolicy/OTPPolicyForm.java +++ b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/authentication/otppolicy/OTPPolicyForm.java @@ -26,8 +26,6 @@ import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.ui.Select; -import java.util.List; - /** * * @author Vlastislav Ramik diff --git a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/Client.java b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/Client.java index 864ebeef15..0294a0422e 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/Client.java +++ b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/Client.java @@ -1,12 +1,12 @@ package org.keycloak.testsuite.console.page.clients; import org.jboss.arquillian.graphene.fragment.Root; -import org.keycloak.admin.client.resource.ClientResource; import org.keycloak.testsuite.console.page.fragment.Breadcrumb; -import static org.keycloak.testsuite.console.page.fragment.Breadcrumb.BREADCRUMB_XPATH; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; +import static org.keycloak.testsuite.console.page.fragment.Breadcrumb.BREADCRUMB_XPATH; + /** * * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/Clients.java b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/Clients.java index 8f52163bb6..a1588f4d22 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/Clients.java +++ b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/Clients.java @@ -17,15 +17,14 @@ */ package org.keycloak.testsuite.console.page.clients; +import org.keycloak.representations.idm.ClientRepresentation; +import org.keycloak.testsuite.console.page.AdminConsoleRealm; +import org.keycloak.testsuite.console.page.fragment.DataTable; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import java.util.ArrayList; import java.util.List; -import org.keycloak.admin.client.resource.ClientsResource; -import org.keycloak.representations.idm.ClientRepresentation; -import org.keycloak.testsuite.console.page.AdminConsoleRealm; -import org.keycloak.testsuite.console.page.fragment.DataTable; import static org.openqa.selenium.By.linkText; import static org.openqa.selenium.By.tagName; diff --git a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/CreateClientForm.java b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/CreateClientForm.java index c289e67c41..96ae7b781d 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/CreateClientForm.java +++ b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/CreateClientForm.java @@ -2,13 +2,14 @@ package org.keycloak.testsuite.console.page.clients; import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.testsuite.page.Form; -import static org.keycloak.testsuite.page.Form.getInputValue; -import static org.keycloak.testsuite.util.WaitUtils.*; import org.keycloak.testsuite.util.Timer; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.ui.Select; +import static org.keycloak.testsuite.page.Form.getInputValue; +import static org.keycloak.testsuite.util.WaitUtils.*; + /** * * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/credentials/ClientCredentialsForm.java b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/credentials/ClientCredentialsForm.java index d105a01171..3ec2773e74 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/credentials/ClientCredentialsForm.java +++ b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/credentials/ClientCredentialsForm.java @@ -25,6 +25,7 @@ import org.keycloak.testsuite.page.Form; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.ui.Select; + import static org.keycloak.testsuite.util.WaitUtils.*; /** diff --git a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/credentials/ClientCredentialsGeneratePrivateKeysForm.java b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/credentials/ClientCredentialsGeneratePrivateKeysForm.java index f5afcacdc6..9d8063edd0 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/credentials/ClientCredentialsGeneratePrivateKeysForm.java +++ b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/credentials/ClientCredentialsGeneratePrivateKeysForm.java @@ -22,11 +22,12 @@ package org.keycloak.testsuite.console.page.clients.credentials; import org.keycloak.testsuite.page.Form; -import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.ui.Select; +import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; + /** * * @author Vlastislav Ramik diff --git a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/mappers/ClientMappers.java b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/mappers/ClientMappers.java index 98eead5bac..1a1b3f1bc6 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/mappers/ClientMappers.java +++ b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/mappers/ClientMappers.java @@ -1,6 +1,7 @@ package org.keycloak.testsuite.console.page.clients.mappers; import org.keycloak.representations.idm.ProtocolMapperRepresentation; +import org.keycloak.testsuite.console.page.clients.Client; import org.keycloak.testsuite.console.page.fragment.DataTable; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; @@ -8,7 +9,6 @@ import org.openqa.selenium.support.FindBy; import java.util.ArrayList; import java.util.List; -import org.keycloak.testsuite.console.page.clients.Client; /** * diff --git a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/mappers/CreateClientMappersForm.java b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/mappers/CreateClientMappersForm.java index 70e4316f75..a4b3107919 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/mappers/CreateClientMappersForm.java +++ b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/mappers/CreateClientMappersForm.java @@ -3,7 +3,6 @@ package org.keycloak.testsuite.console.page.clients.mappers; import org.jboss.arquillian.drone.api.annotation.Drone; import org.keycloak.testsuite.console.page.fragment.OnOffSwitch; import org.keycloak.testsuite.page.Form; - import org.keycloak.testsuite.util.WaitUtils; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; diff --git a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/roles/ClientRoles.java b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/roles/ClientRoles.java index 67bbf529bf..eacb1018c4 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/roles/ClientRoles.java +++ b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/roles/ClientRoles.java @@ -1,7 +1,6 @@ package org.keycloak.testsuite.console.page.clients.roles; import org.keycloak.testsuite.console.page.clients.*; -import org.keycloak.admin.client.resource.RolesResource; import org.keycloak.testsuite.console.page.roles.RolesTable; import org.openqa.selenium.support.FindBy; diff --git a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/roles/CreateClientRole.java b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/roles/CreateClientRole.java index 96e2f032d2..891ca0b04c 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/roles/CreateClientRole.java +++ b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/roles/CreateClientRole.java @@ -1,8 +1,9 @@ package org.keycloak.testsuite.console.page.clients.roles; -import static org.keycloak.testsuite.console.page.clients.Client.ID; import org.keycloak.testsuite.console.page.roles.CreateRole; +import static org.keycloak.testsuite.console.page.clients.Client.ID; + /** * * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/settings/ClientSettingsForm.java b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/settings/ClientSettingsForm.java index 4b00a4e552..79092cd7d8 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/settings/ClientSettingsForm.java +++ b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/clients/settings/ClientSettingsForm.java @@ -1,18 +1,18 @@ package org.keycloak.testsuite.console.page.clients.settings; import org.keycloak.representations.idm.ClientRepresentation; +import org.keycloak.testsuite.console.page.clients.CreateClientForm; import org.keycloak.testsuite.console.page.fragment.OnOffSwitch; +import org.keycloak.testsuite.page.Form; import org.keycloak.testsuite.util.Timer; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; +import org.openqa.selenium.support.ui.Select; import java.util.ArrayList; import java.util.List; import java.util.Map; -import org.keycloak.testsuite.console.page.clients.CreateClientForm; -import org.openqa.selenium.support.ui.Select; -import org.keycloak.testsuite.page.Form; import static org.keycloak.testsuite.util.WaitUtils.pause; import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; diff --git a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/federation/KerberosUserProviderForm.java b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/federation/KerberosUserProviderForm.java index d19bae7054..1b815f08c1 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/federation/KerberosUserProviderForm.java +++ b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/federation/KerberosUserProviderForm.java @@ -1,7 +1,5 @@ package org.keycloak.testsuite.console.page.federation; -import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; - import org.keycloak.testsuite.console.page.fragment.OnOffSwitch; import org.keycloak.testsuite.page.Form; import org.openqa.selenium.By; @@ -9,6 +7,8 @@ import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.ui.Select; +import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; + /** * @author pdrozd */ diff --git a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/federation/LdapUserProviderForm.java b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/federation/LdapUserProviderForm.java index 2b77ee9c40..017468625d 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/federation/LdapUserProviderForm.java +++ b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/federation/LdapUserProviderForm.java @@ -1,8 +1,5 @@ package org.keycloak.testsuite.console.page.federation; -import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; -import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; - import org.jboss.arquillian.graphene.findby.FindByJQuery; import org.keycloak.testsuite.console.page.fragment.OnOffSwitch; import org.keycloak.testsuite.page.Form; @@ -14,6 +11,8 @@ import org.openqa.selenium.support.ui.Select; import java.util.ArrayList; import java.util.List; +import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; + /** * @author fkiss, pdrozd */ diff --git a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/federation/UserFederation.java b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/federation/UserFederation.java index 06405eefb7..525e130dea 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/federation/UserFederation.java +++ b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/federation/UserFederation.java @@ -5,12 +5,9 @@ import org.keycloak.testsuite.console.page.AdminConsoleRealm; import org.keycloak.testsuite.console.page.fragment.DataTable; import org.keycloak.testsuite.console.page.fragment.ModalDialog; import org.keycloak.testsuite.util.UIUtils; -import org.openqa.selenium.By; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.ui.Select; -import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; - /** * @author fkiss * @author Vaclav Muzikar diff --git a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/idp/IdentityProviderSettings.java b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/idp/IdentityProviderSettings.java index f3f91a7c45..1f176cdfc3 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/idp/IdentityProviderSettings.java +++ b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/idp/IdentityProviderSettings.java @@ -17,18 +17,19 @@ */ package org.keycloak.testsuite.console.page.idp; -import java.util.ArrayList; -import java.util.List; import org.jboss.arquillian.graphene.findby.FindByJQuery; -import org.keycloak.admin.client.resource.IdentityProvidersResource; +import org.keycloak.testsuite.console.page.AdminConsoleRealm; import org.keycloak.testsuite.model.Provider; import org.keycloak.testsuite.model.SocialProvider; -import org.keycloak.testsuite.console.page.AdminConsoleRealm; -import static org.openqa.selenium.By.tagName; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.ui.Select; +import java.util.ArrayList; +import java.util.List; + +import static org.openqa.selenium.By.tagName; + /** * * @author Petr Mensik diff --git a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/realm/CreateRealm.java b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/realm/CreateRealm.java index 63d3e15971..94e98461c0 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/realm/CreateRealm.java +++ b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/realm/CreateRealm.java @@ -19,11 +19,12 @@ package org.keycloak.testsuite.console.page.realm; import org.jboss.arquillian.drone.api.annotation.Drone; -import static org.openqa.selenium.By.id; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; +import static org.openqa.selenium.By.id; + /** * * @author Petr Mensik diff --git a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/realm/EmailSettings.java b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/realm/EmailSettings.java index a931cd60cd..a32dd04a9f 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/realm/EmailSettings.java +++ b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/realm/EmailSettings.java @@ -1,6 +1,5 @@ package org.keycloak.testsuite.console.page.realm; -import java.util.Map; import org.jboss.arquillian.graphene.findby.FindByJQuery; import org.jboss.arquillian.graphene.page.Page; import org.keycloak.testsuite.console.page.fragment.OnOffSwitch; @@ -8,6 +7,8 @@ import org.keycloak.testsuite.page.Form; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; +import java.util.Map; + /** * Created by mhajas on 8/25/15. */ diff --git a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/realm/RealmSettings.java b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/realm/RealmSettings.java index b6e51eba6d..a5ce751a6c 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/realm/RealmSettings.java +++ b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/realm/RealmSettings.java @@ -1,7 +1,6 @@ package org.keycloak.testsuite.console.page.realm; import org.keycloak.testsuite.console.page.AdminConsoleRealm; -import org.keycloak.testsuite.util.WaitUtils; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; diff --git a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/realm/ThemeSettings.java b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/realm/ThemeSettings.java index 4095cc99da..abd7f607be 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/realm/ThemeSettings.java +++ b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/realm/ThemeSettings.java @@ -21,9 +21,6 @@ import org.keycloak.testsuite.console.page.fragment.OnOffSwitch; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.ui.Select; -import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; -import org.openqa.selenium.By; - /** * * @author Filip Kiss diff --git a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/realm/TokenSettings.java b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/realm/TokenSettings.java index abeddb5d89..e93c34fc2e 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/realm/TokenSettings.java +++ b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/realm/TokenSettings.java @@ -17,16 +17,17 @@ */ package org.keycloak.testsuite.console.page.realm; -import java.util.concurrent.TimeUnit; +import org.jboss.arquillian.graphene.page.Page; +import org.keycloak.testsuite.page.Form; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.ui.Select; +import java.util.concurrent.TimeUnit; + import static java.lang.String.valueOf; -import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; import static org.apache.commons.lang3.text.WordUtils.capitalize; -import org.jboss.arquillian.graphene.page.Page; -import org.keycloak.testsuite.page.Form; +import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; /** * diff --git a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/roles/RoleCompositeRoles.java b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/roles/RoleCompositeRoles.java index eabaf0263d..b47fd50b45 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/roles/RoleCompositeRoles.java +++ b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/roles/RoleCompositeRoles.java @@ -1,5 +1,13 @@ package org.keycloak.testsuite.console.page.roles; +import org.keycloak.representations.idm.RoleRepresentation.Composites; +import org.keycloak.testsuite.page.Form; +import org.keycloak.testsuite.util.UIUtils; +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; +import org.openqa.selenium.support.ui.Select; + import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -8,17 +16,9 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; -import org.keycloak.representations.idm.RoleRepresentation.Composites; -import org.keycloak.testsuite.page.Form; import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; -import org.keycloak.testsuite.util.UIUtils; -import org.openqa.selenium.By; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.support.FindBy; -import org.openqa.selenium.support.ui.Select; - /** * * @author fkiss diff --git a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/roles/Roles.java b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/roles/Roles.java index 6c862557c5..49bef2769f 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/roles/Roles.java +++ b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/roles/Roles.java @@ -1,6 +1,5 @@ package org.keycloak.testsuite.console.page.roles; -import org.keycloak.admin.client.resource.RolesResource; import org.keycloak.testsuite.console.page.AdminConsoleRealm; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; diff --git a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/roles/RolesTable.java b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/roles/RolesTable.java index e0a9a51015..62b0a70659 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/roles/RolesTable.java +++ b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/roles/RolesTable.java @@ -1,11 +1,13 @@ package org.keycloak.testsuite.console.page.roles; +import org.keycloak.representations.idm.RoleRepresentation; +import org.keycloak.testsuite.console.page.fragment.DataTable; +import org.openqa.selenium.WebElement; + import java.util.ArrayList; import java.util.List; -import org.keycloak.representations.idm.RoleRepresentation; -import org.keycloak.testsuite.console.page.fragment.DataTable; + import static org.openqa.selenium.By.tagName; -import org.openqa.selenium.WebElement; /** * diff --git a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/users/User.java b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/users/User.java index 3b73ea1de1..4178ef5bb2 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/users/User.java +++ b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/users/User.java @@ -1,10 +1,10 @@ package org.keycloak.testsuite.console.page.users; import org.keycloak.testsuite.console.page.fragment.Breadcrumb; -import static org.keycloak.testsuite.console.page.fragment.Breadcrumb.BREADCRUMB_XPATH; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; +import static org.keycloak.testsuite.console.page.fragment.Breadcrumb.BREADCRUMB_XPATH; import static org.keycloak.testsuite.util.WaitUtils.*; /** diff --git a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/users/UserAttributesForm.java b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/users/UserAttributesForm.java index 4050f7dfef..6b77554121 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/users/UserAttributesForm.java +++ b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/users/UserAttributesForm.java @@ -1,14 +1,16 @@ package org.keycloak.testsuite.console.page.users; -import java.util.List; import org.keycloak.representations.idm.UserRepresentation; import org.keycloak.testsuite.console.page.fragment.OnOffSwitch; import org.keycloak.testsuite.page.Form; -import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.ui.Select; +import java.util.List; + +import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; + /** * * @author Filip Kiss diff --git a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/users/UserCredentials.java b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/users/UserCredentials.java index 277dd67f00..ff091a45ef 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/users/UserCredentials.java +++ b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/users/UserCredentials.java @@ -1,9 +1,10 @@ package org.keycloak.testsuite.console.page.users; import org.keycloak.testsuite.console.page.fragment.OnOffSwitch; -import static org.keycloak.testsuite.page.Form.setInputValue; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; + +import static org.keycloak.testsuite.page.Form.setInputValue; import static org.keycloak.testsuite.util.WaitUtils.*; /** diff --git a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/users/UserRoleMappings.java b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/users/UserRoleMappings.java index 32c6bac998..d8451f0ebd 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/users/UserRoleMappings.java +++ b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/users/UserRoleMappings.java @@ -1,7 +1,6 @@ package org.keycloak.testsuite.console.page.users; import org.jboss.arquillian.graphene.page.Page; -import org.keycloak.admin.client.resource.RoleMappingResource; /** * diff --git a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/users/UserRoleMappingsForm.java b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/users/UserRoleMappingsForm.java index 26290176a9..d9b4edb883 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/users/UserRoleMappingsForm.java +++ b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/users/UserRoleMappingsForm.java @@ -1,5 +1,7 @@ package org.keycloak.testsuite.console.page.users; +import org.keycloak.representations.idm.RoleRepresentation; +import org.keycloak.testsuite.console.page.roles.RoleCompositeRoles; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.ui.Select; @@ -7,8 +9,6 @@ import org.openqa.selenium.support.ui.Select; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.keycloak.representations.idm.RoleRepresentation; -import org.keycloak.testsuite.console.page.roles.RoleCompositeRoles; /** * Created by fkiss. diff --git a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/users/Users.java b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/users/Users.java index 87bd600f9f..7e4f417ba8 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/users/Users.java +++ b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/users/Users.java @@ -18,6 +18,9 @@ package org.keycloak.testsuite.console.page.users; import org.jboss.arquillian.drone.api.annotation.Drone; +import org.keycloak.representations.idm.UserRepresentation; +import org.keycloak.testsuite.console.page.AdminConsoleRealm; +import org.keycloak.testsuite.console.page.fragment.DataTable; import org.keycloak.testsuite.util.URLUtils; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; @@ -26,13 +29,8 @@ import org.openqa.selenium.support.FindBy; import java.util.ArrayList; import java.util.List; -import org.keycloak.representations.idm.UserRepresentation; - -import org.keycloak.testsuite.console.page.AdminConsoleRealm; -import org.keycloak.testsuite.console.page.fragment.DataTable; import static org.keycloak.testsuite.util.WaitUtils.waitForPageToLoad; -import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement; import static org.openqa.selenium.By.*; /** diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/AbstractConsoleTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/AbstractConsoleTest.java index dc81e13959..8f29a3f06e 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/AbstractConsoleTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/AbstractConsoleTest.java @@ -18,22 +18,23 @@ package org.keycloak.testsuite.console; import org.jboss.arquillian.graphene.page.Page; -import static org.junit.Assert.assertTrue; import org.junit.Before; import org.keycloak.representations.idm.UserRepresentation; import org.keycloak.testsuite.AbstractAuthTest; +import org.keycloak.testsuite.auth.page.login.Login; import org.keycloak.testsuite.console.page.AdminConsole; import org.keycloak.testsuite.console.page.AdminConsoleRealm; import org.keycloak.testsuite.console.page.AdminConsoleRealm.ConfigureMenu; import org.keycloak.testsuite.console.page.AdminConsoleRealm.ManageMenu; -import static org.keycloak.testsuite.auth.page.AuthRealm.TEST; -import org.keycloak.testsuite.auth.page.login.Login; import org.keycloak.testsuite.console.page.fragment.AdminConsoleAlert; import org.keycloak.testsuite.console.page.fragment.ModalDialog; -import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWithLoginUrlOf; -import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWith; import org.openqa.selenium.support.FindBy; +import static org.junit.Assert.assertTrue; +import static org.keycloak.testsuite.auth.page.AuthRealm.TEST; +import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWith; +import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWithLoginUrlOf; + /** * * @author Petr Mensik diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/authentication/BindingsTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/authentication/BindingsTest.java index a89eac66f8..14fc7a9681 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/authentication/BindingsTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/authentication/BindingsTest.java @@ -22,7 +22,6 @@ package org.keycloak.testsuite.console.authentication; import org.jboss.arquillian.graphene.page.Page; -import static org.junit.Assert.assertEquals; import org.junit.Before; import org.junit.Test; import org.keycloak.representations.idm.RealmRepresentation; @@ -31,6 +30,8 @@ import org.keycloak.testsuite.console.page.authentication.bindings.Bindings; import org.keycloak.testsuite.console.page.authentication.bindings.BindingsForm.BindingsOption; import org.keycloak.testsuite.console.page.authentication.bindings.BindingsForm.BindingsSelect; +import static org.junit.Assert.assertEquals; + /** * * @author Vlastislav Ramik diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/authentication/FlowsTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/authentication/FlowsTest.java index 7b2a874918..d3dfb226fb 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/authentication/FlowsTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/authentication/FlowsTest.java @@ -22,7 +22,6 @@ package org.keycloak.testsuite.console.authentication; import org.jboss.arquillian.graphene.page.Page; -import static org.junit.Assert.*; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; @@ -34,6 +33,8 @@ import org.keycloak.testsuite.console.page.authentication.flows.CreateFlowForm; import org.keycloak.testsuite.console.page.authentication.flows.Flows; import org.keycloak.testsuite.console.page.authentication.flows.FlowsTable; +import static org.junit.Assert.*; + /** * * @author Vlastislav Ramik diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/authentication/OTPPolicyTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/authentication/OTPPolicyTest.java index 1f2e22fc20..b838fd7525 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/authentication/OTPPolicyTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/authentication/OTPPolicyTest.java @@ -22,9 +22,7 @@ package org.keycloak.testsuite.console.authentication; import org.jboss.arquillian.graphene.page.Page; -import static org.junit.Assert.*; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.testsuite.console.AbstractConsoleTest; @@ -34,6 +32,8 @@ import org.keycloak.testsuite.console.page.authentication.otppolicy.OTPPolicyFor import org.keycloak.testsuite.console.page.authentication.otppolicy.OTPPolicyForm.OTPType; import org.keycloak.testsuite.util.WaitUtils; +import static org.junit.Assert.*; + /** * * @author Vlastislav Ramik diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/authentication/PasswordPolicyTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/authentication/PasswordPolicyTest.java index e70acd4f30..f20348a6da 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/authentication/PasswordPolicyTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/authentication/PasswordPolicyTest.java @@ -26,7 +26,6 @@ import org.keycloak.testsuite.console.page.authentication.PasswordPolicy; import org.keycloak.testsuite.console.page.users.UserCredentials; import static org.keycloak.testsuite.console.page.authentication.PasswordPolicy.Type.DIGITS; -import static org.keycloak.testsuite.console.page.authentication.PasswordPolicy.Type.HASH_ITERATIONS; import static org.keycloak.testsuite.console.page.authentication.PasswordPolicy.Type.REGEX_PATTERN; /** diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/authentication/actions/TermsAndConditionsTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/authentication/actions/TermsAndConditionsTest.java index f518784f99..f9ee517f20 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/authentication/actions/TermsAndConditionsTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/authentication/actions/TermsAndConditionsTest.java @@ -17,21 +17,21 @@ */ package org.keycloak.testsuite.console.authentication.actions; -import java.util.ArrayList; -import java.util.List; import org.jboss.arquillian.graphene.page.Page; import org.junit.Assert; import org.junit.Test; import org.keycloak.admin.client.resource.RealmResource; import org.keycloak.representations.idm.CredentialRepresentation; import org.keycloak.representations.idm.RealmRepresentation; - import org.keycloak.representations.idm.UserRepresentation; import org.keycloak.testsuite.auth.page.login.Registration; import org.keycloak.testsuite.auth.page.login.TermsAndConditions; import org.keycloak.testsuite.console.AbstractConsoleTest; import org.keycloak.testsuite.console.page.authentication.RequiredActions; +import java.util.ArrayList; +import java.util.List; + /** * */ diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/AbstractClientTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/AbstractClientTest.java index 5ba0484615..887e708b86 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/AbstractClientTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/AbstractClientTest.java @@ -1,27 +1,24 @@ package org.keycloak.testsuite.console.clients; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; import org.jboss.arquillian.graphene.page.Page; import org.junit.Before; import org.keycloak.admin.client.resource.ClientResource; import org.keycloak.admin.client.resource.ClientsResource; import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.representations.idm.ProtocolMapperRepresentation; -import static org.keycloak.testsuite.auth.page.login.OIDCLogin.OIDC; -import static org.keycloak.testsuite.auth.page.login.OIDCLogin.SAML; import org.keycloak.testsuite.console.AbstractConsoleTest; import org.keycloak.testsuite.console.page.clients.Client; import org.keycloak.testsuite.console.page.clients.Clients; import org.keycloak.testsuite.console.page.clients.CreateClient; -import org.keycloak.testsuite.util.WaitUtils; -import org.openqa.selenium.By; -import static org.keycloak.testsuite.util.AttributesAssert.assertEqualsBooleanAttributes; -import static org.keycloak.testsuite.util.AttributesAssert.assertEqualsListAttributes; -import static org.keycloak.testsuite.util.AttributesAssert.assertEqualsStringAttributes; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import static org.junit.Assert.assertEquals; +import static org.keycloak.testsuite.auth.page.login.OIDCLogin.OIDC; +import static org.keycloak.testsuite.auth.page.login.OIDCLogin.SAML; import static org.keycloak.testsuite.console.page.clients.settings.ClientSettingsForm.SAMLClientSettingsForm.SAML_AUTHNSTATEMENT; import static org.keycloak.testsuite.console.page.clients.settings.ClientSettingsForm.SAMLClientSettingsForm.SAML_CLIENT_SIGNATURE; import static org.keycloak.testsuite.console.page.clients.settings.ClientSettingsForm.SAMLClientSettingsForm.SAML_FORCE_NAME_ID_FORMAT; @@ -29,6 +26,9 @@ import static org.keycloak.testsuite.console.page.clients.settings.ClientSetting import static org.keycloak.testsuite.console.page.clients.settings.ClientSettingsForm.SAMLClientSettingsForm.SAML_NAME_ID_FORMAT; import static org.keycloak.testsuite.console.page.clients.settings.ClientSettingsForm.SAMLClientSettingsForm.SAML_SERVER_SIGNATURE; import static org.keycloak.testsuite.console.page.clients.settings.ClientSettingsForm.SAMLClientSettingsForm.SAML_SIGNATURE_ALGORITHM; +import static org.keycloak.testsuite.util.AttributesAssert.assertEqualsBooleanAttributes; +import static org.keycloak.testsuite.util.AttributesAssert.assertEqualsListAttributes; +import static org.keycloak.testsuite.util.AttributesAssert.assertEqualsStringAttributes; import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlEquals; /** diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientAuthorizationServicesAvailableTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientAuthorizationServicesAvailableTest.java index 0dcf08bf9d..c24da58978 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientAuthorizationServicesAvailableTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientAuthorizationServicesAvailableTest.java @@ -18,7 +18,6 @@ package org.keycloak.testsuite.console.clients; import org.jboss.arquillian.graphene.page.Page; import org.junit.Test; -import org.keycloak.common.Profile; import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.testsuite.ProfileAssume; import org.keycloak.testsuite.console.page.clients.settings.ClientSettings; diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientClusteringTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientClusteringTest.java index d0c6743e9c..25e05a1e86 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientClusteringTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientClusteringTest.java @@ -22,13 +22,14 @@ package org.keycloak.testsuite.console.clients; import org.jboss.arquillian.graphene.page.Page; -import static org.junit.Assert.*; import org.junit.Before; import org.junit.Test; import org.keycloak.representations.idm.ClientRepresentation; -import static org.keycloak.testsuite.auth.page.login.Login.OIDC; import org.keycloak.testsuite.console.page.clients.clustering.ClientClustering; +import static org.junit.Assert.*; +import static org.keycloak.testsuite.auth.page.login.Login.OIDC; + /** * * @author Vlastislav Ramik diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientCredentialsTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientCredentialsTest.java index d489f4e5cc..6495c01a14 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientCredentialsTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientCredentialsTest.java @@ -22,13 +22,14 @@ package org.keycloak.testsuite.console.clients; import org.jboss.arquillian.graphene.page.Page; -import static org.junit.Assert.*; import org.junit.Before; import org.junit.Test; import org.keycloak.representations.idm.ClientRepresentation; -import static org.keycloak.testsuite.auth.page.login.Login.OIDC; import org.keycloak.testsuite.console.page.clients.credentials.ClientCredentials; import org.keycloak.testsuite.console.page.clients.credentials.ClientCredentialsGeneratePrivateKeys; + +import static org.junit.Assert.*; +import static org.keycloak.testsuite.auth.page.login.Login.OIDC; import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlEquals; /** diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientInstallationTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientInstallationTest.java index 0af4bf4229..53bfdb3247 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientInstallationTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientInstallationTest.java @@ -22,13 +22,14 @@ package org.keycloak.testsuite.console.clients; import org.jboss.arquillian.graphene.page.Page; -import static org.junit.Assert.*; import org.junit.Before; import org.junit.Test; import org.keycloak.representations.idm.ClientRepresentation; -import static org.keycloak.testsuite.auth.page.login.Login.OIDC; import org.keycloak.testsuite.console.page.clients.installation.ClientInstallation; +import static org.junit.Assert.*; +import static org.keycloak.testsuite.auth.page.login.Login.OIDC; + /** * * @author Vlastislav Ramik diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientMappersOIDCTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientMappersOIDCTest.java index 850bb39bdf..0d8e6b2cd8 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientMappersOIDCTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientMappersOIDCTest.java @@ -21,21 +21,22 @@ */ package org.keycloak.testsuite.console.clients; -import java.util.HashMap; -import java.util.List; -import java.util.Map; import org.jboss.arquillian.graphene.page.Page; -import org.junit.Test; - -import static org.junit.Assert.*; import org.junit.Before; +import org.junit.Test; import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.representations.idm.ProtocolMapperRepresentation; -import static org.keycloak.testsuite.auth.page.login.Login.OIDC; -import static org.keycloak.testsuite.console.clients.AbstractClientTest.createClientRep; import org.keycloak.testsuite.console.page.clients.mappers.ClientMapper; import org.keycloak.testsuite.console.page.clients.mappers.ClientMappers; import org.keycloak.testsuite.console.page.clients.mappers.CreateClientMappers; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.junit.Assert.*; +import static org.keycloak.testsuite.auth.page.login.Login.OIDC; +import static org.keycloak.testsuite.console.clients.AbstractClientTest.createClientRep; import static org.keycloak.testsuite.console.page.clients.mappers.CreateClientMappersForm.*; /** diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientMappersSAMLTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientMappersSAMLTest.java index c822c232a2..07a8d44e1f 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientMappersSAMLTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientMappersSAMLTest.java @@ -21,19 +21,20 @@ */ package org.keycloak.testsuite.console.clients; -import java.util.Map; import org.jboss.arquillian.graphene.page.Page; -import org.junit.Test; - -import static org.junit.Assert.*; import org.junit.Before; +import org.junit.Test; import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.representations.idm.ProtocolMapperRepresentation; -import static org.keycloak.testsuite.auth.page.login.Login.SAML; -import static org.keycloak.testsuite.console.clients.AbstractClientTest.createClientRep; import org.keycloak.testsuite.console.page.clients.mappers.ClientMapper; import org.keycloak.testsuite.console.page.clients.mappers.ClientMappers; import org.keycloak.testsuite.console.page.clients.mappers.CreateClientMappers; + +import java.util.Map; + +import static org.junit.Assert.*; +import static org.keycloak.testsuite.auth.page.login.Login.SAML; +import static org.keycloak.testsuite.console.clients.AbstractClientTest.createClientRep; import static org.keycloak.testsuite.console.page.clients.mappers.CreateClientMappersForm.*; /** diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientRolesTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientRolesTest.java index 64304d0ac0..4b7db30b8b 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientRolesTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientRolesTest.java @@ -1,22 +1,23 @@ package org.keycloak.testsuite.console.clients; -import java.util.List; import org.jboss.arquillian.graphene.page.Page; -import org.junit.Test; -import org.keycloak.testsuite.console.page.users.UserRoleMappingsForm; - -import static org.junit.Assert.*; import org.junit.Before; +import org.junit.Test; import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.representations.idm.RoleRepresentation; -import static org.keycloak.testsuite.auth.page.login.Login.OIDC; -import static org.keycloak.testsuite.console.clients.AbstractClientTest.createClientRep; import org.keycloak.testsuite.console.page.clients.roles.ClientRole; import org.keycloak.testsuite.console.page.clients.roles.ClientRoles; import org.keycloak.testsuite.console.page.clients.roles.CreateClientRole; import org.keycloak.testsuite.console.page.users.User; +import org.keycloak.testsuite.console.page.users.UserRoleMappingsForm; import org.keycloak.testsuite.util.URLAssert; +import java.util.List; + +import static org.junit.Assert.*; +import static org.keycloak.testsuite.auth.page.login.Login.OIDC; +import static org.keycloak.testsuite.console.clients.AbstractClientTest.createClientRep; + /** * Created by fkiss. */ diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientScopeTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientScopeTest.java index 69509f20ec..1c9d03eddf 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientScopeTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientScopeTest.java @@ -21,10 +21,7 @@ */ package org.keycloak.testsuite.console.clients; -import java.util.List; -import java.util.Map; import org.jboss.arquillian.graphene.page.Page; -import static org.junit.Assert.*; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; @@ -32,9 +29,14 @@ import org.keycloak.representations.idm.ClientMappingsRepresentation; import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.representations.idm.MappingsRepresentation; import org.keycloak.representations.idm.RoleRepresentation; -import static org.keycloak.testsuite.auth.page.login.Login.OIDC; import org.keycloak.testsuite.console.page.clients.scope.ClientScope; +import java.util.List; +import java.util.Map; + +import static org.junit.Assert.*; +import static org.keycloak.testsuite.auth.page.login.Login.OIDC; + /** * * @author Vlastislav Ramik diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientSettingsTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientSettingsTest.java index 8090475451..446990184d 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientSettingsTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientSettingsTest.java @@ -17,25 +17,23 @@ */ package org.keycloak.testsuite.console.clients; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.ws.rs.core.Response; import org.jboss.arquillian.graphene.page.Page; -import static org.junit.Assert.*; import org.junit.Test; - import org.keycloak.representations.idm.ClientRepresentation; -import static org.keycloak.testsuite.admin.ApiUtil.getCreatedId; +import org.keycloak.testsuite.console.page.clients.settings.ClientSettings; +import org.keycloak.testsuite.util.Timer; + +import javax.ws.rs.core.Response; +import java.util.ArrayList; +import java.util.List; + +import static org.junit.Assert.*; import static org.keycloak.testsuite.auth.page.login.Login.OIDC; import static org.keycloak.testsuite.auth.page.login.Login.SAML; -import org.keycloak.testsuite.console.page.clients.settings.ClientSettings; import static org.keycloak.testsuite.console.page.clients.settings.ClientSettingsForm.OidcAccessType.BEARER_ONLY; import static org.keycloak.testsuite.console.page.clients.settings.ClientSettingsForm.OidcAccessType.CONFIDENTIAL; import static org.keycloak.testsuite.console.page.clients.settings.ClientSettingsForm.SAMLClientSettingsForm.*; import static org.keycloak.testsuite.util.WaitUtils.pause; -import org.keycloak.testsuite.util.Timer; /** * diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientsTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientsTest.java index c45e40f748..cf0969c902 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientsTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/clients/ClientsTest.java @@ -22,14 +22,14 @@ package org.keycloak.testsuite.console.clients; import org.jboss.arquillian.graphene.page.Page; -import static org.junit.Assert.*; import org.junit.Before; import org.junit.Test; import org.keycloak.representations.idm.ClientRepresentation; +import org.keycloak.testsuite.console.page.clients.settings.ClientSettings; + +import static org.junit.Assert.*; import static org.keycloak.testsuite.auth.page.login.Login.OIDC; import static org.keycloak.testsuite.console.clients.AbstractClientTest.createClientRep; -import org.keycloak.testsuite.console.page.clients.settings.ClientSettings; -import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlEquals; import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlEquals; /** diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/events/AdminEventsTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/events/AdminEventsTest.java index 59901026b7..a5a937ae25 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/events/AdminEventsTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/events/AdminEventsTest.java @@ -24,6 +24,7 @@ package org.keycloak.testsuite.console.events; import org.jboss.arquillian.graphene.page.Page; import org.junit.Before; import org.junit.Test; +import org.keycloak.admin.client.resource.ClientsResource; import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.testsuite.admin.ApiUtil; @@ -38,7 +39,6 @@ import javax.ws.rs.core.Response; import java.util.List; import static org.junit.Assert.assertEquals; -import org.keycloak.admin.client.resource.ClientsResource; import static org.keycloak.testsuite.auth.page.login.Login.OIDC; import static org.keycloak.testsuite.console.clients.AbstractClientTest.createClientRep; diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/events/LoginEventsTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/events/LoginEventsTest.java index f573e8f17b..7a12f61a67 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/events/LoginEventsTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/events/LoginEventsTest.java @@ -15,7 +15,6 @@ import java.util.Arrays; import java.util.List; import static org.junit.Assert.assertEquals; -import org.junit.Ignore; import static org.keycloak.representations.idm.CredentialRepresentation.PASSWORD; /** diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/federation/KerberosUserFederationTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/federation/KerberosUserFederationTest.java index 7eff1628d2..79ea899e9a 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/federation/KerberosUserFederationTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/federation/KerberosUserFederationTest.java @@ -1,7 +1,5 @@ package org.keycloak.testsuite.console.federation; -import static org.junit.Assert.assertEquals; - import org.jboss.arquillian.graphene.page.Page; import org.junit.Test; import org.keycloak.representations.idm.RealmRepresentation; @@ -9,6 +7,8 @@ import org.keycloak.representations.idm.UserFederationProviderRepresentation; import org.keycloak.testsuite.console.AbstractConsoleTest; import org.keycloak.testsuite.console.page.federation.CreateKerberosUserProvider; +import static org.junit.Assert.assertEquals; + /** * @author pdrozd */ diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/federation/LdapUserFederationTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/federation/LdapUserFederationTest.java index fa57cdf5ec..2d405eabc2 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/federation/LdapUserFederationTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/federation/LdapUserFederationTest.java @@ -1,21 +1,19 @@ package org.keycloak.testsuite.console.federation; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import java.util.List; -import java.util.Properties; - import org.apache.commons.configuration.ConfigurationException; import org.jboss.arquillian.graphene.page.Page; -import org.junit.Ignore; import org.junit.Test; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.representations.idm.UserFederationProviderRepresentation; import org.keycloak.testsuite.console.AbstractConsoleTest; import org.keycloak.testsuite.console.page.federation.CreateLdapUserProvider; import org.keycloak.util.ldap.LDAPEmbeddedServer; -import org.openqa.selenium.WebElement; + +import java.util.List; +import java.util.Properties; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; /** * @author fkiss, pdrozd diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/idp/IdentityProviderTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/idp/IdentityProviderTest.java index e4f7f84af3..72d899167c 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/idp/IdentityProviderTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/idp/IdentityProviderTest.java @@ -18,14 +18,15 @@ package org.keycloak.testsuite.console.idp; import org.jboss.arquillian.graphene.page.Page; -import static org.junit.Assert.*; import org.junit.Ignore; import org.junit.Test; -import org.keycloak.testsuite.console.page.idp.IdentityProviderSettings; import org.keycloak.testsuite.console.AbstractConsoleTest; +import org.keycloak.testsuite.console.page.idp.IdentityProviderSettings; import org.keycloak.testsuite.model.Provider; import org.keycloak.testsuite.model.SocialProvider; +import static org.junit.Assert.*; + /** * * @author Petr Mensik diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/realm/InternationalizationTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/realm/InternationalizationTest.java index 97cb3086bc..50bf4f177f 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/realm/InternationalizationTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/realm/InternationalizationTest.java @@ -11,6 +11,7 @@ import org.keycloak.testsuite.console.page.realm.ThemeSettings; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; + import static org.junit.Assert.*; import static org.keycloak.testsuite.util.URLAssert.*; diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/realm/LoginSettingsTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/realm/LoginSettingsTest.java index 75f86a2033..9495cdefea 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/realm/LoginSettingsTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/realm/LoginSettingsTest.java @@ -17,32 +17,32 @@ */ package org.keycloak.testsuite.console.realm; -import java.util.HashSet; -import java.util.Set; import org.jboss.arquillian.graphene.page.Page; import org.junit.Assert; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; import org.junit.Before; import org.junit.Test; -import static org.keycloak.representations.idm.CredentialRepresentation.PASSWORD; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.representations.idm.UserRepresentation; -import static org.keycloak.testsuite.admin.ApiUtil.createUserAndResetPasswordWithAdminClient; -import static org.keycloak.testsuite.admin.Users.setPasswordFor; -import static org.keycloak.testsuite.auth.page.AuthRealm.TEST; import org.keycloak.testsuite.auth.page.account.Account; -import org.keycloak.testsuite.console.page.realm.LoginSettings; import org.keycloak.testsuite.auth.page.login.Registration; import org.keycloak.testsuite.auth.page.login.ResetCredentials; import org.keycloak.testsuite.auth.page.login.VerifyEmail; +import org.keycloak.testsuite.console.page.realm.LoginSettings; import org.keycloak.testsuite.console.page.realm.LoginSettings.RequireSSLOption; import org.keycloak.testsuite.util.MailServer; -import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlEquals; -import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWith; - import org.openqa.selenium.Cookie; +import java.util.HashSet; +import java.util.Set; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.keycloak.representations.idm.CredentialRepresentation.PASSWORD; +import static org.keycloak.testsuite.admin.ApiUtil.createUserAndResetPasswordWithAdminClient; +import static org.keycloak.testsuite.admin.Users.setPasswordFor; +import static org.keycloak.testsuite.auth.page.AuthRealm.TEST; +import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWith; + /** * * @author tkyjovsk diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/realm/SecurityDefensesTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/realm/SecurityDefensesTest.java index 1f47c1ea3f..3f1726118d 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/realm/SecurityDefensesTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/realm/SecurityDefensesTest.java @@ -26,12 +26,13 @@ import org.keycloak.testsuite.console.page.users.UserAttributes; import org.keycloak.testsuite.console.page.users.Users; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; + +import static org.junit.Assert.*; import static org.keycloak.representations.idm.CredentialRepresentation.PASSWORD; import static org.keycloak.testsuite.admin.Users.setPasswordFor; import static org.keycloak.testsuite.auth.page.AuthRealm.TEST; import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWith; import static org.keycloak.testsuite.util.WaitUtils.*; -import static org.junit.Assert.*; /** * @author Filip Kiss diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/realm/TokensTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/realm/TokensTest.java index 9121d92cdc..b022d1310d 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/realm/TokensTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/realm/TokensTest.java @@ -17,15 +17,15 @@ */ package org.keycloak.testsuite.console.realm; -import java.util.concurrent.TimeUnit; +import org.jboss.arquillian.graphene.page.Page; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.keycloak.testsuite.console.page.realm.TokenSettings; -import org.jboss.arquillian.graphene.page.Page; -import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWithLoginUrlOf; +import java.util.concurrent.TimeUnit; + import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWith; +import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWithLoginUrlOf; /** * diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/roles/AbstractRolesTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/roles/AbstractRolesTest.java index cb66b8fcb6..701e798dc4 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/roles/AbstractRolesTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/roles/AbstractRolesTest.java @@ -2,7 +2,6 @@ package org.keycloak.testsuite.console.roles; import org.jboss.arquillian.graphene.page.Page; import org.junit.Before; -import org.keycloak.admin.client.resource.RoleMappingResource; import org.keycloak.testsuite.console.AbstractConsoleTest; import org.keycloak.testsuite.console.page.roles.Roles; import org.keycloak.testsuite.console.page.users.User; diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/roles/DefaultRolesTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/roles/DefaultRolesTest.java index 202d0040c6..780b23339c 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/roles/DefaultRolesTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/roles/DefaultRolesTest.java @@ -1,17 +1,18 @@ package org.keycloak.testsuite.console.roles; import org.jboss.arquillian.graphene.page.Page; -import static org.junit.Assert.assertTrue; import org.junit.Before; import org.junit.Test; import org.keycloak.admin.client.resource.RolesResource; import org.keycloak.representations.idm.RoleRepresentation; import org.keycloak.representations.idm.UserRepresentation; -import static org.keycloak.testsuite.admin.ApiUtil.createUserWithAdminClient; import org.keycloak.testsuite.console.page.roles.DefaultRoles; import org.keycloak.testsuite.console.page.users.UserRoleMappings; import org.keycloak.testsuite.console.page.users.Users; +import static org.junit.Assert.assertTrue; +import static org.keycloak.testsuite.admin.ApiUtil.createUserWithAdminClient; + /** * Created by fkiss. */ diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/roles/RealmRolesTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/roles/RealmRolesTest.java index 76a2bf829d..953892e9c0 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/roles/RealmRolesTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/roles/RealmRolesTest.java @@ -1,18 +1,18 @@ package org.keycloak.testsuite.console.roles; import org.jboss.arquillian.graphene.page.Page; -import org.junit.Test; -import org.keycloak.testsuite.console.page.roles.RealmRoles; - -import static org.junit.Assert.*; import org.junit.Before; import org.junit.Ignore; +import org.junit.Test; import org.keycloak.representations.idm.RoleRepresentation; import org.keycloak.testsuite.console.page.roles.CreateRole; +import org.keycloak.testsuite.console.page.roles.RealmRoles; import org.keycloak.testsuite.console.page.roles.Role; +import org.keycloak.testsuite.util.Timer; + +import static org.junit.Assert.*; import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlEquals; import static org.keycloak.testsuite.util.WaitUtils.pause; -import org.keycloak.testsuite.util.Timer; /** * diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/sessions/SessionsTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/sessions/SessionsTest.java index e78ef332ba..573972659e 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/sessions/SessionsTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/sessions/SessionsTest.java @@ -22,6 +22,7 @@ import org.junit.Ignore; import org.junit.Test; import org.keycloak.testsuite.console.AbstractConsoleTest; import org.keycloak.testsuite.console.page.sessions.RealmSessions; + import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWithLoginUrlOf; /** diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/themes/TermsAndConditionsThemeTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/themes/TermsAndConditionsThemeTest.java index 69e0c8a4b7..df218470ad 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/themes/TermsAndConditionsThemeTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/themes/TermsAndConditionsThemeTest.java @@ -16,7 +16,6 @@ */ package org.keycloak.testsuite.console.themes; -import java.util.List; import org.jboss.arquillian.graphene.page.Page; import org.junit.Assert; import org.junit.Test; @@ -26,6 +25,8 @@ import org.keycloak.testsuite.auth.page.login.TermsAndConditions; import org.keycloak.testsuite.console.AbstractConsoleTest; import org.keycloak.testsuite.console.page.authentication.RequiredActions; +import java.util.List; + /** * */ diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/users/AbstractUserTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/users/AbstractUserTest.java index 585080d729..81d8c5af7e 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/users/AbstractUserTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/users/AbstractUserTest.java @@ -8,6 +8,7 @@ import org.keycloak.representations.idm.UserRepresentation; import org.keycloak.testsuite.console.AbstractConsoleTest; import org.keycloak.testsuite.console.page.users.CreateUser; import org.keycloak.testsuite.console.page.users.Users; + import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlEquals; import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWith; diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/users/UserAttributesTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/users/UserAttributesTest.java index a2857b2418..03428ae283 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/users/UserAttributesTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/users/UserAttributesTest.java @@ -18,13 +18,13 @@ package org.keycloak.testsuite.console.users; import org.jboss.arquillian.graphene.page.Page; +import org.junit.Before; import org.junit.Test; +import org.keycloak.representations.idm.UserRepresentation; +import org.keycloak.testsuite.console.page.users.UserAttributes; import static org.junit.Assert.*; -import org.junit.Before; -import org.keycloak.representations.idm.UserRepresentation; import static org.keycloak.testsuite.admin.Users.setPasswordFor; -import org.keycloak.testsuite.console.page.users.UserAttributes; /** * diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/users/UsersTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/users/UsersTest.java index d0e95f521b..2f5121b477 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/users/UsersTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/users/UsersTest.java @@ -1,13 +1,15 @@ package org.keycloak.testsuite.console.users; -import javax.ws.rs.core.Response; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import org.keycloak.representations.idm.UserRepresentation; +import org.keycloak.testsuite.util.Timer; + +import javax.ws.rs.core.Response; + import static org.keycloak.testsuite.admin.ApiUtil.getCreatedId; import static org.keycloak.testsuite.util.WaitUtils.pause; -import org.keycloak.testsuite.util.Timer; /** * diff --git a/testsuite/integration-arquillian/tests/other/console_no_users/src/test/java/org/keycloak/testsuite/console/pages/WelcomePageTest.java b/testsuite/integration-arquillian/tests/other/console_no_users/src/test/java/org/keycloak/testsuite/console/pages/WelcomePageTest.java index 04332e82f5..6c61094f6e 100644 --- a/testsuite/integration-arquillian/tests/other/console_no_users/src/test/java/org/keycloak/testsuite/console/pages/WelcomePageTest.java +++ b/testsuite/integration-arquillian/tests/other/console_no_users/src/test/java/org/keycloak/testsuite/console/pages/WelcomePageTest.java @@ -1,18 +1,18 @@ package org.keycloak.testsuite.console.pages; +import org.jboss.arquillian.graphene.page.Page; +import org.junit.runners.MethodSorters; +import org.keycloak.representations.idm.RealmRepresentation; +import org.keycloak.testsuite.AbstractKeycloakTest; +import org.keycloak.testsuite.auth.page.WelcomePage; +import org.keycloak.testsuite.auth.page.login.OIDCLogin; + import java.net.InetAddress; import java.net.NetworkInterface; import java.net.URL; import java.util.Collections; import java.util.Enumeration; import java.util.List; -import org.jboss.arquillian.graphene.page.Page; -import org.junit.*; -import org.junit.runners.MethodSorters; -import org.keycloak.representations.idm.RealmRepresentation; -import org.keycloak.testsuite.AbstractKeycloakTest; -import org.keycloak.testsuite.auth.page.WelcomePage; -import org.keycloak.testsuite.auth.page.login.OIDCLogin; /** * diff --git a/testsuite/integration-arquillian/tests/other/jpa-performance/src/test/java/org/keycloak/testsuite/user/ManyUsersTest.java b/testsuite/integration-arquillian/tests/other/jpa-performance/src/test/java/org/keycloak/testsuite/user/ManyUsersTest.java index bbbb9d306b..c37473149e 100644 --- a/testsuite/integration-arquillian/tests/other/jpa-performance/src/test/java/org/keycloak/testsuite/user/ManyUsersTest.java +++ b/testsuite/integration-arquillian/tests/other/jpa-performance/src/test/java/org/keycloak/testsuite/user/ManyUsersTest.java @@ -1,5 +1,23 @@ package org.keycloak.testsuite.user; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.keycloak.admin.client.resource.RealmResource; +import org.keycloak.admin.client.resource.UsersResource; +import org.keycloak.models.UserModel; +import org.keycloak.representations.idm.CredentialRepresentation; +import org.keycloak.representations.idm.FederatedIdentityRepresentation; +import org.keycloak.representations.idm.GroupRepresentation; +import org.keycloak.representations.idm.RealmRepresentation; +import org.keycloak.representations.idm.RequiredActionProviderRepresentation; +import org.keycloak.representations.idm.UserRepresentation; +import org.keycloak.testsuite.admin.ApiUtil; +import org.keycloak.testsuite.util.Timer; +import org.keycloak.util.JsonSerialization; + +import javax.ws.rs.core.Response; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; @@ -11,28 +29,8 @@ import java.util.List; import java.util.Map; import java.util.UUID; -import javax.ws.rs.core.Response; - -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.keycloak.admin.client.resource.UsersResource; -import org.keycloak.authentication.requiredactions.UpdatePassword; -import org.keycloak.models.UserCredentialModel; -import org.keycloak.models.UserModel; -import org.keycloak.representations.idm.CredentialRepresentation; -import org.keycloak.representations.idm.FederatedIdentityRepresentation; -import org.keycloak.representations.idm.GroupRepresentation; -import org.keycloak.representations.idm.RequiredActionProviderRepresentation; -import org.keycloak.representations.idm.UserRepresentation; -import org.keycloak.testsuite.admin.ApiUtil; -import org.keycloak.testsuite.util.Timer; -import org.keycloak.representations.idm.RealmRepresentation; -import org.keycloak.util.JsonSerialization; -import org.keycloak.admin.client.resource.RealmResource; -import static org.keycloak.testsuite.util.IOUtil.PROJECT_BUILD_DIRECTORY; import static org.junit.Assert.fail; +import static org.keycloak.testsuite.util.IOUtil.PROJECT_BUILD_DIRECTORY; /** * diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/AssertEvents.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/AssertEvents.java index c7f27c8cb3..02486fba52 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/AssertEvents.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/AssertEvents.java @@ -27,12 +27,12 @@ import org.junit.runners.model.Statement; import org.keycloak.Config; import org.keycloak.OAuth2Constants; import org.keycloak.authentication.authenticators.client.ClientIdAndSecretAuthenticator; -import org.keycloak.events.admin.AdminEvent; import org.keycloak.events.Details; import org.keycloak.events.Event; import org.keycloak.events.EventListenerProvider; import org.keycloak.events.EventListenerProviderFactory; import org.keycloak.events.EventType; +import org.keycloak.events.admin.AdminEvent; import org.keycloak.models.ClientModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.KeycloakSessionFactory; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/OAuthClient.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/OAuthClient.java index 12c1f303ad..46d62b83c2 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/OAuthClient.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/OAuthClient.java @@ -31,6 +31,7 @@ import org.junit.Assert; import org.keycloak.OAuth2Constants; import org.keycloak.RSATokenVerifier; import org.keycloak.common.VerificationException; +import org.keycloak.common.util.PemUtils; import org.keycloak.constants.AdapterConstants; import org.keycloak.jose.jws.JWSInput; import org.keycloak.jose.jws.crypto.RSAProvider; @@ -38,7 +39,6 @@ import org.keycloak.protocol.oidc.OIDCLoginProtocolService; import org.keycloak.representations.AccessToken; import org.keycloak.representations.RefreshToken; import org.keycloak.util.BasicAuthHelper; -import org.keycloak.common.util.PemUtils; import org.keycloak.util.TokenUtil; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/adapter/AdapterTestStrategy.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/adapter/AdapterTestStrategy.java index adea44e0b3..cd15bdde5e 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/adapter/AdapterTestStrategy.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/adapter/AdapterTestStrategy.java @@ -27,7 +27,11 @@ import org.keycloak.admin.client.Keycloak; import org.keycloak.common.Version; import org.keycloak.common.util.Time; import org.keycloak.constants.AdapterConstants; -import org.keycloak.models.*; +import org.keycloak.models.ClientModel; +import org.keycloak.models.Constants; +import org.keycloak.models.KeycloakSession; +import org.keycloak.models.RealmModel; +import org.keycloak.models.UserModel; import org.keycloak.protocol.oidc.OIDCLoginProtocolService; import org.keycloak.representations.VersionRepresentation; import org.keycloak.representations.idm.RealmRepresentation; @@ -38,7 +42,11 @@ import org.keycloak.testsuite.KeycloakServer; import org.keycloak.testsuite.OAuthClient; import org.keycloak.testsuite.pages.AccountSessionsPage; import org.keycloak.testsuite.pages.LoginPage; -import org.keycloak.testsuite.rule.*; +import org.keycloak.testsuite.rule.AbstractKeycloakRule; +import org.keycloak.testsuite.rule.ErrorServlet; +import org.keycloak.testsuite.rule.KeycloakRule; +import org.keycloak.testsuite.rule.WebResource; +import org.keycloak.testsuite.rule.WebRule; import org.keycloak.util.BasicAuthHelper; import org.openqa.selenium.WebDriver; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/adapter/CookieTokenStoreAdapterTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/adapter/CookieTokenStoreAdapterTest.java index 02e34a7bcc..07d3140b71 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/adapter/CookieTokenStoreAdapterTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/adapter/CookieTokenStoreAdapterTest.java @@ -17,30 +17,29 @@ package org.keycloak.testsuite.adapter; -import java.net.URL; - -import javax.ws.rs.core.UriBuilder; - import org.junit.Assert; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; +import org.keycloak.common.util.Time; import org.keycloak.constants.AdapterConstants; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; import org.keycloak.protocol.oidc.OIDCLoginProtocolService; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.services.managers.RealmManager; +import org.keycloak.testsuite.KeycloakServer; import org.keycloak.testsuite.OAuthClient; import org.keycloak.testsuite.pages.LoginPage; import org.keycloak.testsuite.rule.AbstractKeycloakRule; import org.keycloak.testsuite.rule.WebResource; import org.keycloak.testsuite.rule.WebRule; -import org.keycloak.testsuite.KeycloakServer; -import org.keycloak.common.util.Time; import org.openqa.selenium.Cookie; import org.openqa.selenium.WebDriver; +import javax.ws.rs.core.UriBuilder; +import java.net.URL; + /** * KEYCLOAK-702 * diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/adapter/CustomerServlet.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/adapter/CustomerServlet.java index a3aa330ce4..9ac7002951 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/adapter/CustomerServlet.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/adapter/CustomerServlet.java @@ -25,7 +25,6 @@ import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; import javax.ws.rs.client.Client; import javax.ws.rs.client.ClientBuilder; import javax.ws.rs.client.WebTarget; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/adapter/InputServlet.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/adapter/InputServlet.java index b6a0bd5b4e..8b87d1cb0e 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/adapter/InputServlet.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/adapter/InputServlet.java @@ -24,7 +24,6 @@ import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; import java.io.IOException; import java.io.PrintWriter; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/adapter/MultiTenancyTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/adapter/MultiTenancyTest.java index 994fde5ea8..0d232f8731 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/adapter/MultiTenancyTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/adapter/MultiTenancyTest.java @@ -16,7 +16,6 @@ */ package org.keycloak.testsuite.adapter; -import javax.ws.rs.core.UriBuilder; import org.junit.Assert; import org.junit.ClassRule; import org.junit.Rule; @@ -26,13 +25,15 @@ import org.keycloak.models.RealmModel; import org.keycloak.protocol.oidc.OIDCLoginProtocolService; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.services.managers.RealmManager; +import org.keycloak.testsuite.KeycloakServer; import org.keycloak.testsuite.pages.LoginPage; import org.keycloak.testsuite.rule.AbstractKeycloakRule; import org.keycloak.testsuite.rule.WebResource; import org.keycloak.testsuite.rule.WebRule; -import org.keycloak.testsuite.KeycloakServer; import org.openqa.selenium.WebDriver; +import javax.ws.rs.core.UriBuilder; + /** * * @author Juraci Paixão Kröhling diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/adapter/MultiTenantResolver.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/adapter/MultiTenantResolver.java index 5845af758a..688bf485f3 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/adapter/MultiTenantResolver.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/adapter/MultiTenantResolver.java @@ -16,11 +16,12 @@ */ package org.keycloak.testsuite.adapter; -import java.io.InputStream; -import org.keycloak.adapters.spi.HttpFacade; import org.keycloak.adapters.KeycloakConfigResolver; import org.keycloak.adapters.KeycloakDeployment; import org.keycloak.adapters.KeycloakDeploymentBuilder; +import org.keycloak.adapters.spi.HttpFacade; + +import java.io.InputStream; /** * diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/adapter/RelativeUriAdapterTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/adapter/RelativeUriAdapterTest.java index bb30461fa1..e0d5d6ce37 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/adapter/RelativeUriAdapterTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/adapter/RelativeUriAdapterTest.java @@ -28,12 +28,12 @@ import org.keycloak.models.RealmModel; import org.keycloak.protocol.oidc.OIDCLoginProtocolService; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.services.managers.RealmManager; +import org.keycloak.testsuite.KeycloakServer; import org.keycloak.testsuite.OAuthClient; import org.keycloak.testsuite.pages.LoginPage; import org.keycloak.testsuite.rule.AbstractKeycloakRule; import org.keycloak.testsuite.rule.WebResource; import org.keycloak.testsuite.rule.WebRule; -import org.keycloak.testsuite.KeycloakServer; import org.openqa.selenium.WebDriver; import javax.ws.rs.core.UriBuilder; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/adapter/SessionServlet.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/adapter/SessionServlet.java index c669ccfec5..cd2b2b6355 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/adapter/SessionServlet.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/adapter/SessionServlet.java @@ -17,14 +17,13 @@ package org.keycloak.testsuite.adapter; -import java.io.IOException; -import java.io.PrintWriter; - import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; +import java.io.IOException; +import java.io.PrintWriter; /** * @author Marek Posolda diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/adduser/AddUserTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/adduser/AddUserTest.java index 6c10322aaf..477ffa8603 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/adduser/AddUserTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/adduser/AddUserTest.java @@ -28,7 +28,11 @@ import org.keycloak.admin.client.resource.RealmResource; import org.keycloak.admin.client.resource.UserResource; import org.keycloak.hash.Pbkdf2PasswordHashProvider; import org.keycloak.models.Constants; -import org.keycloak.representations.idm.*; +import org.keycloak.representations.idm.ClientRepresentation; +import org.keycloak.representations.idm.CredentialRepresentation; +import org.keycloak.representations.idm.RealmRepresentation; +import org.keycloak.representations.idm.RoleRepresentation; +import org.keycloak.representations.idm.UserRepresentation; import org.keycloak.testsuite.KeycloakServer; import org.keycloak.util.JsonSerialization; import org.keycloak.wildfly.adduser.AddUser; @@ -38,7 +42,10 @@ import java.io.FileInputStream; import java.io.IOException; import java.util.List; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.fail; /** * @author Stian Thorgersen diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/authorization/AbstractPhotozAdminTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/authorization/AbstractPhotozAdminTest.java index 1faf21e4c0..c9b69d8bff 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/authorization/AbstractPhotozAdminTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/authorization/AbstractPhotozAdminTest.java @@ -57,8 +57,6 @@ import java.util.Map; import java.util.Set; import java.util.stream.Collectors; -import static org.jboss.aesh.terminal.Key.e; - /** * @author Pedro Igor */ diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/authorization/AttributeTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/authorization/AttributeTest.java index 86e1ba0998..fade20cfaa 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/authorization/AttributeTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/authorization/AttributeTest.java @@ -30,7 +30,9 @@ import java.util.Map; import java.util.function.Consumer; import static java.util.Arrays.asList; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; /** * @author Pedro Igor diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/authorization/KeycloakAuthorizationServerRule.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/authorization/KeycloakAuthorizationServerRule.java index 1df0b615dd..0fe8c59da5 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/authorization/KeycloakAuthorizationServerRule.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/authorization/KeycloakAuthorizationServerRule.java @@ -19,7 +19,6 @@ package org.keycloak.testsuite.authorization; import org.keycloak.models.KeycloakSession; -import org.keycloak.models.KeycloakSessionFactory; import org.keycloak.models.RealmModel; import org.keycloak.services.managers.RealmManager; import org.keycloak.testsuite.rule.AbstractKeycloakRule; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/authorization/ResourceManagementTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/authorization/ResourceManagementTest.java index 4a6f9b61b7..086b5ac94c 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/authorization/ResourceManagementTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/authorization/ResourceManagementTest.java @@ -28,7 +28,9 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; /** * @author Pedro Igor diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/authorization/ResourcePermissionManagementTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/authorization/ResourcePermissionManagementTest.java index 50ab943b1d..195835c261 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/authorization/ResourcePermissionManagementTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/authorization/ResourcePermissionManagementTest.java @@ -42,7 +42,9 @@ import java.util.List; import java.util.Map; import java.util.Set; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; /** * @author Pedro Igor diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/authorization/ScopeManagementTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/authorization/ScopeManagementTest.java index 4566fe6b68..4695e55dd9 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/authorization/ScopeManagementTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/authorization/ScopeManagementTest.java @@ -28,7 +28,9 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; /** * @author Pedro Igor diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/AbstractFirstBrokerLoginTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/AbstractFirstBrokerLoginTest.java index 67b82bb046..474417c218 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/AbstractFirstBrokerLoginTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/AbstractFirstBrokerLoginTest.java @@ -17,14 +17,6 @@ package org.keycloak.testsuite.broker; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.mail.internet.MimeMessage; - import org.junit.Assert; import org.junit.Test; import org.keycloak.authentication.authenticators.broker.IdpCreateUserIfUniqueAuthenticatorFactory; @@ -49,8 +41,14 @@ import org.openqa.selenium.By; import org.openqa.selenium.NoSuchElementException; import org.openqa.selenium.WebElement; +import javax.mail.internet.MimeMessage; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/AbstractIdentityProviderModelTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/AbstractIdentityProviderModelTest.java index dda283beb0..cebe067acf 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/AbstractIdentityProviderModelTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/AbstractIdentityProviderModelTest.java @@ -22,9 +22,9 @@ import org.keycloak.broker.saml.SAMLIdentityProviderFactory; import org.keycloak.social.facebook.FacebookIdentityProviderFactory; import org.keycloak.social.github.GitHubIdentityProviderFactory; import org.keycloak.social.google.GoogleIdentityProviderFactory; -import org.keycloak.social.twitter.TwitterIdentityProviderFactory; import org.keycloak.social.linkedin.LinkedInIdentityProviderFactory; import org.keycloak.social.stackoverflow.StackoverflowIdentityProviderFactory; +import org.keycloak.social.twitter.TwitterIdentityProviderFactory; import org.keycloak.testsuite.model.AbstractModelTest; import java.util.Collections; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/AbstractIdentityProviderTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/AbstractIdentityProviderTest.java index 75871488cf..8efc8c0ba3 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/AbstractIdentityProviderTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/AbstractIdentityProviderTest.java @@ -56,17 +56,14 @@ import javax.mail.MessagingException; import javax.mail.Multipart; import javax.mail.internet.MimeMessage; import javax.ws.rs.core.UriBuilder; - import java.io.IOException; import java.net.URI; import java.util.List; import java.util.Set; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; /** * @author pedroigor diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/AbstractKeycloakIdentityProviderTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/AbstractKeycloakIdentityProviderTest.java index 1583853b98..9cad056222 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/AbstractKeycloakIdentityProviderTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/AbstractKeycloakIdentityProviderTest.java @@ -17,21 +17,6 @@ package org.keycloak.testsuite.broker; -import java.io.IOException; -import java.net.URI; -import java.util.HashMap; -import java.util.Set; - -import javax.mail.MessagingException; -import javax.mail.internet.MimeMessage; -import javax.ws.rs.client.Client; -import javax.ws.rs.client.ClientBuilder; -import javax.ws.rs.client.ClientRequestContext; -import javax.ws.rs.client.ClientRequestFilter; -import javax.ws.rs.client.WebTarget; -import javax.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.Response; - import org.junit.Assert; import org.junit.Test; import org.keycloak.models.ClientModel; @@ -50,6 +35,20 @@ import org.keycloak.testsuite.federation.DummyUserFederationProviderFactory; import org.openqa.selenium.By; import org.openqa.selenium.NoSuchElementException; +import javax.mail.MessagingException; +import javax.mail.internet.MimeMessage; +import javax.ws.rs.client.Client; +import javax.ws.rs.client.ClientBuilder; +import javax.ws.rs.client.ClientRequestContext; +import javax.ws.rs.client.ClientRequestFilter; +import javax.ws.rs.client.WebTarget; +import javax.ws.rs.core.HttpHeaders; +import javax.ws.rs.core.Response; +import java.io.IOException; +import java.net.URI; +import java.util.HashMap; +import java.util.Set; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/IdentityProviderRegistrationTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/IdentityProviderRegistrationTest.java index a3662223d7..51470ae1c9 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/IdentityProviderRegistrationTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/IdentityProviderRegistrationTest.java @@ -19,9 +19,9 @@ package org.keycloak.testsuite.broker; import org.junit.Test; import org.keycloak.broker.provider.IdentityProvider; import org.keycloak.broker.provider.IdentityProviderFactory; -import org.keycloak.models.IdentityProviderModel; import org.keycloak.broker.social.SocialIdentityProvider; import org.keycloak.broker.social.SocialIdentityProviderFactory; +import org.keycloak.models.IdentityProviderModel; import org.keycloak.testsuite.broker.provider.CustomIdentityProvider; import org.keycloak.testsuite.broker.provider.CustomIdentityProviderFactory; import org.keycloak.testsuite.broker.provider.social.CustomSocialProvider; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/ImportIdentityProviderTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/ImportIdentityProviderTest.java index d4ad05f8c9..cee8544c6b 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/ImportIdentityProviderTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/ImportIdentityProviderTest.java @@ -16,11 +16,6 @@ */ package org.keycloak.testsuite.broker; -import java.io.IOException; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - import org.junit.Assert; import org.junit.Test; import org.keycloak.broker.oidc.OAuth2IdentityProviderConfig; @@ -48,6 +43,11 @@ import org.keycloak.social.stackoverflow.StackoverflowIdentityProviderFactory; import org.keycloak.social.twitter.TwitterIdentityProvider; import org.keycloak.social.twitter.TwitterIdentityProviderFactory; +import java.io.IOException; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/OIDCBrokerUserPropertyTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/OIDCBrokerUserPropertyTest.java index c23bfed517..c3e013549a 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/OIDCBrokerUserPropertyTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/OIDCBrokerUserPropertyTest.java @@ -34,7 +34,10 @@ import org.keycloak.testsuite.rule.AbstractKeycloakRule; import javax.mail.MessagingException; import java.io.IOException; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.fail; /** * Test that the broker AttributeMapper maps user properties like email, firstName, and lastName diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/OIDCFirstBrokerLoginTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/OIDCFirstBrokerLoginTest.java index 3a3df528b9..e3e5441a63 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/OIDCFirstBrokerLoginTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/OIDCFirstBrokerLoginTest.java @@ -17,8 +17,6 @@ package org.keycloak.testsuite.broker; -import java.util.Set; - import org.junit.Assert; import org.junit.ClassRule; import org.junit.Test; @@ -36,6 +34,8 @@ import org.keycloak.testsuite.rule.AbstractKeycloakRule; import org.keycloak.testsuite.rule.KeycloakRule; import org.openqa.selenium.NoSuchElementException; +import java.util.Set; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/OIDCKeyCloakServerBrokerBasicTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/OIDCKeyCloakServerBrokerBasicTest.java index d79d85f729..ab195eadc7 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/OIDCKeyCloakServerBrokerBasicTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/OIDCKeyCloakServerBrokerBasicTest.java @@ -28,16 +28,15 @@ import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.services.Urls; import org.keycloak.services.managers.RealmManager; import org.keycloak.testsuite.Constants; +import org.keycloak.testsuite.KeycloakServer; import org.keycloak.testsuite.pages.AccountApplicationsPage; import org.keycloak.testsuite.rule.AbstractKeycloakRule; import org.keycloak.testsuite.rule.WebResource; -import org.keycloak.testsuite.KeycloakServer; import org.keycloak.util.JsonSerialization; import org.openqa.selenium.NoSuchElementException; -import java.io.IOException; - import javax.ws.rs.core.UriBuilder; +import java.io.IOException; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.fail; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/OIDCKeycloakServerBrokerWithConsentTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/OIDCKeycloakServerBrokerWithConsentTest.java index d648cdd538..078666fb43 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/OIDCKeycloakServerBrokerWithConsentTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/OIDCKeycloakServerBrokerWithConsentTest.java @@ -17,8 +17,6 @@ package org.keycloak.testsuite.broker; -import java.util.List; - import org.junit.Assert; import org.junit.BeforeClass; import org.junit.ClassRule; @@ -37,6 +35,8 @@ import org.keycloak.testsuite.KeycloakServer; import org.keycloak.testsuite.rule.AbstractKeycloakRule; import org.openqa.selenium.NoSuchElementException; +import java.util.List; + import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/PostBrokerFlowTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/PostBrokerFlowTest.java index d5fe80d7f5..77252e9ca6 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/PostBrokerFlowTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/PostBrokerFlowTest.java @@ -17,10 +17,6 @@ package org.keycloak.testsuite.broker; -import java.util.Arrays; -import java.util.List; -import java.util.Set; - import org.junit.Assert; import org.junit.ClassRule; import org.junit.Test; @@ -43,6 +39,10 @@ import org.keycloak.testsuite.pages.LoginTotpPage; import org.keycloak.testsuite.rule.AbstractKeycloakRule; import org.keycloak.testsuite.rule.WebResource; +import java.util.Arrays; +import java.util.List; +import java.util.Set; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/SAMLBrokerUserPropertyTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/SAMLBrokerUserPropertyTest.java index 037b808cbc..bbbbc479d1 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/SAMLBrokerUserPropertyTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/SAMLBrokerUserPropertyTest.java @@ -34,7 +34,10 @@ import org.keycloak.testsuite.rule.AbstractKeycloakRule; import javax.mail.MessagingException; import java.io.IOException; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.fail; /** * @author pedroigor diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/SAMLKeyCloakServerBrokerBasicTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/SAMLKeyCloakServerBrokerBasicTest.java index bc8d486cc2..3b83f03955 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/SAMLKeyCloakServerBrokerBasicTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/SAMLKeyCloakServerBrokerBasicTest.java @@ -19,16 +19,16 @@ package org.keycloak.testsuite.broker; import org.junit.ClassRule; import org.junit.Test; +import org.keycloak.dom.saml.v2.protocol.ResponseType; import org.keycloak.models.IdentityProviderModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; import org.keycloak.models.UserModel; -import org.keycloak.services.managers.RealmManager; -import org.keycloak.testsuite.rule.AbstractKeycloakRule; -import org.keycloak.testsuite.KeycloakServer; import org.keycloak.saml.processing.api.saml.v2.request.SAML2Request; -import org.keycloak.dom.saml.v2.protocol.ResponseType; import org.keycloak.saml.processing.web.util.PostBindingUtil; +import org.keycloak.services.managers.RealmManager; +import org.keycloak.testsuite.KeycloakServer; +import org.keycloak.testsuite.rule.AbstractKeycloakRule; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/SAMLKeyCloakServerBrokerWithSignatureTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/SAMLKeyCloakServerBrokerWithSignatureTest.java index fd29309d5c..8a453a7fe6 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/SAMLKeyCloakServerBrokerWithSignatureTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/SAMLKeyCloakServerBrokerWithSignatureTest.java @@ -19,16 +19,16 @@ package org.keycloak.testsuite.broker; import org.junit.ClassRule; import org.junit.Test; +import org.keycloak.dom.saml.v2.protocol.ResponseType; import org.keycloak.models.IdentityProviderModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; import org.keycloak.models.UserModel; -import org.keycloak.services.managers.RealmManager; -import org.keycloak.testsuite.rule.AbstractKeycloakRule; -import org.keycloak.testsuite.KeycloakServer; import org.keycloak.saml.processing.api.saml.v2.request.SAML2Request; -import org.keycloak.dom.saml.v2.protocol.ResponseType; import org.keycloak.saml.processing.web.util.PostBindingUtil; +import org.keycloak.services.managers.RealmManager; +import org.keycloak.testsuite.KeycloakServer; +import org.keycloak.testsuite.rule.AbstractKeycloakRule; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/provider/social/CustomSocialProvider.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/provider/social/CustomSocialProvider.java index b473be13a2..869c226a84 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/provider/social/CustomSocialProvider.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/provider/social/CustomSocialProvider.java @@ -18,9 +18,9 @@ package org.keycloak.testsuite.broker.provider.social; import org.keycloak.broker.provider.AbstractIdentityProvider; import org.keycloak.broker.provider.AuthenticationRequest; +import org.keycloak.broker.social.SocialIdentityProvider; import org.keycloak.models.FederatedIdentityModel; import org.keycloak.models.IdentityProviderModel; -import org.keycloak.broker.social.SocialIdentityProvider; import org.keycloak.models.KeycloakSession; import javax.ws.rs.core.Response; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/provider/social/CustomSocialProviderFactory.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/provider/social/CustomSocialProviderFactory.java index 85273d5211..b7ae3949e0 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/provider/social/CustomSocialProviderFactory.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/provider/social/CustomSocialProviderFactory.java @@ -17,8 +17,8 @@ package org.keycloak.testsuite.broker.provider.social; import org.keycloak.broker.provider.AbstractIdentityProviderFactory; -import org.keycloak.models.IdentityProviderModel; import org.keycloak.broker.social.SocialIdentityProviderFactory; +import org.keycloak.models.IdentityProviderModel; /** * @author pedroigor diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/AbstractKerberosTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/AbstractKerberosTest.java index 12f0f5ed11..0663e2855f 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/AbstractKerberosTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/AbstractKerberosTest.java @@ -17,12 +17,6 @@ package org.keycloak.testsuite.federation; -import java.security.Principal; -import java.util.List; - -import javax.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.Response; - import org.apache.http.auth.AuthScope; import org.apache.http.auth.Credentials; import org.apache.http.client.params.AuthPolicy; @@ -36,9 +30,9 @@ import org.junit.Before; import org.junit.Test; import org.keycloak.adapters.HttpClientBuilder; import org.keycloak.authentication.authenticators.browser.SpnegoAuthenticator; +import org.keycloak.common.constants.KerberosConstants; import org.keycloak.events.Details; import org.keycloak.federation.kerberos.CommonKerberosConfig; -import org.keycloak.common.constants.KerberosConstants; import org.keycloak.models.ClientModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.LDAPConstants; @@ -59,6 +53,11 @@ import org.keycloak.testsuite.rule.KeycloakRule; import org.keycloak.testsuite.rule.WebResource; import org.openqa.selenium.WebDriver; +import javax.ws.rs.core.HttpHeaders; +import javax.ws.rs.core.Response; +import java.security.Principal; +import java.util.List; + /** * @author Marek Posolda */ diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/KerberosCredDelegServlet.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/KerberosCredDelegServlet.java index c533c2bda8..33b1012698 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/KerberosCredDelegServlet.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/KerberosCredDelegServlet.java @@ -17,9 +17,10 @@ package org.keycloak.testsuite.federation; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Hashtable; +import org.ietf.jgss.GSSCredential; +import org.keycloak.KeycloakPrincipal; +import org.keycloak.common.constants.KerberosConstants; +import org.keycloak.common.util.KerberosSerializationUtils; import javax.naming.Context; import javax.naming.NamingException; @@ -31,11 +32,9 @@ import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; - -import org.ietf.jgss.GSSCredential; -import org.keycloak.KeycloakPrincipal; -import org.keycloak.common.constants.KerberosConstants; -import org.keycloak.common.util.KerberosSerializationUtils; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.Hashtable; /** * @author Marek Posolda diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/KerberosLdapTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/KerberosLdapTest.java index 67c5ba891c..f4a625f7c5 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/KerberosLdapTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/KerberosLdapTest.java @@ -17,11 +17,6 @@ package org.keycloak.testsuite.federation; -import java.net.URL; -import java.util.Map; - -import javax.ws.rs.core.Response; - import org.junit.Assert; import org.junit.ClassRule; import org.junit.Rule; @@ -43,6 +38,10 @@ import org.keycloak.testsuite.rule.KeycloakRule; import org.keycloak.testsuite.rule.WebRule; import org.keycloak.utils.CredentialHelper; +import javax.ws.rs.core.Response; +import java.net.URL; +import java.util.Map; + /** * Test of LDAPFederationProvider (Kerberos backed by LDAP) * diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/KerberosStandaloneTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/KerberosStandaloneTest.java index e6bfd1d023..d3eb5c22c0 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/KerberosStandaloneTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/KerberosStandaloneTest.java @@ -17,21 +17,16 @@ package org.keycloak.testsuite.federation; -import java.net.URL; -import java.util.Map; - -import javax.ws.rs.core.Response; - import org.junit.Assert; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; import org.junit.rules.RuleChain; import org.junit.rules.TestRule; +import org.keycloak.common.constants.KerberosConstants; import org.keycloak.federation.kerberos.CommonKerberosConfig; import org.keycloak.federation.kerberos.KerberosConfig; import org.keycloak.federation.kerberos.KerberosFederationProviderFactory; -import org.keycloak.common.constants.KerberosConstants; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; import org.keycloak.models.UserFederationProviderModel; @@ -43,6 +38,10 @@ import org.keycloak.testsuite.rule.KeycloakRule; import org.keycloak.testsuite.rule.WebRule; import org.keycloak.utils.CredentialHelper; +import javax.ws.rs.core.Response; +import java.net.URL; +import java.util.Map; + /** * Test of KerberosFederationProvider (Kerberos not backed by LDAP) * diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/KeycloakSPNegoSchemeFactory.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/KeycloakSPNegoSchemeFactory.java index 23fd276f5a..83fb5837ad 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/KeycloakSPNegoSchemeFactory.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/KeycloakSPNegoSchemeFactory.java @@ -17,10 +17,6 @@ package org.keycloak.testsuite.federation; -import java.security.PrivilegedExceptionAction; - -import javax.security.auth.Subject; - import org.apache.http.auth.AuthScheme; import org.apache.http.auth.Credentials; import org.apache.http.impl.auth.SPNegoScheme; @@ -34,6 +30,9 @@ import org.ietf.jgss.Oid; import org.keycloak.federation.kerberos.CommonKerberosConfig; import org.keycloak.federation.kerberos.impl.KerberosUsernamePasswordAuthenticator; +import javax.security.auth.Subject; +import java.security.PrivilegedExceptionAction; + /** * Usable for testing only. Username and password are shared for the whole factory * diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/FederationTestUtils.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/FederationTestUtils.java index febb327172..f8f83faafe 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/FederationTestUtils.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/FederationTestUtils.java @@ -17,13 +17,6 @@ package org.keycloak.testsuite.federation.ldap; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - import org.junit.Assert; import org.keycloak.federation.ldap.LDAPFederationProvider; import org.keycloak.federation.ldap.LDAPFederationProviderFactory; @@ -31,14 +24,14 @@ import org.keycloak.federation.ldap.LDAPUtils; import org.keycloak.federation.ldap.idm.model.LDAPObject; import org.keycloak.federation.ldap.idm.query.internal.LDAPQuery; import org.keycloak.federation.ldap.idm.store.ldap.LDAPIdentityStore; +import org.keycloak.federation.ldap.mappers.UserAttributeLDAPFederationMapper; +import org.keycloak.federation.ldap.mappers.UserAttributeLDAPFederationMapperFactory; import org.keycloak.federation.ldap.mappers.membership.LDAPGroupMapperMode; +import org.keycloak.federation.ldap.mappers.membership.group.GroupLDAPFederationMapper; import org.keycloak.federation.ldap.mappers.membership.group.GroupLDAPFederationMapperFactory; import org.keycloak.federation.ldap.mappers.membership.group.GroupMapperConfig; import org.keycloak.federation.ldap.mappers.membership.role.RoleLDAPFederationMapper; import org.keycloak.federation.ldap.mappers.membership.role.RoleLDAPFederationMapperFactory; -import org.keycloak.federation.ldap.mappers.UserAttributeLDAPFederationMapper; -import org.keycloak.federation.ldap.mappers.UserAttributeLDAPFederationMapperFactory; -import org.keycloak.federation.ldap.mappers.membership.group.GroupLDAPFederationMapper; import org.keycloak.federation.ldap.mappers.membership.role.RoleMapperConfig; import org.keycloak.models.KeycloakSession; import org.keycloak.models.LDAPConstants; @@ -54,6 +47,13 @@ import org.keycloak.models.utils.KeycloakModelUtils; import org.keycloak.models.utils.UserModelDelegate; import org.keycloak.representations.idm.CredentialRepresentation; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + /** * @author Marek Posolda */ diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPExampleServlet.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPExampleServlet.java index be43ca9127..8f6b874abd 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPExampleServlet.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPExampleServlet.java @@ -17,18 +17,16 @@ package org.keycloak.testsuite.federation.ldap; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.List; -import java.util.Map; +import org.keycloak.KeycloakSecurityContext; +import org.keycloak.representations.IDToken; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; - -import org.keycloak.KeycloakSecurityContext; -import org.keycloak.representations.IDToken; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.Map; /** * @author Marek Posolda diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPTestConfiguration.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPTestConfiguration.java index 3d9cbcef57..4a5adb0cbf 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPTestConfiguration.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPTestConfiguration.java @@ -17,6 +17,11 @@ package org.keycloak.testsuite.federation.ldap; +import org.jboss.logging.Logger; +import org.keycloak.common.constants.KerberosConstants; +import org.keycloak.models.LDAPConstants; +import org.keycloak.models.UserFederationProvider; + import java.io.File; import java.io.InputStream; import java.net.URL; @@ -24,11 +29,6 @@ import java.util.HashMap; import java.util.Map; import java.util.Properties; -import org.jboss.logging.Logger; -import org.keycloak.common.constants.KerberosConstants; -import org.keycloak.models.LDAPConstants; -import org.keycloak.models.UserFederationProvider; - /** * @author Marek Posolda */ diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/base/FederationProvidersIntegrationTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/base/FederationProvidersIntegrationTest.java index c46938770b..2809b97bc5 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/base/FederationProvidersIntegrationTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/base/FederationProvidersIntegrationTest.java @@ -30,7 +30,6 @@ import org.keycloak.credential.CredentialModel; import org.keycloak.federation.ldap.LDAPConfig; import org.keycloak.federation.ldap.LDAPFederationProvider; import org.keycloak.federation.ldap.LDAPFederationProviderFactory; -import org.keycloak.federation.ldap.LDAPUtils; import org.keycloak.federation.ldap.idm.model.LDAPObject; import org.keycloak.federation.ldap.mappers.FullNameLDAPFederationMapper; import org.keycloak.federation.ldap.mappers.FullNameLDAPFederationMapperFactory; @@ -44,7 +43,6 @@ import org.keycloak.models.ModelReadOnlyException; import org.keycloak.models.RealmModel; import org.keycloak.models.RoleModel; import org.keycloak.models.UserCredentialModel; -import org.keycloak.models.UserCredentialValueModel; import org.keycloak.models.UserFederationMapperModel; import org.keycloak.models.UserFederationProvider; import org.keycloak.models.UserFederationProviderModel; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/base/LDAPGroupMapper2WaySyncTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/base/LDAPGroupMapper2WaySyncTest.java index c8885ebb7d..41690d58ff 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/base/LDAPGroupMapper2WaySyncTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/base/LDAPGroupMapper2WaySyncTest.java @@ -17,8 +17,6 @@ package org.keycloak.testsuite.federation.ldap.base; -import java.util.Map; - import org.junit.Assert; import org.junit.ClassRule; import org.junit.FixMethodOrder; @@ -44,6 +42,8 @@ import org.keycloak.testsuite.federation.ldap.FederationTestUtils; import org.keycloak.testsuite.rule.KeycloakRule; import org.keycloak.testsuite.rule.LDAPRule; +import java.util.Map; + /** * @author Marek Posolda */ diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/base/LDAPGroupMapperSyncTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/base/LDAPGroupMapperSyncTest.java index 9308e04e4d..9a6b31baad 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/base/LDAPGroupMapperSyncTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/base/LDAPGroupMapperSyncTest.java @@ -17,10 +17,6 @@ package org.keycloak.testsuite.federation.ldap.base; -import java.util.List; -import java.util.Map; -import java.util.Set; - import org.junit.Assert; import org.junit.Before; import org.junit.ClassRule; @@ -35,9 +31,9 @@ import org.keycloak.federation.ldap.LDAPUtils; import org.keycloak.federation.ldap.idm.model.LDAPObject; import org.keycloak.federation.ldap.mappers.membership.LDAPGroupMapperMode; import org.keycloak.federation.ldap.mappers.membership.MembershipType; -import org.keycloak.federation.ldap.mappers.membership.group.GroupMapperConfig; import org.keycloak.federation.ldap.mappers.membership.group.GroupLDAPFederationMapper; import org.keycloak.federation.ldap.mappers.membership.group.GroupLDAPFederationMapperFactory; +import org.keycloak.federation.ldap.mappers.membership.group.GroupMapperConfig; import org.keycloak.models.GroupModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.LDAPConstants; @@ -54,6 +50,10 @@ import org.keycloak.testsuite.federation.ldap.FederationTestUtils; import org.keycloak.testsuite.rule.KeycloakRule; import org.keycloak.testsuite.rule.LDAPRule; +import java.util.List; +import java.util.Map; +import java.util.Set; + /** * @author Marek Posolda */ diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/base/LDAPGroupMapperTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/base/LDAPGroupMapperTest.java index a9beda5bf2..cdbd6957e3 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/base/LDAPGroupMapperTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/base/LDAPGroupMapperTest.java @@ -17,10 +17,6 @@ package org.keycloak.testsuite.federation.ldap.base; -import java.util.List; -import java.util.Map; -import java.util.Set; - import org.junit.Assert; import org.junit.ClassRule; import org.junit.FixMethodOrder; @@ -54,6 +50,10 @@ import org.keycloak.testsuite.federation.ldap.FederationTestUtils; import org.keycloak.testsuite.rule.KeycloakRule; import org.keycloak.testsuite.rule.LDAPRule; +import java.util.List; +import java.util.Map; +import java.util.Set; + /** * @author Marek Posolda */ diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/base/LDAPMultipleAttributesTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/base/LDAPMultipleAttributesTest.java index ec95eafa28..7db180afc4 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/base/LDAPMultipleAttributesTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/base/LDAPMultipleAttributesTest.java @@ -17,15 +17,6 @@ package org.keycloak.testsuite.federation.ldap.base; -import java.net.URL; -import java.util.Arrays; -import java.util.LinkedHashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -import javax.ws.rs.core.UriBuilder; - import org.junit.Assert; import org.junit.ClassRule; import org.junit.FixMethodOrder; @@ -59,6 +50,14 @@ import org.keycloak.testsuite.rule.WebResource; import org.keycloak.testsuite.rule.WebRule; import org.openqa.selenium.WebDriver; +import javax.ws.rs.core.UriBuilder; +import java.net.URL; +import java.util.Arrays; +import java.util.LinkedHashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + /** * @author Marek Posolda */ diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/base/LDAPRoleMappingsTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/base/LDAPRoleMappingsTest.java index de91e40669..0d35d21998 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/base/LDAPRoleMappingsTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/base/LDAPRoleMappingsTest.java @@ -17,9 +17,6 @@ package org.keycloak.testsuite.federation.ldap.base; -import java.util.Map; -import java.util.Set; - import org.junit.Assert; import org.junit.ClassRule; import org.junit.FixMethodOrder; @@ -56,6 +53,9 @@ import org.keycloak.testsuite.rule.WebResource; import org.keycloak.testsuite.rule.WebRule; import org.openqa.selenium.WebDriver; +import java.util.Map; +import java.util.Set; + /** * @author Marek Posolda */ diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/base/LDAPSyncTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/base/LDAPSyncTest.java index 58902b4356..e300ffd13d 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/base/LDAPSyncTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/ldap/base/LDAPSyncTest.java @@ -24,6 +24,7 @@ import org.junit.Test; import org.junit.rules.RuleChain; import org.junit.rules.TestRule; import org.junit.runners.MethodSorters; +import org.keycloak.common.util.Time; import org.keycloak.federation.ldap.LDAPFederationProvider; import org.keycloak.federation.ldap.LDAPFederationProviderFactory; import org.keycloak.federation.ldap.idm.model.LDAPObject; @@ -43,7 +44,6 @@ import org.keycloak.services.managers.UsersSyncManager; import org.keycloak.testsuite.federation.ldap.FederationTestUtils; import org.keycloak.testsuite.rule.KeycloakRule; import org.keycloak.testsuite.rule.LDAPRule; -import org.keycloak.common.util.Time; import java.util.Map; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/storage/UserMapStorage.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/storage/UserMapStorage.java index a9fe9abdc0..75e12f7eee 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/storage/UserMapStorage.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/storage/UserMapStorage.java @@ -33,8 +33,6 @@ import org.keycloak.storage.adapter.AbstractUserAdapterFederatedStorage; import org.keycloak.storage.user.UserLookupProvider; import org.keycloak.storage.user.UserRegistrationProvider; -import java.util.LinkedList; -import java.util.List; import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/sync/SyncDummyUserFederationProviderFactory.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/sync/SyncDummyUserFederationProviderFactory.java index 3831787aa1..a3e412dfe1 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/sync/SyncDummyUserFederationProviderFactory.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/sync/SyncDummyUserFederationProviderFactory.java @@ -17,12 +17,6 @@ package org.keycloak.testsuite.federation.sync; -import java.util.Date; -import java.util.HashSet; -import java.util.Set; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; - import org.jboss.logging.Logger; import org.keycloak.models.KeycloakSession; import org.keycloak.models.KeycloakSessionFactory; @@ -34,6 +28,11 @@ import org.keycloak.models.UserModel; import org.keycloak.models.utils.KeycloakModelUtils; import org.keycloak.testsuite.federation.DummyUserFederationProviderFactory; +import java.util.Date; +import java.util.Set; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + /** * @author Marek Posolda */ diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/sync/SyncFederationTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/sync/SyncFederationTest.java index efa688c5a2..1efc35423d 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/sync/SyncFederationTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/sync/SyncFederationTest.java @@ -17,10 +17,6 @@ package org.keycloak.testsuite.federation.sync; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.TimeUnit; - import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.ClassRule; @@ -40,6 +36,10 @@ import org.keycloak.testsuite.federation.DummyUserFederationProviderFactory; import org.keycloak.testsuite.rule.KeycloakRule; import org.keycloak.timer.TimerProvider; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.TimeUnit; + /** * Test with Dummy providers (For LDAP see {@link org.keycloak.testsuite.federation.ldap.base.LDAPSyncTest} * diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/jaxrs/JaxrsBasicAuthTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/jaxrs/JaxrsBasicAuthTest.java index 9dd37bbef2..afe72f52c4 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/jaxrs/JaxrsBasicAuthTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/jaxrs/JaxrsBasicAuthTest.java @@ -17,15 +17,6 @@ package org.keycloak.testsuite.jaxrs; -import java.util.Map; -import java.util.TreeMap; -import java.util.UUID; - -import javax.ws.rs.client.Entity; -import javax.ws.rs.core.Form; -import javax.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.Response; - import org.apache.http.impl.client.DefaultHttpClient; import org.jboss.resteasy.client.jaxrs.ResteasyClient; import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder; @@ -47,6 +38,14 @@ import org.keycloak.testsuite.rule.WebResource; import org.keycloak.testsuite.rule.WebRule; import org.openqa.selenium.WebDriver; +import javax.ws.rs.client.Entity; +import javax.ws.rs.core.Form; +import javax.ws.rs.core.HttpHeaders; +import javax.ws.rs.core.Response; +import java.util.Map; +import java.util.TreeMap; +import java.util.UUID; + /** * Test for basic authentication. */ diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/jaxrs/JaxrsFilterTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/jaxrs/JaxrsFilterTest.java index f0e5bbba43..6cd02bf84b 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/jaxrs/JaxrsFilterTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/jaxrs/JaxrsFilterTest.java @@ -17,15 +17,6 @@ package org.keycloak.testsuite.jaxrs; -import java.util.Map; -import java.util.TreeMap; -import java.util.UUID; - -import javax.ws.rs.client.Entity; -import javax.ws.rs.core.Form; -import javax.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.Response; - import org.apache.http.impl.client.DefaultHttpClient; import org.jboss.resteasy.client.jaxrs.ResteasyClient; import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder; @@ -38,8 +29,9 @@ import org.junit.rules.ExternalResource; import org.keycloak.OAuth2Constants; import org.keycloak.TokenIdGenerator; import org.keycloak.adapters.CorsHeaders; -import org.keycloak.constants.AdapterConstants; import org.keycloak.adapters.HttpClientBuilder; +import org.keycloak.common.util.Time; +import org.keycloak.constants.AdapterConstants; import org.keycloak.models.ClientModel; import org.keycloak.models.RealmModel; import org.keycloak.models.RoleModel; @@ -52,9 +44,16 @@ import org.keycloak.testsuite.OAuthClient; import org.keycloak.testsuite.rule.KeycloakRule; import org.keycloak.testsuite.rule.WebResource; import org.keycloak.testsuite.rule.WebRule; -import org.keycloak.common.util.Time; import org.openqa.selenium.WebDriver; +import javax.ws.rs.client.Entity; +import javax.ws.rs.core.Form; +import javax.ws.rs.core.HttpHeaders; +import javax.ws.rs.core.Response; +import java.util.Map; +import java.util.TreeMap; +import java.util.UUID; + /** * @author Marek Posolda */ diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/jaxrs/JaxrsTestApplication.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/jaxrs/JaxrsTestApplication.java index 91005074c5..c577ab219a 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/jaxrs/JaxrsTestApplication.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/jaxrs/JaxrsTestApplication.java @@ -17,14 +17,13 @@ package org.keycloak.testsuite.jaxrs; -import java.util.HashSet; -import java.util.Set; +import org.keycloak.jaxrs.JaxrsBearerTokenFilterImpl; import javax.servlet.ServletContext; import javax.ws.rs.core.Application; import javax.ws.rs.core.Context; - -import org.keycloak.jaxrs.JaxrsBearerTokenFilterImpl; +import java.util.HashSet; +import java.util.Set; /** * @author Marek Posolda diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/jaxrs/JaxrsTestResource.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/jaxrs/JaxrsTestResource.java index e2fb5cf82d..8bf2d7be19 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/jaxrs/JaxrsTestResource.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/jaxrs/JaxrsTestResource.java @@ -20,7 +20,6 @@ package org.keycloak.testsuite.jaxrs; import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.Path; -import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.Context; import javax.ws.rs.core.SecurityContext; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/keycloaksaml/InputServlet.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/keycloaksaml/InputServlet.java index 57c8e48cbf..e47f0f9157 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/keycloaksaml/InputServlet.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/keycloaksaml/InputServlet.java @@ -18,7 +18,6 @@ package org.keycloak.testsuite.keycloaksaml; import org.junit.Assert; -import org.keycloak.KeycloakSecurityContext; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/keycloaksaml/SamlAdapterTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/keycloaksaml/SamlAdapterTest.java index 0f692fe034..c4e2a365bb 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/keycloaksaml/SamlAdapterTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/keycloaksaml/SamlAdapterTest.java @@ -30,8 +30,6 @@ import org.openqa.selenium.WebDriver; import javax.ws.rs.client.Client; import javax.ws.rs.client.ClientBuilder; -import javax.ws.rs.client.Entity; -import javax.ws.rs.core.Form; import static org.junit.Assert.assertEquals; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/model/AdapterTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/model/AdapterTest.java index 2d57d21bcd..95ac032705 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/model/AdapterTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/model/AdapterTest.java @@ -32,7 +32,6 @@ import org.keycloak.models.RealmModel; import org.keycloak.models.RequiredCredentialModel; import org.keycloak.models.RoleModel; import org.keycloak.models.UserCredentialModel; -import org.keycloak.models.UserCredentialValueModel; import org.keycloak.models.UserFederationProviderModel; import org.keycloak.models.UserModel; import org.keycloak.models.UserProvider; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/model/CacheTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/model/CacheTest.java index c478375e21..abbf9122c5 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/model/CacheTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/model/CacheTest.java @@ -17,17 +17,22 @@ package org.keycloak.testsuite.model; -import java.util.List; -import java.util.Set; - import org.junit.Assert; import org.junit.ClassRule; import org.junit.Test; -import org.keycloak.models.*; +import org.keycloak.models.ClientModel; +import org.keycloak.models.KeycloakSession; +import org.keycloak.models.RealmModel; +import org.keycloak.models.RoleModel; +import org.keycloak.models.UserModel; +import org.keycloak.models.UserSessionModel; import org.keycloak.models.cache.infinispan.ClientAdapter; import org.keycloak.models.cache.infinispan.RealmAdapter; import org.keycloak.testsuite.rule.KeycloakRule; +import java.util.List; +import java.util.Set; + import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/model/ClientModelTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/model/ClientModelTest.java index 92c8551aea..90b1280108 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/model/ClientModelTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/model/ClientModelTest.java @@ -29,7 +29,6 @@ import org.keycloak.models.utils.ModelToRepresentation; import org.keycloak.models.utils.RepresentationToModel; import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.representations.idm.ProtocolMapperRepresentation; -import org.keycloak.services.managers.ClientManager; import java.util.Iterator; import java.util.List; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/model/ConcurrentTransactionsTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/model/ConcurrentTransactionsTest.java index 2fb2aaf7eb..e1504209a6 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/model/ConcurrentTransactionsTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/model/ConcurrentTransactionsTest.java @@ -17,13 +17,8 @@ package org.keycloak.testsuite.model; -import java.util.Arrays; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.atomic.AtomicReference; - import org.jboss.logging.Logger; import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; import org.keycloak.models.ClientModel; import org.keycloak.models.KeycloakSession; @@ -34,6 +29,10 @@ import org.keycloak.models.RealmProvider; import org.keycloak.models.UserModel; import org.keycloak.models.utils.KeycloakModelUtils; +import java.util.Arrays; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.atomic.AtomicReference; + /** * @author Marek Posolda */ diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/model/DBLockTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/model/DBLockTest.java index 2537332081..5e8440d492 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/model/DBLockTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/model/DBLockTest.java @@ -17,10 +17,6 @@ package org.keycloak.testsuite.model; -import java.util.LinkedList; -import java.util.List; -import java.util.concurrent.atomic.AtomicInteger; - import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.Before; @@ -33,6 +29,10 @@ import org.keycloak.models.dblock.DBLockProvider; import org.keycloak.models.dblock.DBLockProviderFactory; import org.keycloak.models.utils.KeycloakModelUtils; +import java.util.LinkedList; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; + /** * @author Marek Posolda */ diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/model/UserConsentModelTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/model/UserConsentModelTest.java index 2f71b2329e..4335c52fc7 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/model/UserConsentModelTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/model/UserConsentModelTest.java @@ -17,22 +17,22 @@ package org.keycloak.testsuite.model; -import java.util.List; - import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.keycloak.models.ClientModel; -import org.keycloak.models.UserConsentModel; import org.keycloak.models.ModelException; import org.keycloak.models.ProtocolMapperModel; import org.keycloak.models.RealmModel; import org.keycloak.models.RoleContainerModel; import org.keycloak.models.RoleModel; +import org.keycloak.models.UserConsentModel; import org.keycloak.models.UserModel; import org.keycloak.protocol.oidc.OIDCLoginProtocol; import org.keycloak.protocol.oidc.mappers.UserPropertyMapper; +import java.util.List; + /** * @author Marek Posolda */ diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/model/UserFederationModelTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/model/UserFederationModelTest.java index 7362e37591..1d78ff7c8b 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/model/UserFederationModelTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/model/UserFederationModelTest.java @@ -17,13 +17,6 @@ package org.keycloak.testsuite.model; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.TreeMap; - import org.junit.Assert; import org.junit.Test; import org.keycloak.models.ModelDuplicateException; @@ -31,6 +24,13 @@ import org.keycloak.models.RealmModel; import org.keycloak.models.UserFederationMapperModel; import org.keycloak.models.UserFederationProviderModel; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeMap; + /** * @author Marek Posolda */ diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/model/UserModelTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/model/UserModelTest.java index e2af2416d3..d2e608ddd1 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/model/UserModelTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/model/UserModelTest.java @@ -27,14 +27,14 @@ import org.keycloak.models.UserModel; import org.keycloak.models.UserModel.RequiredAction; import org.keycloak.services.managers.ClientManager; -import static org.junit.Assert.assertNotNull; - import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; +import static org.junit.Assert.assertNotNull; + /** * @author Stian Thorgersen */ diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/model/UserSessionInitializerTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/model/UserSessionInitializerTest.java index 15dd9dc132..431bff6ff4 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/model/UserSessionInitializerTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/model/UserSessionInitializerTest.java @@ -17,16 +17,13 @@ package org.keycloak.testsuite.model; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.ClassRule; import org.junit.Test; import org.keycloak.cluster.ClusterProvider; +import org.keycloak.common.util.Time; import org.keycloak.connections.infinispan.InfinispanConnectionProvider; import org.keycloak.models.ClientModel; import org.keycloak.models.ClientSessionModel; @@ -40,7 +37,10 @@ import org.keycloak.protocol.oidc.OIDCLoginProtocol; import org.keycloak.services.managers.UserManager; import org.keycloak.services.managers.UserSessionManager; import org.keycloak.testsuite.rule.KeycloakRule; -import org.keycloak.common.util.Time; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; /** * @author Marek Posolda diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/model/UserSessionPersisterProviderTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/model/UserSessionPersisterProviderTest.java index 577d41e5e7..074438f2bf 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/model/UserSessionPersisterProviderTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/model/UserSessionPersisterProviderTest.java @@ -17,16 +17,12 @@ package org.keycloak.testsuite.model; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.ClassRule; import org.junit.Test; +import org.keycloak.common.util.Time; import org.keycloak.models.ClientModel; import org.keycloak.models.ClientSessionModel; import org.keycloak.models.KeycloakSession; @@ -39,7 +35,11 @@ import org.keycloak.services.managers.ClientManager; import org.keycloak.services.managers.RealmManager; import org.keycloak.services.managers.UserManager; import org.keycloak.testsuite.rule.KeycloakRule; -import org.keycloak.common.util.Time; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; /** * @author Marek Posolda diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/model/UserSessionProviderOfflineTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/model/UserSessionProviderOfflineTest.java index 6f81d43619..013f16c57f 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/model/UserSessionProviderOfflineTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/model/UserSessionProviderOfflineTest.java @@ -17,19 +17,13 @@ package org.keycloak.testsuite.model; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Set; - import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; +import org.keycloak.common.util.Time; import org.keycloak.models.ClientModel; import org.keycloak.models.ClientSessionModel; import org.keycloak.models.KeycloakSession; @@ -43,9 +37,15 @@ import org.keycloak.services.managers.RealmManager; import org.keycloak.services.managers.UserManager; import org.keycloak.services.managers.UserSessionManager; import org.keycloak.testsuite.rule.KeycloakRule; -import org.keycloak.common.util.Time; import org.keycloak.testsuite.rule.LoggingRule; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; + /** * @author Marek Posolda */ diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/model/UserSessionProviderTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/model/UserSessionProviderTest.java index 0a5842ce12..d75e467c0f 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/model/UserSessionProviderTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/model/UserSessionProviderTest.java @@ -22,21 +22,30 @@ import org.junit.Assert; import org.junit.Before; import org.junit.ClassRule; import org.junit.Test; +import org.keycloak.common.util.Time; import org.keycloak.models.ClientModel; import org.keycloak.models.ClientSessionModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; +import org.keycloak.models.UserLoginFailureModel; import org.keycloak.models.UserModel; import org.keycloak.models.UserSessionModel; -import org.keycloak.models.UserLoginFailureModel; import org.keycloak.protocol.oidc.OIDCLoginProtocol; import org.keycloak.services.managers.UserManager; import org.keycloak.testsuite.rule.KeycloakRule; -import org.keycloak.common.util.Time; -import java.util.*; +import java.util.Arrays; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; -import static org.junit.Assert.*; +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; /** * @author Stian Thorgersen diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/AccountApplicationsPage.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/AccountApplicationsPage.java index 08a46aa332..fcf0ed808b 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/AccountApplicationsPage.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/AccountApplicationsPage.java @@ -17,18 +17,17 @@ package org.keycloak.testsuite.pages; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.ws.rs.core.UriBuilder; - import org.keycloak.services.Urls; import org.keycloak.testsuite.Constants; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; +import javax.ws.rs.core.UriBuilder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + /** * @author Marek Posolda */ diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/AccountFederatedIdentityPage.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/AccountFederatedIdentityPage.java index ff7d77c62d..ac897a8e53 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/AccountFederatedIdentityPage.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/AccountFederatedIdentityPage.java @@ -17,14 +17,14 @@ package org.keycloak.testsuite.pages; -import javax.ws.rs.core.UriBuilder; - import org.keycloak.services.Urls; import org.keycloak.testsuite.Constants; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; +import javax.ws.rs.core.UriBuilder; + /** * @author Marek Posolda */ diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/AppPage.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/AppPage.java index ad24d9a1ec..97ca54bc5c 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/AppPage.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/AppPage.java @@ -19,7 +19,6 @@ package org.keycloak.testsuite.pages; import org.keycloak.OAuth2Constants; import org.keycloak.protocol.oidc.OIDCLoginProtocolService; -import org.keycloak.testsuite.OAuthClient; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/BypassKerberosPage.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/BypassKerberosPage.java index 8568d4a81f..2c7f697e51 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/BypassKerberosPage.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/BypassKerberosPage.java @@ -16,9 +16,6 @@ */ package org.keycloak.testsuite.pages; -import org.keycloak.testsuite.OAuthClient; -import org.keycloak.testsuite.rule.WebResource; -import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/ErrorPage.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/ErrorPage.java index 3077db4c89..b3a9298791 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/ErrorPage.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/ErrorPage.java @@ -16,10 +16,8 @@ */ package org.keycloak.testsuite.pages; -import org.junit.Assert; import org.keycloak.testsuite.OAuthClient; import org.keycloak.testsuite.rule.WebResource; -import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/LoginUpdateProfilePage.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/LoginUpdateProfilePage.java index 3df93b775d..17a2ed773b 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/LoginUpdateProfilePage.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/LoginUpdateProfilePage.java @@ -16,8 +16,6 @@ */ package org.keycloak.testsuite.pages; -import org.junit.Assert; -import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/RegisterPage.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/RegisterPage.java index 737d811c9a..506889e921 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/RegisterPage.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/RegisterPage.java @@ -17,8 +17,6 @@ package org.keycloak.testsuite.pages; import org.junit.Assert; - -import org.openqa.selenium.By; import org.openqa.selenium.NoSuchElementException; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/rule/AbstractKeycloakRule.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/rule/AbstractKeycloakRule.java index 7462a28b33..c9dae67d72 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/rule/AbstractKeycloakRule.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/rule/AbstractKeycloakRule.java @@ -31,6 +31,7 @@ import org.junit.rules.TemporaryFolder; import org.keycloak.Config; import org.keycloak.adapters.KeycloakConfigResolver; import org.keycloak.adapters.servlet.KeycloakOIDCFilter; +import org.keycloak.common.util.Time; import org.keycloak.models.KeycloakSession; import org.keycloak.models.KeycloakTransaction; import org.keycloak.models.RealmModel; @@ -39,10 +40,9 @@ import org.keycloak.models.utils.ModelToRepresentation; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.representations.idm.UserRepresentation; import org.keycloak.services.managers.RealmManager; -import org.keycloak.testsuite.Retry; import org.keycloak.testsuite.KeycloakServer; +import org.keycloak.testsuite.Retry; import org.keycloak.util.JsonSerialization; -import org.keycloak.common.util.Time; import javax.servlet.DispatcherType; import javax.servlet.Servlet; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/rule/KerberosRule.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/rule/KerberosRule.java index c39870a38a..8d46513ac5 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/rule/KerberosRule.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/rule/KerberosRule.java @@ -17,15 +17,15 @@ package org.keycloak.testsuite.rule; -import java.io.File; -import java.net.URL; -import java.util.Properties; - import org.jboss.logging.Logger; import org.keycloak.testsuite.federation.ldap.LDAPTestConfiguration; import org.keycloak.util.ldap.KerberosEmbeddedServer; import org.keycloak.util.ldap.LDAPEmbeddedServer; +import java.io.File; +import java.net.URL; +import java.util.Properties; + /** * @author Marek Posolda */ diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/rule/LDAPRule.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/rule/LDAPRule.java index 715f6a37d6..4bf0e4c449 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/rule/LDAPRule.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/rule/LDAPRule.java @@ -17,13 +17,13 @@ package org.keycloak.testsuite.rule; -import java.util.Map; -import java.util.Properties; - import org.junit.rules.ExternalResource; import org.keycloak.testsuite.federation.ldap.LDAPTestConfiguration; import org.keycloak.util.ldap.LDAPEmbeddedServer; +import java.util.Map; +import java.util.Properties; + /** * @author Marek Posolda */ diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/saml/SamlEcpProfileTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/saml/SamlEcpProfileTest.java index 4539010596..778085ca5e 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/saml/SamlEcpProfileTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/saml/SamlEcpProfileTest.java @@ -59,7 +59,10 @@ import java.util.Iterator; import java.util.Map; import static javax.ws.rs.core.Response.Status.OK; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; /** * @author Bill Burke diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/saml/SamlPicketlinkSPTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/saml/SamlPicketlinkSPTest.java index 6ce33ec491..e62b6db913 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/saml/SamlPicketlinkSPTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/saml/SamlPicketlinkSPTest.java @@ -29,6 +29,10 @@ import org.junit.runners.model.Statement; import org.keycloak.admin.client.Keycloak; import org.keycloak.admin.client.resource.RealmResource; import org.keycloak.common.util.Environment; +import org.keycloak.dom.saml.v2.assertion.AssertionType; +import org.keycloak.dom.saml.v2.assertion.AttributeStatementType; +import org.keycloak.dom.saml.v2.assertion.AttributeType; +import org.keycloak.dom.saml.v2.protocol.ResponseType; import org.keycloak.models.ClientModel; import org.keycloak.models.Constants; import org.keycloak.models.ProtocolMapperModel; @@ -39,20 +43,16 @@ import org.keycloak.protocol.saml.mappers.HardcodedRole; import org.keycloak.protocol.saml.mappers.RoleListMapper; import org.keycloak.protocol.saml.mappers.RoleNameMapper; import org.keycloak.representations.idm.ClientRepresentation; +import org.keycloak.saml.common.constants.JBossSAMLURIConstants; +import org.keycloak.saml.processing.api.saml.v2.response.SAML2Response; +import org.keycloak.saml.processing.core.saml.v2.constants.X500SAMLProfileConstants; +import org.keycloak.saml.processing.web.util.PostBindingUtil; import org.keycloak.services.managers.RealmManager; import org.keycloak.testsuite.pages.LoginPage; import org.keycloak.testsuite.rule.KeycloakRule; import org.keycloak.testsuite.rule.WebResource; import org.keycloak.testsuite.rule.WebRule; import org.openqa.selenium.WebDriver; -import org.keycloak.saml.common.constants.JBossSAMLURIConstants; -import org.keycloak.saml.processing.api.saml.v2.response.SAML2Response; -import org.keycloak.saml.processing.core.saml.v2.constants.X500SAMLProfileConstants; -import org.keycloak.dom.saml.v2.assertion.AssertionType; -import org.keycloak.dom.saml.v2.assertion.AttributeStatementType; -import org.keycloak.dom.saml.v2.assertion.AttributeType; -import org.keycloak.dom.saml.v2.protocol.ResponseType; -import org.keycloak.saml.processing.web.util.PostBindingUtil; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/saml/ValidationTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/saml/ValidationTest.java index 43638e0d61..aa4ca666cc 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/saml/ValidationTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/saml/ValidationTest.java @@ -19,17 +19,13 @@ package org.keycloak.testsuite.saml; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; -import org.keycloak.common.util.PemUtils; import org.keycloak.common.util.StreamUtil; -import org.keycloak.models.RealmModel; import org.keycloak.models.utils.KeycloakModelUtils; import org.keycloak.protocol.saml.SamlProtocol; import org.keycloak.protocol.saml.SamlService; import org.keycloak.saml.SPMetadataDescriptor; -import org.keycloak.services.resources.RealmsResource; import org.xml.sax.SAXException; -import javax.ws.rs.core.UriInfo; import javax.xml.XMLConstants; import javax.xml.transform.Source; import javax.xml.transform.stream.StreamSource; @@ -37,7 +33,6 @@ import javax.xml.validation.Schema; import javax.xml.validation.SchemaFactory; import javax.xml.validation.Validator; import java.io.ByteArrayInputStream; -import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URL; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/samlfilter/SamlKeycloakRule.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/samlfilter/SamlKeycloakRule.java index 55e8f018ed..93ed4bdfd2 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/samlfilter/SamlKeycloakRule.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/samlfilter/SamlKeycloakRule.java @@ -26,10 +26,7 @@ import io.undertow.server.handlers.resource.ResourceManager; import io.undertow.server.handlers.resource.URLResource; import io.undertow.servlet.api.DeploymentInfo; import io.undertow.servlet.api.FilterInfo; -import io.undertow.servlet.api.LoginConfig; -import io.undertow.servlet.api.SecurityConstraint; import io.undertow.servlet.api.ServletInfo; -import io.undertow.servlet.api.WebResourceCollection; import org.keycloak.adapters.saml.servlet.SamlFilter; import org.keycloak.adapters.saml.undertow.SamlServletExtension; import org.keycloak.testsuite.keycloaksaml.SendUsernameServlet; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/util/cli/AbstractCommand.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/util/cli/AbstractCommand.java index 0b6d2280ec..e3b0158aed 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/util/cli/AbstractCommand.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/util/cli/AbstractCommand.java @@ -17,14 +17,14 @@ package org.keycloak.testsuite.util.cli; -import java.util.List; - import org.jboss.logging.Logger; import org.keycloak.models.KeycloakSession; import org.keycloak.models.KeycloakSessionFactory; import org.keycloak.models.KeycloakSessionTask; import org.keycloak.models.utils.KeycloakModelUtils; +import java.util.List; + /** * @author Marek Posolda */ diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/util/cli/PersistSessionsCommand.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/util/cli/PersistSessionsCommand.java index bec048702e..b2ede3ecae 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/util/cli/PersistSessionsCommand.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/util/cli/PersistSessionsCommand.java @@ -17,9 +17,6 @@ package org.keycloak.testsuite.util.cli; -import java.util.LinkedList; -import java.util.List; - import org.keycloak.models.ClientModel; import org.keycloak.models.ClientSessionModel; import org.keycloak.models.KeycloakSession; @@ -30,6 +27,9 @@ import org.keycloak.models.UserSessionModel; import org.keycloak.models.session.UserSessionPersisterProvider; import org.keycloak.models.utils.KeycloakModelUtils; +import java.util.LinkedList; +import java.util.List; + /** * @author Marek Posolda */ diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/util/cli/SyncDummyFederationProviderCommand.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/util/cli/SyncDummyFederationProviderCommand.java index 452fd59e87..af023124d6 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/util/cli/SyncDummyFederationProviderCommand.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/util/cli/SyncDummyFederationProviderCommand.java @@ -17,16 +17,15 @@ package org.keycloak.testsuite.util.cli; -import java.util.HashMap; -import java.util.Map; - import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; import org.keycloak.models.UserFederationProviderModel; import org.keycloak.models.utils.KeycloakModelUtils; import org.keycloak.services.managers.UsersSyncManager; import org.keycloak.testsuite.federation.sync.SyncDummyUserFederationProviderFactory; -import org.keycloak.timer.TimerProvider; + +import java.util.HashMap; +import java.util.Map; /** * @author Marek Posolda diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/util/cli/TestsuiteCLI.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/util/cli/TestsuiteCLI.java index 59f34900b5..8e9582bfd0 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/util/cli/TestsuiteCLI.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/util/cli/TestsuiteCLI.java @@ -17,6 +17,11 @@ package org.keycloak.testsuite.util.cli; +import org.jboss.logging.Logger; +import org.keycloak.models.KeycloakSession; +import org.keycloak.models.KeycloakSessionFactory; +import org.keycloak.testsuite.KeycloakServer; + import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; @@ -26,11 +31,6 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import org.jboss.logging.Logger; -import org.keycloak.models.KeycloakSession; -import org.keycloak.models.KeycloakSessionFactory; -import org.keycloak.testsuite.KeycloakServer; - /** * See Testsuite.md (section how to create many users and offline sessions) * diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/util/cli/UserCommands.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/util/cli/UserCommands.java index fe556024dc..5fc0e86f6a 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/util/cli/UserCommands.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/util/cli/UserCommands.java @@ -17,14 +17,8 @@ package org.keycloak.testsuite.util.cli; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Set; - import org.keycloak.models.ClientModel; import org.keycloak.models.KeycloakSession; -import org.keycloak.models.KeycloakSessionFactory; import org.keycloak.models.KeycloakSessionTask; import org.keycloak.models.RealmModel; import org.keycloak.models.RoleModel; @@ -32,6 +26,11 @@ import org.keycloak.models.UserCredentialModel; import org.keycloak.models.UserModel; import org.keycloak.models.utils.KeycloakModelUtils; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; + /** * @author Marek Posolda */ diff --git a/themes/src/main/resources/theme/keycloak/admin/resources/img/keyclok-logo.svg b/themes/src/main/resources/theme/keycloak/admin/resources/img/keyclok-logo.svg index 80bb95ad20..05fa87b8a0 100644 --- a/themes/src/main/resources/theme/keycloak/admin/resources/img/keyclok-logo.svg +++ b/themes/src/main/resources/theme/keycloak/admin/resources/img/keyclok-logo.svg @@ -1,6 +1,6 @@ - diff --git a/themes/src/main/resources/theme/keycloak/common/resources/lib/components/font-awesome/fonts/fontawesome-webfont.svg b/themes/src/main/resources/theme/keycloak/common/resources/lib/components/font-awesome/fonts/fontawesome-webfont.svg index 1ee89d4368..51dc16e993 100644 --- a/themes/src/main/resources/theme/keycloak/common/resources/lib/components/font-awesome/fonts/fontawesome-webfont.svg +++ b/themes/src/main/resources/theme/keycloak/common/resources/lib/components/font-awesome/fonts/fontawesome-webfont.svg @@ -1,6 +1,6 @@ - + diff --git a/themes/src/main/resources/theme/keycloak/common/resources/lib/patternfly/img/brand.svg b/themes/src/main/resources/theme/keycloak/common/resources/lib/patternfly/img/brand.svg index 81cfe508d2..1861f93583 100644 --- a/themes/src/main/resources/theme/keycloak/common/resources/lib/patternfly/img/brand.svg +++ b/themes/src/main/resources/theme/keycloak/common/resources/lib/patternfly/img/brand.svg @@ -1,7 +1,7 @@ - diff --git a/themes/src/main/resources/theme/keycloak/common/resources/lib/patternfly/img/logo.svg b/themes/src/main/resources/theme/keycloak/common/resources/lib/patternfly/img/logo.svg index b9ce0ac162..6d5a3086cc 100755 --- a/themes/src/main/resources/theme/keycloak/common/resources/lib/patternfly/img/logo.svg +++ b/themes/src/main/resources/theme/keycloak/common/resources/lib/patternfly/img/logo.svg @@ -1,7 +1,7 @@ - diff --git a/themes/src/main/resources/theme/keycloak/common/resources/lib/zocial/zocial-regular-webfont.svg b/themes/src/main/resources/theme/keycloak/common/resources/lib/zocial/zocial-regular-webfont.svg index a789a2a005..33cd59a881 100644 --- a/themes/src/main/resources/theme/keycloak/common/resources/lib/zocial/zocial-regular-webfont.svg +++ b/themes/src/main/resources/theme/keycloak/common/resources/lib/zocial/zocial-regular-webfont.svg @@ -3,7 +3,7 @@ - + Created by FontForge 20150401 at Sat Apr 11 22:32:17 2015 By zimbatm diff --git a/util/embedded-ldap/src/main/java/org/keycloak/util/ldap/FileDirectoryServiceFactory.java b/util/embedded-ldap/src/main/java/org/keycloak/util/ldap/FileDirectoryServiceFactory.java index e6f4373987..966ac44d39 100644 --- a/util/embedded-ldap/src/main/java/org/keycloak/util/ldap/FileDirectoryServiceFactory.java +++ b/util/embedded-ldap/src/main/java/org/keycloak/util/ldap/FileDirectoryServiceFactory.java @@ -20,8 +20,7 @@ package org.keycloak.util.ldap; import org.apache.directory.api.ldap.model.constants.SchemaConstants; import org.apache.directory.api.ldap.model.schema.LdapComparator; import org.apache.directory.api.ldap.model.schema.SchemaManager; -import org. - apache.directory.api.ldap.model.schema.comparators.NormalizingComparator; +import org.apache.directory.api.ldap.model.schema.comparators.NormalizingComparator; import org.apache.directory.api.ldap.model.schema.registries.ComparatorRegistry; import org.apache.directory.api.ldap.model.schema.registries.SchemaLoader; import org.apache.directory.api.ldap.schemaextractor.SchemaLdifExtractor; diff --git a/util/embedded-ldap/src/main/java/org/keycloak/util/ldap/InMemoryDirectoryServiceFactory.java b/util/embedded-ldap/src/main/java/org/keycloak/util/ldap/InMemoryDirectoryServiceFactory.java index 3a4714a87e..bc296cdff8 100644 --- a/util/embedded-ldap/src/main/java/org/keycloak/util/ldap/InMemoryDirectoryServiceFactory.java +++ b/util/embedded-ldap/src/main/java/org/keycloak/util/ldap/InMemoryDirectoryServiceFactory.java @@ -17,9 +17,6 @@ package org.keycloak.util.ldap; -import java.io.File; -import java.io.IOException; -import java.util.List; import net.sf.ehcache.CacheManager; import net.sf.ehcache.config.CacheConfiguration; import net.sf.ehcache.config.Configuration; @@ -46,6 +43,10 @@ import org.apache.directory.server.core.factory.PartitionFactory; import org.apache.directory.server.i18n.I18n; import org.jboss.logging.Logger; +import java.io.File; +import java.io.IOException; +import java.util.List; + /** * Factory for a fast (mostly in-memory-only) ApacheDS DirectoryService. Use only for tests!! * diff --git a/util/embedded-ldap/src/main/java/org/keycloak/util/ldap/InMemorySchemaPartition.java b/util/embedded-ldap/src/main/java/org/keycloak/util/ldap/InMemorySchemaPartition.java index 8d207910da..f111d7013e 100644 --- a/util/embedded-ldap/src/main/java/org/keycloak/util/ldap/InMemorySchemaPartition.java +++ b/util/embedded-ldap/src/main/java/org/keycloak/util/ldap/InMemorySchemaPartition.java @@ -17,12 +17,6 @@ package org.keycloak.util.ldap; -import java.net.URL; -import java.util.Map; -import java.util.TreeSet; -import java.util.UUID; -import java.util.regex.Pattern; -import javax.naming.InvalidNameException; import org.apache.directory.api.ldap.model.constants.SchemaConstants; import org.apache.directory.api.ldap.model.entry.DefaultEntry; import org.apache.directory.api.ldap.model.entry.Entry; @@ -35,6 +29,13 @@ import org.apache.directory.server.core.api.interceptor.context.AddOperationCont import org.apache.directory.server.core.partition.ldif.AbstractLdifPartition; import org.jboss.logging.Logger; +import javax.naming.InvalidNameException; +import java.net.URL; +import java.util.Map; +import java.util.TreeSet; +import java.util.UUID; +import java.util.regex.Pattern; + /** * In-memory schema-only partition which loads the data in the similar way as the * {@link org.apache.directory.api.ldap.schemaloader.JarLdifSchemaLoader}. diff --git a/util/embedded-ldap/src/main/java/org/keycloak/util/ldap/KerberosEmbeddedServer.java b/util/embedded-ldap/src/main/java/org/keycloak/util/ldap/KerberosEmbeddedServer.java index d7f868f032..6845bc4e7e 100644 --- a/util/embedded-ldap/src/main/java/org/keycloak/util/ldap/KerberosEmbeddedServer.java +++ b/util/embedded-ldap/src/main/java/org/keycloak/util/ldap/KerberosEmbeddedServer.java @@ -17,18 +17,6 @@ package org.keycloak.util.ldap; -import java.io.IOException; -import java.lang.reflect.Field; -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Locale; -import java.util.Properties; -import java.util.Set; - -import javax.security.auth.kerberos.KerberosPrincipal; - import org.apache.directory.api.ldap.model.constants.SupportedSaslMechanisms; import org.apache.directory.api.ldap.model.exception.LdapInvalidDnException; import org.apache.directory.server.core.api.DirectoryService; @@ -48,6 +36,17 @@ import org.apache.directory.shared.kerberos.KerberosUtils; import org.apache.directory.shared.kerberos.codec.types.EncryptionType; import org.jboss.logging.Logger; +import javax.security.auth.kerberos.KerberosPrincipal; +import java.io.IOException; +import java.lang.reflect.Field; +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Locale; +import java.util.Properties; +import java.util.Set; + /** * @author Marek Posolda */ diff --git a/util/embedded-ldap/src/main/java/org/keycloak/util/ldap/KerberosKeytabCreator.java b/util/embedded-ldap/src/main/java/org/keycloak/util/ldap/KerberosKeytabCreator.java index 01fee2c813..8dce8bb315 100644 --- a/util/embedded-ldap/src/main/java/org/keycloak/util/ldap/KerberosKeytabCreator.java +++ b/util/embedded-ldap/src/main/java/org/keycloak/util/ldap/KerberosKeytabCreator.java @@ -17,13 +17,6 @@ package org.keycloak.util.ldap; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Properties; - import org.apache.directory.server.kerberos.shared.crypto.encryption.KerberosKeyFactory; import org.apache.directory.server.kerberos.shared.keytab.Keytab; import org.apache.directory.server.kerberos.shared.keytab.KeytabEntry; @@ -31,6 +24,13 @@ import org.apache.directory.shared.kerberos.KerberosTime; import org.apache.directory.shared.kerberos.codec.types.EncryptionType; import org.apache.directory.shared.kerberos.components.EncryptionKey; +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Properties; + /** * Helper utility for creating Keytab files. * diff --git a/util/embedded-ldap/src/main/java/org/keycloak/util/ldap/LDAPEmbeddedServer.java b/util/embedded-ldap/src/main/java/org/keycloak/util/ldap/LDAPEmbeddedServer.java index 1754b4c655..682fa9ab38 100644 --- a/util/embedded-ldap/src/main/java/org/keycloak/util/ldap/LDAPEmbeddedServer.java +++ b/util/embedded-ldap/src/main/java/org/keycloak/util/ldap/LDAPEmbeddedServer.java @@ -17,12 +17,6 @@ package org.keycloak.util.ldap; -import java.io.File; -import java.io.InputStream; -import java.util.HashMap; -import java.util.Map; -import java.util.Properties; - import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import org.apache.commons.lang.text.StrSubstitutor; @@ -42,6 +36,12 @@ import org.jboss.logging.Logger; import org.keycloak.common.util.FindFile; import org.keycloak.common.util.StreamUtil; +import java.io.File; +import java.io.InputStream; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; + /** * @author Marek Posolda */ diff --git a/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/JsonConfigConverter.java b/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/JsonConfigConverter.java index aa4d3f578d..1869ab9c90 100644 --- a/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/JsonConfigConverter.java +++ b/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/JsonConfigConverter.java @@ -18,19 +18,19 @@ package org.keycloak.subsystem.server.extension; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; +import org.jboss.as.controller.PathAddress; +import org.jboss.as.controller.operations.common.Util; +import org.jboss.dmr.ModelNode; + import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.List; -import org.jboss.as.controller.PathAddress; -import org.jboss.as.controller.operations.common.Util; -import org.jboss.dmr.ModelNode; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.WRITE_ATTRIBUTE_OPERATION; - -import static org.keycloak.subsystem.server.extension.KeycloakSubsystemDefinition.PROVIDERS; import static org.keycloak.subsystem.server.extension.KeycloakSubsystemDefinition.MASTER_REALM_NAME; +import static org.keycloak.subsystem.server.extension.KeycloakSubsystemDefinition.PROVIDERS; import static org.keycloak.subsystem.server.extension.KeycloakSubsystemDefinition.SCHEDULED_TASK_INTERVAL; import static org.keycloak.subsystem.server.extension.ThemeResourceDefinition.CACHE_TEMPLATES; import static org.keycloak.subsystem.server.extension.ThemeResourceDefinition.CACHE_THEMES; diff --git a/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/KeycloakAdapterConfigService.java b/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/KeycloakAdapterConfigService.java index 0eec2eed0a..32406257b6 100755 --- a/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/KeycloakAdapterConfigService.java +++ b/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/KeycloakAdapterConfigService.java @@ -19,9 +19,10 @@ package org.keycloak.subsystem.server.extension; import org.jboss.as.controller.PathAddress; import org.jboss.as.controller.PathElement; import org.jboss.dmr.ModelNode; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADDRESS; import org.jboss.dmr.Property; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADDRESS; + /** * This service keeps track of the entire Keycloak management model so as to provide * configuration to the Keycloak Server. diff --git a/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/KeycloakExtension.java b/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/KeycloakExtension.java index bdfe47c8e7..03911268d7 100755 --- a/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/KeycloakExtension.java +++ b/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/KeycloakExtension.java @@ -24,9 +24,9 @@ import org.jboss.as.controller.ResourceDefinition; import org.jboss.as.controller.SubsystemRegistration; import org.jboss.as.controller.descriptions.StandardResourceDescriptionResolver; import org.jboss.as.controller.parsing.ExtensionParsingContext; +import org.jboss.as.controller.registry.ManagementResourceRegistration; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SUBSYSTEM; -import org.jboss.as.controller.registry.ManagementResourceRegistration; import static org.keycloak.subsystem.server.logging.KeycloakLogger.ROOT_LOGGER; diff --git a/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/KeycloakProviderDeploymentProcessor.java b/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/KeycloakProviderDeploymentProcessor.java index c573754ec6..97dd52a583 100644 --- a/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/KeycloakProviderDeploymentProcessor.java +++ b/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/KeycloakProviderDeploymentProcessor.java @@ -22,21 +22,11 @@ import org.jboss.as.server.deployment.DeploymentPhaseContext; import org.jboss.as.server.deployment.DeploymentUnit; import org.jboss.as.server.deployment.DeploymentUnitProcessingException; import org.jboss.as.server.deployment.DeploymentUnitProcessor; -import org.jboss.as.server.deployment.module.ModuleDependency; -import org.jboss.as.server.deployment.module.ModuleSpecification; -import org.jboss.as.server.deployment.module.ResourceRoot; import org.jboss.logging.Logger; import org.jboss.modules.Module; -import org.jboss.modules.ModuleIdentifier; -import org.jboss.modules.ModuleLoader; -import org.jboss.vfs.VirtualFile; -import org.jboss.vfs.util.AbstractVirtualFileFilterWithAttributes; import org.keycloak.provider.ProviderManager; import org.keycloak.provider.ProviderManagerRegistry; -import java.io.IOException; -import java.util.List; - /** * @author Bill Burke * @version $Revision: 1 $ diff --git a/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/KeycloakServerDeploymentProcessor.java b/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/KeycloakServerDeploymentProcessor.java index 1bc2211e24..598a7d587a 100755 --- a/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/KeycloakServerDeploymentProcessor.java +++ b/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/KeycloakServerDeploymentProcessor.java @@ -16,8 +16,6 @@ */ package org.keycloak.subsystem.server.extension; -import java.util.ArrayList; -import java.util.List; import org.jboss.as.ee.component.EEModuleDescription; import org.jboss.as.server.deployment.DeploymentPhaseContext; import org.jboss.as.server.deployment.DeploymentUnit; @@ -29,6 +27,9 @@ import org.jboss.metadata.web.jboss.JBossWebMetaData; import org.jboss.msc.service.ServiceName; import org.jboss.msc.service.ServiceTarget; +import java.util.ArrayList; +import java.util.List; + /** * DUP responsible for setting the web context of a Keycloak auth server and * passing the Keycloak configuration to the Keycloak server. diff --git a/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/KeycloakSubsystemDefinition.java b/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/KeycloakSubsystemDefinition.java index 3dc4917324..ed5a4ee8e8 100644 --- a/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/KeycloakSubsystemDefinition.java +++ b/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/KeycloakSubsystemDefinition.java @@ -20,17 +20,17 @@ import org.jboss.as.controller.AttributeDefinition; import org.jboss.as.controller.SimpleAttributeDefinition; import org.jboss.as.controller.SimpleAttributeDefinitionBuilder; import org.jboss.as.controller.SimpleResourceDefinition; +import org.jboss.as.controller.StringListAttributeDefinition; import org.jboss.as.controller.operations.common.GenericSubsystemDescribeHandler; import org.jboss.as.controller.registry.ManagementResourceRegistration; import org.jboss.dmr.ModelNode; import org.jboss.dmr.ModelType; +import org.keycloak.subsystem.server.attributes.ProvidersListAttributeBuilder; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.jboss.as.controller.StringListAttributeDefinition; -import org.keycloak.subsystem.server.attributes.ProvidersListAttributeBuilder; /** * Definition of subsystem=keycloak-server. diff --git a/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/KeycloakSubsystemParser.java b/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/KeycloakSubsystemParser.java index 0f4ea8c0aa..551a6dc960 100755 --- a/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/KeycloakSubsystemParser.java +++ b/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/KeycloakSubsystemParser.java @@ -16,11 +16,17 @@ */ package org.keycloak.subsystem.server.extension; +import org.jboss.as.controller.AttributeDefinition; import org.jboss.as.controller.PathAddress; +import org.jboss.as.controller.PathElement; +import org.jboss.as.controller.PropertiesAttributeDefinition; +import org.jboss.as.controller.SimpleAttributeDefinition; +import org.jboss.as.controller.descriptions.ModelDescriptionConstants; import org.jboss.as.controller.operations.common.Util; import org.jboss.as.controller.parsing.ParseUtils; import org.jboss.as.controller.persistence.SubsystemMarshallingContext; import org.jboss.dmr.ModelNode; +import org.jboss.dmr.Property; import org.jboss.staxmapper.XMLElementReader; import org.jboss.staxmapper.XMLElementWriter; import org.jboss.staxmapper.XMLExtendedStreamReader; @@ -29,26 +35,16 @@ import org.jboss.staxmapper.XMLExtendedStreamWriter; import javax.xml.stream.XMLStreamConstants; import javax.xml.stream.XMLStreamException; import java.util.List; -import static javax.xml.stream.XMLStreamConstants.END_ELEMENT; -import org.jboss.as.controller.AttributeDefinition; -import org.jboss.as.controller.PathElement; -import org.jboss.as.controller.PropertiesAttributeDefinition; -import org.jboss.as.controller.SimpleAttributeDefinition; -import org.jboss.as.controller.descriptions.ModelDescriptionConstants; -import org.jboss.dmr.Property; import static org.keycloak.subsystem.server.extension.KeycloakExtension.PATH_SUBSYSTEM; -import static org.keycloak.subsystem.server.extension.KeycloakSubsystemDefinition.WEB_CONTEXT; -import static org.keycloak.subsystem.server.extension.KeycloakSubsystemDefinition.PROVIDERS; import static org.keycloak.subsystem.server.extension.KeycloakSubsystemDefinition.MASTER_REALM_NAME; +import static org.keycloak.subsystem.server.extension.KeycloakSubsystemDefinition.PROVIDERS; import static org.keycloak.subsystem.server.extension.KeycloakSubsystemDefinition.SCHEDULED_TASK_INTERVAL; - -import static org.keycloak.subsystem.server.extension.ThemeResourceDefinition.MODULES; - -import static org.keycloak.subsystem.server.extension.SpiResourceDefinition.DEFAULT_PROVIDER; - +import static org.keycloak.subsystem.server.extension.KeycloakSubsystemDefinition.WEB_CONTEXT; import static org.keycloak.subsystem.server.extension.ProviderResourceDefinition.ENABLED; import static org.keycloak.subsystem.server.extension.ProviderResourceDefinition.PROPERTIES; +import static org.keycloak.subsystem.server.extension.SpiResourceDefinition.DEFAULT_PROVIDER; +import static org.keycloak.subsystem.server.extension.ThemeResourceDefinition.MODULES; /** * The subsystem parser, which uses stax to read and write to and from xml diff --git a/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/KeycloakSubsystemRemoveHandler.java b/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/KeycloakSubsystemRemoveHandler.java index 649cfcb914..41a5baf283 100644 --- a/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/KeycloakSubsystemRemoveHandler.java +++ b/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/KeycloakSubsystemRemoveHandler.java @@ -23,11 +23,11 @@ import org.jboss.as.controller.PathAddress; import org.jboss.as.controller.PathElement; import org.jboss.as.controller.ReloadRequiredRemoveStepHandler; import org.jboss.as.controller.operations.common.Util; +import org.jboss.as.controller.registry.ImmutableManagementResourceRegistration; import org.jboss.dmr.ModelNode; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.DEPLOYMENT; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.REMOVE; -import org.jboss.as.controller.registry.ImmutableManagementResourceRegistration; /** * Remove an auth-server from a realm. diff --git a/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/KeycloakSubsystemWriteAttributeHandler.java b/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/KeycloakSubsystemWriteAttributeHandler.java index 3304616543..f0bf06ed84 100755 --- a/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/KeycloakSubsystemWriteAttributeHandler.java +++ b/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/KeycloakSubsystemWriteAttributeHandler.java @@ -17,14 +17,14 @@ package org.keycloak.subsystem.server.extension; import org.jboss.as.controller.AttributeDefinition; - -import java.util.List; import org.jboss.as.controller.ModelOnlyWriteAttributeHandler; import org.jboss.as.controller.OperationContext; import org.jboss.as.controller.OperationFailedException; import org.jboss.as.controller.registry.Resource; import org.jboss.dmr.ModelNode; +import java.util.List; + /** * Update an attribute on an Auth Server. * diff --git a/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/MigrateJsonOperation.java b/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/MigrateJsonOperation.java index 92c229ddc5..dbb7324562 100644 --- a/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/MigrateJsonOperation.java +++ b/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/MigrateJsonOperation.java @@ -17,11 +17,6 @@ package org.keycloak.subsystem.server.extension; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.List; import org.jboss.as.controller.AttributeDefinition; import org.jboss.as.controller.OperationContext; import org.jboss.as.controller.OperationDefinition; @@ -33,6 +28,12 @@ import org.jboss.as.controller.SimpleOperationDefinitionBuilder; import org.jboss.dmr.ModelNode; import org.jboss.dmr.ModelType; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.List; + import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADDRESS; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP; diff --git a/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/ProviderResourceAddHandler.java b/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/ProviderResourceAddHandler.java index 7db883c053..746e448f55 100644 --- a/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/ProviderResourceAddHandler.java +++ b/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/ProviderResourceAddHandler.java @@ -18,9 +18,10 @@ package org.keycloak.subsystem.server.extension; import org.jboss.as.controller.AbstractAddStepHandler; import org.jboss.as.controller.OperationFailedException; +import org.jboss.dmr.ModelNode; + import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADD; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP; -import org.jboss.dmr.ModelNode; /** * diff --git a/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/ServerUtil.java b/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/ServerUtil.java index 903f11d6cb..f1ee631966 100644 --- a/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/ServerUtil.java +++ b/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/ServerUtil.java @@ -16,33 +16,33 @@ */ package org.keycloak.subsystem.server.extension; -import java.io.File; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URL; import org.jboss.as.controller.OperationContext; import org.jboss.as.controller.OperationFailedException; import org.jboss.as.controller.OperationStepHandler; import org.jboss.as.controller.PathAddress; import org.jboss.as.controller.PathElement; +import org.jboss.as.controller.operations.common.Util; +import org.jboss.as.controller.registry.ImmutableManagementResourceRegistration; +import org.jboss.dmr.ModelNode; +import org.jboss.modules.Module; +import org.jboss.modules.ModuleIdentifier; +import org.jboss.modules.ModuleLoadException; + +import java.io.File; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; + import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADD; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADDRESS; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ARCHIVE; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.CONTENT; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.DEPLOYMENT; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ENABLED; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.PERSISTENT; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.PATH; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.PERSISTENT; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.REDEPLOY; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.RUNTIME_NAME; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.URL; -import org.jboss.as.controller.operations.common.Util; -import org.jboss.as.controller.registry.ImmutableManagementResourceRegistration; - -import org.jboss.dmr.ModelNode; -import org.jboss.modules.Module; -import org.jboss.modules.ModuleIdentifier; -import org.jboss.modules.ModuleLoadException; /** * Utility methods that help assemble and start an auth server. diff --git a/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/SpiResourceAddHandler.java b/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/SpiResourceAddHandler.java index 3d417917e8..c10b6b5f3a 100644 --- a/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/SpiResourceAddHandler.java +++ b/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/SpiResourceAddHandler.java @@ -19,9 +19,10 @@ package org.keycloak.subsystem.server.extension; import org.jboss.as.controller.AbstractAddStepHandler; import org.jboss.as.controller.OperationFailedException; +import org.jboss.dmr.ModelNode; + import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADD; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP; -import org.jboss.dmr.ModelNode; /** * diff --git a/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/ThemeResourceAddHandler.java b/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/ThemeResourceAddHandler.java index b955101b47..1407f4174d 100644 --- a/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/ThemeResourceAddHandler.java +++ b/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/ThemeResourceAddHandler.java @@ -22,10 +22,11 @@ import org.jboss.as.controller.AttributeDefinition; import org.jboss.as.controller.OperationFailedException; import org.jboss.as.controller.PathAddress; import org.jboss.as.controller.PathElement; +import org.jboss.dmr.ModelNode; + import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADD; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADDRESS; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP; -import org.jboss.dmr.ModelNode; import static org.keycloak.subsystem.server.extension.ThemeResourceDefinition.ALL_ATTRIBUTES; /** diff --git a/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/ThemeResourceDefinition.java b/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/ThemeResourceDefinition.java index 94dca67eee..09008b1b95 100644 --- a/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/ThemeResourceDefinition.java +++ b/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/extension/ThemeResourceDefinition.java @@ -17,10 +17,6 @@ package org.keycloak.subsystem.server.extension; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; import org.jboss.as.controller.AttributeDefinition; import org.jboss.as.controller.PathElement; import org.jboss.as.controller.ReloadRequiredWriteAttributeHandler; @@ -33,6 +29,11 @@ import org.jboss.dmr.ModelNode; import org.jboss.dmr.ModelType; import org.keycloak.subsystem.server.attributes.ModulesListAttributeBuilder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + /** * * @author Stan Silvert ssilvert@redhat.com (C) 2016 Red Hat Inc. diff --git a/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/logging/KeycloakLogger.java b/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/logging/KeycloakLogger.java index ca1f0eba85..58b16e55c7 100755 --- a/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/logging/KeycloakLogger.java +++ b/wildfly/server-subsystem/src/main/java/org/keycloak/subsystem/server/logging/KeycloakLogger.java @@ -18,12 +18,8 @@ package org.keycloak.subsystem.server.logging; import org.jboss.logging.BasicLogger; import org.jboss.logging.Logger; -import org.jboss.logging.annotations.LogMessage; -import org.jboss.logging.annotations.Message; import org.jboss.logging.annotations.MessageLogger; -import static org.jboss.logging.Logger.Level.INFO; - /** * This interface to be fleshed out later when error messages are fully externalized. * diff --git a/wildfly/server-subsystem/src/test/java/org/keycloak/subsystem/server/extension/JsonConfigConverterTestCase.java b/wildfly/server-subsystem/src/test/java/org/keycloak/subsystem/server/extension/JsonConfigConverterTestCase.java index 4c6bf04f0d..9931b4dcd7 100644 --- a/wildfly/server-subsystem/src/test/java/org/keycloak/subsystem/server/extension/JsonConfigConverterTestCase.java +++ b/wildfly/server-subsystem/src/test/java/org/keycloak/subsystem/server/extension/JsonConfigConverterTestCase.java @@ -16,15 +16,16 @@ */ package org.keycloak.subsystem.server.extension; -import java.util.ArrayList; -import java.util.List; import org.jboss.as.controller.PathAddress; import org.jboss.as.controller.PathElement; import org.jboss.dmr.ModelNode; import org.junit.Test; -import static org.junit.Assert.*; + +import java.util.ArrayList; +import java.util.List; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADDRESS; +import static org.junit.Assert.assertEquals; /** * diff --git a/wildfly/server-subsystem/src/test/java/org/keycloak/subsystem/server/extension/SubsystemParsingTestCase.java b/wildfly/server-subsystem/src/test/java/org/keycloak/subsystem/server/extension/SubsystemParsingTestCase.java index 0bc41106dd..25cfa10e91 100755 --- a/wildfly/server-subsystem/src/test/java/org/keycloak/subsystem/server/extension/SubsystemParsingTestCase.java +++ b/wildfly/server-subsystem/src/test/java/org/keycloak/subsystem/server/extension/SubsystemParsingTestCase.java @@ -16,11 +16,11 @@ */ package org.keycloak.subsystem.server.extension; +import org.jboss.as.subsystem.test.AbstractSubsystemBaseTest; + import java.io.IOException; import java.util.Properties; -import org.jboss.as.subsystem.test.AbstractSubsystemBaseTest; - /** * Tests all management expects for subsystem, parsing, marshaling, model definition and other * Here is an example that allows you a fine grained controller over what is tested and how. So it can give you ideas what can be done and tested.