diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/CustomerCookiePortalRoot.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/CustomerCookiePortalRoot.java index 96c97c7797..e8bfd9f136 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/CustomerCookiePortalRoot.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/CustomerCookiePortalRoot.java @@ -17,7 +17,6 @@ package org.keycloak.testsuite.adapter.page; -import java.net.MalformedURLException; import java.net.URL; import org.jboss.arquillian.container.test.api.OperateOnDeployment; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/SerializationServletPage.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/SerializationServletPage.java index 8a46979aa8..3bc7d04717 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/SerializationServletPage.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/adapter/page/SerializationServletPage.java @@ -21,7 +21,6 @@ import org.jboss.arquillian.container.test.api.OperateOnDeployment; import org.jboss.arquillian.test.api.ArquillianResource; import org.keycloak.testsuite.page.AbstractPageWithInjectedUrl; -import jakarta.ws.rs.core.UriBuilder; import java.net.URI; import java.net.URL; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/admin/ApiUtil.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/admin/ApiUtil.java index b86a99005b..eb37e72994 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/admin/ApiUtil.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/admin/ApiUtil.java @@ -21,7 +21,6 @@ import org.keycloak.admin.client.resource.AuthorizationResource; import org.keycloak.admin.client.resource.ClientResource; import org.keycloak.admin.client.resource.ClientScopeResource; import org.keycloak.admin.client.resource.GroupResource; -import org.keycloak.admin.client.resource.GroupsResource; import org.keycloak.admin.client.resource.RealmResource; import org.keycloak.admin.client.resource.RoleResource; import org.keycloak.admin.client.resource.UserResource; @@ -42,7 +41,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import static org.junit.Assert.assertEquals; import static org.keycloak.representations.idm.CredentialRepresentation.PASSWORD; /** diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/annotation/RestartContainer.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/annotation/RestartContainer.java index bd3b113302..7e78c03562 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/annotation/RestartContainer.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/annotation/RestartContainer.java @@ -16,7 +16,6 @@ */ package org.keycloak.testsuite.arquillian.annotation; -import org.keycloak.common.Profile; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/InfinispanServerDeployableContainer.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/InfinispanServerDeployableContainer.java index cda985eb15..87470c15d7 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/InfinispanServerDeployableContainer.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/InfinispanServerDeployableContainer.java @@ -25,7 +25,6 @@ import java.nio.file.Files; import java.security.KeyManagementException; import java.security.NoSuchAlgorithmException; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; import java.util.concurrent.TimeUnit; import javax.management.remote.JMXServiceURL; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/SecurityActions.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/SecurityActions.java index 7e4e04d787..84daf40407 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/SecurityActions.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/SecurityActions.java @@ -123,7 +123,7 @@ final class SecurityActions { final T obj; try { Constructor constructor = getConstructor(implClass, argumentTypes); - if (!constructor.isAccessible()) { + if (!constructor.canAccess(null)) { constructor.setAccessible(true); } obj = constructor.newInstance(arguments); @@ -183,7 +183,7 @@ final class SecurityActions { @Override public Void run() throws Exception { Field field = source.getDeclaredField(fieldName); - if (!field.isAccessible()) { + if (!field.canAccess(target)) { field.setAccessible(true); } field.set(target, value); diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/jmx/JmxConnectorRegistryCreator.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/jmx/JmxConnectorRegistryCreator.java index 004967eb26..29805a9c7a 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/jmx/JmxConnectorRegistryCreator.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/jmx/JmxConnectorRegistryCreator.java @@ -19,7 +19,6 @@ package org.keycloak.testsuite.arquillian.jmx; import java.io.IOException; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; -import java.util.logging.Level; import javax.management.remote.JMXConnector; import javax.management.remote.JMXConnectorFactory; import javax.management.remote.JMXServiceURL; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/provider/URLProvider.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/provider/URLProvider.java index 9d754d6142..5f029a4fdf 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/provider/URLProvider.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/provider/URLProvider.java @@ -24,7 +24,6 @@ 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.logging.Logger; -import org.jboss.logging.Logger.Level; import org.keycloak.testsuite.arquillian.SuiteContext; import org.keycloak.testsuite.arquillian.TestContext; import org.keycloak.testsuite.arquillian.annotation.AppServerBrowserContext; @@ -36,12 +35,10 @@ import java.lang.annotation.Annotation; import java.net.MalformedURLException; import java.net.URISyntaxException; import java.net.URL; -import java.util.HashSet; import java.util.List; -import java.util.Set; + import org.keycloak.testsuite.arquillian.ContainerInfo; import org.keycloak.testsuite.util.ServerURLs; -import org.keycloak.testsuite.util.URLUtils; import static org.keycloak.testsuite.util.ServerURLs.APP_SERVER_HOST; import static org.keycloak.testsuite.util.ServerURLs.APP_SERVER_PORT; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/DeleteAccountActionConfirmPage.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/DeleteAccountActionConfirmPage.java index 623972b9c4..539db4dcb7 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/DeleteAccountActionConfirmPage.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/DeleteAccountActionConfirmPage.java @@ -1,7 +1,6 @@ package org.keycloak.testsuite.auth.page.login; import org.keycloak.authentication.requiredactions.DeleteAccount; -import org.keycloak.testsuite.auth.page.AuthRealm; import org.openqa.selenium.By; 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/auth/page/login/OneTimeCode.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/OneTimeCode.java index 6b90b1edfe..1e9d570ce7 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/OneTimeCode.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/auth/page/login/OneTimeCode.java @@ -21,7 +21,6 @@ import org.keycloak.testsuite.util.URLUtils; import org.openqa.selenium.NoSuchElementException; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; -import org.openqa.selenium.support.ui.Select; import static org.keycloak.testsuite.util.UIUtils.getTextFromElement; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/cli/KcRegExec.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/cli/KcRegExec.java index 56039afefc..e90f867af1 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/cli/KcRegExec.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/cli/KcRegExec.java @@ -3,20 +3,7 @@ package org.keycloak.testsuite.cli; import org.keycloak.testsuite.cli.exec.AbstractExec; import org.keycloak.testsuite.cli.exec.AbstractExecBuilder; -import java.io.BufferedReader; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FilterOutputStream; -import java.io.IOException; import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.InterruptedIOException; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import java.util.concurrent.TimeUnit; /** * @author Marko Strukelj diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/client/KeycloakTestingClient.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/client/KeycloakTestingClient.java index b93a3d3094..27ef4d45b5 100755 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/client/KeycloakTestingClient.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/client/KeycloakTestingClient.java @@ -17,8 +17,6 @@ package org.keycloak.testsuite.client; -import jakarta.ws.rs.core.Response; - import org.jboss.resteasy.client.jaxrs.ResteasyClient; import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder; import org.jboss.resteasy.client.jaxrs.ResteasyWebTarget; @@ -33,11 +31,8 @@ import org.keycloak.testsuite.runonserver.*; import org.keycloak.testsuite.util.AdminClientUtil; import org.keycloak.util.JsonSerialization; -import java.util.List; import java.util.Set; -import static org.junit.Assert.assertEquals; - /** * @author Marko Strukelj */ diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/client/resources/TestSamlApplicationResource.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/client/resources/TestSamlApplicationResource.java index b0d1975763..8c441c05cc 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/client/resources/TestSamlApplicationResource.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/client/resources/TestSamlApplicationResource.java @@ -26,7 +26,6 @@ import jakarta.ws.rs.GET; import jakarta.ws.rs.POST; import jakarta.ws.rs.Path; import jakarta.ws.rs.Produces; -import jakarta.ws.rs.QueryParam; /** * @author Stian Thorgersen diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/client/resources/TestingExportImportResource.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/client/resources/TestingExportImportResource.java index a7583652d5..e83e1622cd 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/client/resources/TestingExportImportResource.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/client/resources/TestingExportImportResource.java @@ -24,7 +24,6 @@ import jakarta.ws.rs.Path; import jakarta.ws.rs.Produces; import jakarta.ws.rs.QueryParam; import jakarta.ws.rs.core.MediaType; -import jakarta.ws.rs.core.Response; import org.keycloak.exportimport.Strategy; /** 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 544fe46ac9..eaf2ae12a9 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 @@ -18,7 +18,6 @@ package org.keycloak.testsuite.page; import org.jboss.arquillian.drone.api.annotation.Drone; -import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.logging.Logger; import org.keycloak.testsuite.util.DroneUtils; import org.keycloak.testsuite.util.URLUtils; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/page/LoginPasswordUpdatePage.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/page/LoginPasswordUpdatePage.java index 8b23b47d2c..7f36895d7f 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/page/LoginPasswordUpdatePage.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/page/LoginPasswordUpdatePage.java @@ -20,7 +20,6 @@ package org.keycloak.testsuite.page; import org.jboss.arquillian.drone.api.annotation.Drone; import org.junit.Assert; import org.keycloak.testsuite.pages.PageUtils; -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/pages/AppPage.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/AppPage.java index 5b6e91e1e4..8aa98e4c46 100755 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/AppPage.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/AppPage.java @@ -17,13 +17,9 @@ package org.keycloak.testsuite.pages; -import org.keycloak.OAuth2Constants; -import org.keycloak.protocol.oidc.OIDCLoginProtocolService; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; -import jakarta.ws.rs.core.UriBuilder; - import static org.keycloak.testsuite.util.UIUtils.clickLink; import static org.keycloak.testsuite.util.ServerURLs.removeDefaultPorts; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/ErrorPage.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/ErrorPage.java index 993f5a6cde..b539c6b6ea 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/ErrorPage.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/ErrorPage.java @@ -16,7 +16,6 @@ */ package org.keycloak.testsuite.pages; -import org.apache.commons.lang.StringEscapeUtils; import org.jboss.arquillian.test.api.ArquillianResource; import org.keycloak.testsuite.util.OAuthClient; import org.keycloak.testsuite.util.UIUtils; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/LoginTotpPage.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/LoginTotpPage.java index a23e81d1cf..74158401d2 100755 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/LoginTotpPage.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/LoginTotpPage.java @@ -22,7 +22,6 @@ import java.util.stream.Collectors; import org.junit.Assert; import org.keycloak.common.util.Retry; import org.keycloak.testsuite.util.UIUtils; -import org.keycloak.testsuite.util.WaitUtils; import org.openqa.selenium.By; import org.openqa.selenium.NoSuchElementException; import org.openqa.selenium.WebElement; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/OAuthGrantPage.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/OAuthGrantPage.java index 648ccc2976..47dc36d116 100755 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/OAuthGrantPage.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/OAuthGrantPage.java @@ -20,7 +20,6 @@ import java.util.Arrays; import java.util.LinkedList; import java.util.List; -import org.hamcrest.Matchers; import org.junit.Assert; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/x509/X509IdentityConfirmationPage.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/x509/X509IdentityConfirmationPage.java index 38ad2c25a4..9ef5a5aac4 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/x509/X509IdentityConfirmationPage.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/x509/X509IdentityConfirmationPage.java @@ -19,7 +19,6 @@ package org.keycloak.testsuite.pages.x509; import org.jboss.arquillian.test.api.ArquillianResource; -import org.keycloak.testsuite.pages.AbstractPage; import org.keycloak.testsuite.pages.LanguageComboboxAwarePage; import org.keycloak.testsuite.util.OAuthClient; import org.openqa.selenium.WebElement; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/updaters/Creator.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/updaters/Creator.java index bc03e763d6..49c0dc2754 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/updaters/Creator.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/updaters/Creator.java @@ -45,7 +45,6 @@ import java.util.concurrent.atomic.AtomicBoolean; import jakarta.ws.rs.core.Response; import org.hamcrest.Matchers; import org.jboss.logging.Logger; -import org.junit.Assert; import static org.hamcrest.MatcherAssert.assertThat; import static org.keycloak.testsuite.admin.ApiUtil.getCreatedId; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/AdminClientUtil.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/AdminClientUtil.java index 1b98e1a1bf..ea6bb65770 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/AdminClientUtil.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/AdminClientUtil.java @@ -150,7 +150,7 @@ public class AdminClientUtil { throw new RuntimeException("Truststore file not found: " + file.getAbsolutePath()); } SSLContext theContext = SSLContexts.custom() - .useProtocol("TLS") + .setProtocol("TLS") .loadTrustMaterial(file, password == null ? null : password.toCharArray()) .build(); return theContext; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/DroneUtils.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/DroneUtils.java index acd726b3ab..504393aadb 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/DroneUtils.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/DroneUtils.java @@ -78,7 +78,7 @@ public final class DroneUtils { if (f.getAnnotation(Page.class) != null && AbstractPage.class.isAssignableFrom(f.getType())) { try { - if (!f.isAccessible()) + if (!f.canAccess(target)) f.setAccessible(true); Object o = f.get(target); AbstractPage page = (AbstractPage) o; @@ -89,7 +89,7 @@ public final class DroneUtils { } } else if (f.getName().equals("driver") && WebDriver.class.isAssignableFrom(f.getType())) { try { - if (!f.isAccessible()) + if (!f.canAccess(target)) f.setAccessible(true); f.set(target, driver); @@ -99,7 +99,7 @@ public final class DroneUtils { } } else if (f.getName().equals("oauth") && OAuthClient.class.isAssignableFrom(f.getType())) { try { - if (!f.isAccessible()) + if (!f.canAccess(target)) f.setAccessible(true); Object o = f.get(target); ((OAuthClient) o).setDriver(driver); diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/Matchers.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/Matchers.java index 09d430d312..088d073c12 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/Matchers.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/Matchers.java @@ -21,7 +21,6 @@ import org.keycloak.dom.saml.v2.protocol.AuthnRequestType; import org.keycloak.dom.saml.v2.protocol.LogoutRequestType; import org.keycloak.dom.saml.v2.protocol.ResponseType; import org.keycloak.dom.saml.v2.protocol.StatusResponseType; -import org.keycloak.testsuite.util.matchers.SamlResponseTypeMatcher; import org.keycloak.saml.common.constants.JBossSAMLURIConstants; import org.keycloak.testsuite.util.matchers.*; 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 cf584e8a32..eb298693f1 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 @@ -1408,7 +1408,7 @@ public class OAuthClient { public Map getCurrentQuery() { Map m = new HashMap<>(); - List pairs = URLEncodedUtils.parse(getCurrentUri(), "UTF-8"); + List pairs = URLEncodedUtils.parse(getCurrentUri(), StandardCharsets.UTF_8); for (NameValuePair p : pairs) { m.put(p.getName(), p.getValue()); } diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/SamlClient.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/SamlClient.java index 2ab00fd103..b27dc1f483 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/SamlClient.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/SamlClient.java @@ -81,6 +81,7 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.URI; +import java.nio.charset.StandardCharsets; import java.security.Key; import java.security.KeyManagementException; import java.security.PrivateKey; @@ -661,7 +662,7 @@ public class SamlClient { * @return */ public static String extractRelayStateFromRedirect(String responseUri) { - List params = URLEncodedUtils.parse(URI.create(responseUri), "UTF-8"); + List params = URLEncodedUtils.parse(URI.create(responseUri), StandardCharsets.UTF_8); return params.stream().filter(nameValuePair -> nameValuePair.getName().equals(RELAY_STATE)) .findFirst().map(NameValuePair::getValue).orElse(null); diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/SamlClientBuilder.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/SamlClientBuilder.java index 9cacdface7..6231b960ef 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/SamlClientBuilder.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/SamlClientBuilder.java @@ -18,7 +18,6 @@ package org.keycloak.testsuite.util; import org.keycloak.dom.saml.v2.SAML2Object; import org.keycloak.saml.processing.core.saml.v2.common.SAMLDocumentHolder; -import org.keycloak.testsuite.client.KeycloakTestingClient; import org.keycloak.testsuite.page.AbstractPage; import org.keycloak.testsuite.util.SamlClient.Binding; import org.keycloak.testsuite.util.SamlClient.DoNotFollowRedirectStep; @@ -43,7 +42,6 @@ import java.util.function.Function; import jakarta.ws.rs.core.Response.Status; import org.apache.http.client.methods.HttpUriRequest; import org.hamcrest.Matcher; -import org.junit.Assert; import org.w3c.dom.Document; import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/WebDriverLogDumper.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/WebDriverLogDumper.java index f56a119fe3..e722cfd4b5 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/WebDriverLogDumper.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/WebDriverLogDumper.java @@ -1,6 +1,5 @@ package org.keycloak.testsuite.util; -import org.jboss.logging.Logger; import org.openqa.selenium.WebDriver; import org.openqa.selenium.logging.LogEntries; import org.openqa.selenium.logging.LogEntry; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/javascript/JSObjectBuilder.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/javascript/JSObjectBuilder.java index d53a5e7922..44600ca512 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/javascript/JSObjectBuilder.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/javascript/JSObjectBuilder.java @@ -1,7 +1,6 @@ package org.keycloak.testsuite.util.javascript; import java.io.IOException; -import java.lang.reflect.Array; import java.util.HashMap; import java.util.Map; import java.util.Objects; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/javascript/JavascriptStateValidator.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/javascript/JavascriptStateValidator.java index 9a5839abae..504faa243f 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/javascript/JavascriptStateValidator.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/javascript/JavascriptStateValidator.java @@ -1,6 +1,5 @@ package org.keycloak.testsuite.util.javascript; -import org.keycloak.models.KeycloakSession; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/javascript/JavascriptTestExecutor.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/javascript/JavascriptTestExecutor.java index 92e1ccab02..85960e581b 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/javascript/JavascriptTestExecutor.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/javascript/JavascriptTestExecutor.java @@ -2,7 +2,6 @@ package org.keycloak.testsuite.util.javascript; import org.jboss.logging.Logger; import org.keycloak.representations.idm.UserRepresentation; -import org.keycloak.services.managers.AuthenticationManager; import org.keycloak.testsuite.auth.page.login.OIDCLogin; import org.keycloak.testsuite.pages.LogoutConfirmPage; import org.keycloak.testsuite.util.WaitUtils; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/javascript/ResponseValidator.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/javascript/ResponseValidator.java index d66598ffc9..b54c11331c 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/javascript/ResponseValidator.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/javascript/ResponseValidator.java @@ -1,8 +1,5 @@ package org.keycloak.testsuite.util.javascript; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.WebElement; - import java.io.Serializable; import java.util.Map; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/saml/CreateArtifactMessageStepBuilder.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/saml/CreateArtifactMessageStepBuilder.java index e3b1e8aed1..5d1dc35353 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/saml/CreateArtifactMessageStepBuilder.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/saml/CreateArtifactMessageStepBuilder.java @@ -1,6 +1,5 @@ package org.keycloak.testsuite.util.saml; -import com.google.common.base.Charsets; import org.apache.http.NameValuePair; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.CloseableHttpResponse; @@ -13,23 +12,16 @@ import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.message.BasicNameValuePair; import org.jboss.logging.Logger; import org.keycloak.protocol.saml.ArtifactResolver; -import org.keycloak.protocol.saml.ArtifactResolverProcessingException; import org.keycloak.protocol.saml.DefaultSamlArtifactResolver; -import org.keycloak.protocol.saml.SamlProtocolUtils; import org.keycloak.saml.common.constants.GeneralConstants; import org.keycloak.saml.common.exceptions.ProcessingException; import org.keycloak.testsuite.util.SamlClient; import org.keycloak.testsuite.util.SamlClientBuilder; -import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.URI; import java.net.URISyntaxException; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.security.SecureRandom; -import java.util.Base64; import java.util.LinkedList; import java.util.List; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/saml/HandleArtifactStepBuilder.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/saml/HandleArtifactStepBuilder.java index ec8e7f8bad..550ad306ec 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/saml/HandleArtifactStepBuilder.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/saml/HandleArtifactStepBuilder.java @@ -11,7 +11,6 @@ import org.apache.http.util.EntityUtils; import org.keycloak.common.util.KeyUtils; import org.keycloak.dom.saml.v2.assertion.NameIDType; import org.keycloak.dom.saml.v2.protocol.ArtifactResolveType; -import org.keycloak.models.SingleUseObjectProvider; import org.keycloak.protocol.saml.SamlProtocol; import org.keycloak.protocol.saml.SamlService; import org.keycloak.protocol.saml.profile.util.Soap; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/saml/ModifySamlResponseStepBuilder.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/saml/ModifySamlResponseStepBuilder.java index 6363a93383..509a08f31a 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/saml/ModifySamlResponseStepBuilder.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/saml/ModifySamlResponseStepBuilder.java @@ -28,6 +28,7 @@ import java.io.IOException; import java.io.InputStream; import java.net.URI; import java.net.URISyntaxException; +import java.nio.charset.StandardCharsets; import java.util.Iterator; import java.util.LinkedList; import java.util.List; @@ -168,7 +169,7 @@ public class ModifySamlResponseStepBuilder extends SamlDocumentStepBuilder it = params.iterator(); it.hasNext();) { NameValuePair param = it.next(); if ("SAMLResponse".equals(param.getName()) || "SAMLRequest".equals(param.getName())) { diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/saml/SamlDocumentStepBuilder.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/saml/SamlDocumentStepBuilder.java index 31310c8961..6aa07b2415 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/saml/SamlDocumentStepBuilder.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/saml/SamlDocumentStepBuilder.java @@ -37,7 +37,6 @@ import org.keycloak.testsuite.util.SamlClient.Step; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.util.function.Consumer; -import java.util.logging.Level; import javax.xml.stream.XMLStreamWriter; import org.jboss.logging.Logger; import org.junit.Assert; 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 f6f25c043c..6b53bd0453 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 @@ -68,7 +68,7 @@ import org.keycloak.testsuite.util.TestEventsLogger; import org.openqa.selenium.WebDriver; import jakarta.ws.rs.NotFoundException; -import jakarta.ws.rs.core.UriBuilder; + import java.io.IOException; import java.io.InputStream; import java.io.PipedInputStream; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/AssertEvents.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/AssertEvents.java index cde4c4d185..388e25e6d9 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/AssertEvents.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/AssertEvents.java @@ -40,6 +40,8 @@ import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; + +import static org.hamcrest.Matchers.emptyOrNullString; import static org.hamcrest.Matchers.is; import static org.hamcrest.MatcherAssert.assertThat; import static org.keycloak.testsuite.util.ServerURLs.getAuthServerContextRoot; @@ -94,7 +96,7 @@ public class AssertEvents implements TestRule { } public ExpectedEvent expectRequiredAction(EventType event) { - return expectLogin().event(event).removeDetail(Details.CONSENT).session(Matchers.isEmptyOrNullString()); + return expectLogin().event(event).removeDetail(Details.CONSENT).session(is(emptyOrNullString())); } public ExpectedEvent expectLogin() { diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/account/AbstractRestServiceTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/account/AbstractRestServiceTest.java index f05890e36d..d1850acdfd 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/account/AbstractRestServiceTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/account/AbstractRestServiceTest.java @@ -42,8 +42,6 @@ import org.keycloak.testsuite.util.ClientBuilder; import org.keycloak.testsuite.util.TokenUtil; import org.keycloak.testsuite.util.UserBuilder; -import jakarta.ws.rs.core.UriBuilder; - /** * @author Stian Thorgersen */ 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 8b4b4ef584..b8b5f46a05 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 @@ -25,7 +25,6 @@ import org.keycloak.testsuite.util.UserBuilder; import java.util.LinkedList; import java.util.List; -import java.util.stream.Collectors; /** * diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/actions/AppInitiatedActionUpdateEmailWithVerificationTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/actions/AppInitiatedActionUpdateEmailWithVerificationTest.java index 1056cb8ea9..a5f1856c30 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/actions/AppInitiatedActionUpdateEmailWithVerificationTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/actions/AppInitiatedActionUpdateEmailWithVerificationTest.java @@ -17,7 +17,6 @@ package org.keycloak.testsuite.actions; import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.endsWith; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -26,7 +25,6 @@ import jakarta.mail.Address; import jakarta.mail.Message; import jakarta.mail.MessagingException; import jakarta.mail.internet.MimeMessage; -import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.jboss.arquillian.graphene.page.Page; import org.junit.Assert; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/fuse/FuseAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/fuse/FuseAdapterTest.java index 90da3b8a29..d035427285 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/fuse/FuseAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/fuse/FuseAdapterTest.java @@ -62,7 +62,6 @@ import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; import org.keycloak.testsuite.arquillian.annotation.DisableFeature; import org.keycloak.testsuite.auth.page.AuthRealm; import org.keycloak.testsuite.pages.LogoutConfirmPage; -import org.keycloak.testsuite.util.SecondBrowser; import org.keycloak.testsuite.utils.arquillian.ContainerConstants; import org.keycloak.testsuite.auth.page.login.OIDCLogin; import org.keycloak.testsuite.util.DroneUtils; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/hal/ConsoleProtectionTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/hal/ConsoleProtectionTest.java index ec7d503bcb..672bf308c1 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/hal/ConsoleProtectionTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/hal/ConsoleProtectionTest.java @@ -16,12 +16,10 @@ */ package org.keycloak.testsuite.adapter.example.hal; -import static org.junit.Assert.assertTrue; import static org.keycloak.testsuite.utils.io.IOUtil.loadRealm; import static org.keycloak.testsuite.util.ServerURLs.getAuthServerContextRoot; import java.io.IOException; -import java.net.URISyntaxException; import java.util.List; import java.util.concurrent.TimeoutException; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/AbstractSAMLServletAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/AbstractSAMLServletAdapterTest.java index b65e6ff1d7..216340e34b 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/AbstractSAMLServletAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/AbstractSAMLServletAdapterTest.java @@ -23,8 +23,6 @@ import java.io.IOException; import java.util.Arrays; import java.util.List; import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import static org.keycloak.testsuite.admin.ApiUtil.getCreatedId; import static org.keycloak.testsuite.auth.page.AuthRealm.SAMLSERVLETDEMO; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/DemoFilterServletAdapterTestForCustomizedIdMapper.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/DemoFilterServletAdapterTestForCustomizedIdMapper.java index f5687d6b20..5fff1c8cf0 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/DemoFilterServletAdapterTestForCustomizedIdMapper.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/DemoFilterServletAdapterTestForCustomizedIdMapper.java @@ -21,7 +21,6 @@ import org.keycloak.testsuite.adapter.AbstractServletsAdapterTest; import org.keycloak.testsuite.adapter.page.CustomerPortal; import org.keycloak.testsuite.adapter.spi.TestSessionIdMapper; import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; -import org.keycloak.testsuite.auth.page.login.OIDCLogin; import org.keycloak.testsuite.util.JavascriptBrowser; import org.keycloak.testsuite.utils.annotation.UseServletFilter; import org.keycloak.testsuite.utils.arquillian.ContainerConstants; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/DemoServletsAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/DemoServletsAdapterTest.java index d34b432259..4ddbf386e9 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/DemoServletsAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/DemoServletsAdapterTest.java @@ -101,6 +101,7 @@ import java.io.File; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; +import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -861,7 +862,7 @@ public class DemoServletsAdapterTest extends AbstractServletsAdapterTest { private static Map getQueryFromUrl(String url) { try { - return URLEncodedUtils.parse(new URI(url), "UTF-8").stream() + return URLEncodedUtils.parse(new URI(url), StandardCharsets.UTF_8).stream() .collect(Collectors.toMap(p -> p.getName(), p -> p.getValue())); } catch (URISyntaxException e) { return null; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/KeycloakPrincipalSerializationTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/KeycloakPrincipalSerializationTest.java index 2c20fb883d..67cde91fab 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/KeycloakPrincipalSerializationTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/KeycloakPrincipalSerializationTest.java @@ -9,9 +9,7 @@ import org.keycloak.testsuite.adapter.page.SerializationServletPage; import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; import org.keycloak.testsuite.utils.arquillian.ContainerConstants; -import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.containsString; -import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.not; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/SAMLClockSkewAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/SAMLClockSkewAdapterTest.java index dfcc879296..d6242d00f6 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/SAMLClockSkewAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/SAMLClockSkewAdapterTest.java @@ -24,11 +24,9 @@ import org.jboss.arquillian.container.test.api.Deployer; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.junit.Assert; import org.junit.Test; import org.keycloak.adapters.rotation.PublicKeyLocator; import org.keycloak.representations.idm.RealmRepresentation; -import org.keycloak.testsuite.adapter.AbstractServletsAdapterTest; import org.keycloak.testsuite.adapter.filter.AdapterActionsFilter; import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; import org.keycloak.testsuite.util.SamlClientBuilder; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/SAMLFilterServletAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/SAMLFilterServletAdapterTest.java index a107bdb304..b354073f9b 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/SAMLFilterServletAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/SAMLFilterServletAdapterTest.java @@ -1,6 +1,5 @@ package org.keycloak.testsuite.adapter.servlet; -import org.jboss.arquillian.test.spi.execution.SkippedTestExecutionException; import org.junit.After; import org.junit.Assume; import org.junit.Before; @@ -9,7 +8,6 @@ import org.junit.Ignore; import org.junit.Test; import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; import org.keycloak.testsuite.util.ContainerAssume; -import org.keycloak.testsuite.util.ServerURLs; import org.keycloak.testsuite.utils.annotation.UseServletFilter; import org.keycloak.testsuite.utils.arquillian.ContainerConstants; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/SAMLServletSessionTimeoutTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/SAMLServletSessionTimeoutTest.java index 8a40405c6a..b717ac943d 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/SAMLServletSessionTimeoutTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/SAMLServletSessionTimeoutTest.java @@ -1,6 +1,5 @@ package org.keycloak.testsuite.adapter.servlet; -import org.apache.http.util.EntityUtils; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.graphene.page.Page; import org.jboss.shrinkwrap.api.spec.WebArchive; @@ -19,7 +18,6 @@ import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; import org.keycloak.testsuite.updaters.RealmAttributeUpdater; import org.keycloak.testsuite.util.Matchers; import org.keycloak.testsuite.util.SamlClient; -import org.keycloak.testsuite.util.SamlClientBuilder; import org.keycloak.testsuite.utils.arquillian.ContainerConstants; import javax.xml.datatype.XMLGregorianCalendar; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/SecuredDeploymentsAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/SecuredDeploymentsAdapterTest.java index 8d52e18f0b..faff1df498 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/SecuredDeploymentsAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/SecuredDeploymentsAdapterTest.java @@ -21,9 +21,7 @@ package org.keycloak.testsuite.adapter.servlet; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.MatcherAssert.assertThat; -import static org.keycloak.testsuite.arquillian.AppServerTestEnricher.CURRENT_APP_SERVER; import static org.keycloak.testsuite.arquillian.AppServerTestEnricher.enableHTTPSForAppServer; -import static org.keycloak.testsuite.util.ServerURLs.APP_SERVER_SSL_REQUIRED; import static org.keycloak.testsuite.util.ServerURLs.AUTH_SERVER_SSL_REQUIRED; 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/SessionServletAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/SessionServletAdapterTest.java index e9596e3f0d..91c785a591 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/SessionServletAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/SessionServletAdapterTest.java @@ -17,6 +17,7 @@ package org.keycloak.testsuite.adapter.servlet; +import org.hamcrest.MatcherAssert; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.drone.api.annotation.Drone; import org.jboss.arquillian.graphene.page.Page; @@ -105,7 +106,7 @@ public class SessionServletAdapterTest extends AbstractServletsAdapterTest { driver2.findElement(By.id("password")).submit(); assertCurrentUrlEquals(sessionPortalPage, driver2); String pageSource = driver2.getPageSource(); - assertThat(pageSource, containsString("Counter=1")); + MatcherAssert.assertThat(pageSource, containsString("Counter=1")); // Counter increased now driver2.navigate().to(sessionPortalPage.toString()); pageSource = driver2.getPageSource(); @@ -129,7 +130,7 @@ public class SessionServletAdapterTest extends AbstractServletsAdapterTest { driver2.navigate().to(sessionPortalPage.toString()); assertCurrentUrlEquals(sessionPortalPage, driver2); pageSource = driver2.getPageSource(); - assertThat(pageSource, containsString("Counter=3")); + MatcherAssert.assertThat(pageSource, containsString("Counter=3")); // Logout in driver2 driver2.navigate().to(logoutUri); diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/UserStorageConsentTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/UserStorageConsentTest.java index 4c783d2e94..d311670c8a 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/UserStorageConsentTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/UserStorageConsentTest.java @@ -22,7 +22,6 @@ import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import org.keycloak.OAuth2Constants; import org.keycloak.common.Profile.Feature; import org.keycloak.common.util.MultivaluedHashMap; import org.keycloak.models.ClientModel; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/cluster/OIDCAdapterClusterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/cluster/OIDCAdapterClusterTest.java index 4fa558cf79..c75ae9478b 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/cluster/OIDCAdapterClusterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/cluster/OIDCAdapterClusterTest.java @@ -18,7 +18,6 @@ package org.keycloak.testsuite.adapter.servlet.cluster; import static org.hamcrest.CoreMatchers.containsString; -import static org.hamcrest.Matchers.is; import static org.hamcrest.MatcherAssert.assertThat; import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlEquals; import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWith; @@ -38,12 +37,10 @@ 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.OAuth2Constants; import org.keycloak.common.util.Retry; import org.keycloak.protocol.oidc.OIDCLoginProtocolService; import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.representations.idm.RealmRepresentation; -import org.keycloak.testsuite.Assert; import org.keycloak.testsuite.adapter.AbstractAdapterClusteredTest; import org.keycloak.testsuite.adapter.page.SessionPortalDistributable; import org.keycloak.testsuite.adapter.servlet.SessionServlet; @@ -51,7 +48,6 @@ import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; import org.keycloak.testsuite.pages.InfoPage; import org.keycloak.testsuite.pages.LogoutConfirmPage; import org.keycloak.testsuite.util.ServerURLs; -import org.keycloak.testsuite.util.WaitUtils; import org.keycloak.testsuite.utils.arquillian.ContainerConstants; import org.keycloak.testsuite.auth.page.AuthRealm; import org.keycloak.testsuite.auth.page.login.OIDCLogin; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/crossdc/SAMLAdapterCrossDCTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/crossdc/SAMLAdapterCrossDCTest.java index 6630251d79..174fd95d34 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/crossdc/SAMLAdapterCrossDCTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/crossdc/SAMLAdapterCrossDCTest.java @@ -30,9 +30,10 @@ import org.keycloak.testsuite.arquillian.annotation.InitialDcState; import org.keycloak.testsuite.utils.arquillian.ContainerConstants; import org.keycloak.testsuite.crossdc.ServerSetup; -import static org.hamcrest.Matchers.isEmptyString; + +import static org.hamcrest.Matchers.emptyString; +import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.not; -import static org.keycloak.testsuite.adapter.AbstractServletsAdapterTest.samlServletDeployment; import org.keycloak.testsuite.arquillian.containers.InfinispanServerDeployableContainer; /** @@ -46,7 +47,7 @@ public class SAMLAdapterCrossDCTest extends AbstractSAMLAdapterClusteredTest { @BeforeClass public static void checkCrossDcTest() { - Assume.assumeThat("Seems not to be running cross-DC tests", System.getProperty("cache.server"), not(isEmptyString())); + Assume.assumeThat("Seems not to be running cross-DC tests", System.getProperty("cache.server"), not(is(emptyString()))); Assume.assumeFalse(String.format("%s not supported with `cache-auth` profile.", SAMLAdapterCrossDCTest.class), InfinispanServerDeployableContainer.CACHE_SERVER_AUTH); } diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/AdminClientTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/AdminClientTest.java index e97292be3c..03aec65f91 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/AdminClientTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/AdminClientTest.java @@ -24,7 +24,6 @@ import jakarta.ws.rs.core.Response; import org.junit.Assert; import org.junit.Rule; import org.junit.Test; -import org.junit.rules.ExpectedException; import org.keycloak.admin.client.Keycloak; import org.keycloak.admin.client.resource.ClientResource; import org.keycloak.admin.client.resource.RealmResource; @@ -64,10 +63,6 @@ public class AdminClientTest extends AbstractKeycloakTest { @Rule public AssertEvents events = new AssertEvents(this); - @Rule - public ExpectedException expectedException = ExpectedException.none(); - - @Override public void beforeAbstractKeycloakTest() throws Exception { super.beforeAbstractKeycloakTest(); diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/AdminSignatureAlgorithmTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/AdminSignatureAlgorithmTest.java index e93cb22ec9..f755173a8d 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/AdminSignatureAlgorithmTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/AdminSignatureAlgorithmTest.java @@ -1,6 +1,5 @@ package org.keycloak.testsuite.admin; -import com.fasterxml.jackson.databind.JsonNode; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClientBuilder; import org.junit.After; @@ -8,7 +7,6 @@ import org.junit.Before; import org.junit.Test; import org.keycloak.TokenVerifier; import org.keycloak.admin.client.Keycloak; -import org.keycloak.broker.provider.util.SimpleHttp; import org.keycloak.crypto.Algorithm; import org.keycloak.representations.AccessToken; import org.keycloak.representations.AccessTokenResponse; 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 12eecae610..40fdd08590 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 @@ -548,7 +548,7 @@ public class ClientTest extends AbstractAdminTest { realm.users().get(userId).resetPassword(CredentialBuilder.create().password("password").build()); Map offlineSessionCount = realm.clients().get(id).getOfflineSessionCount(); - assertEquals(new Long(0), offlineSessionCount.get("count")); + assertEquals(Long.valueOf(0), offlineSessionCount.get("count")); List userSessions = realm.users().get(userId).getOfflineSessions(id); assertEquals("There should be no offline sessions", 0, userSessions.size()); @@ -561,7 +561,7 @@ public class ClientTest extends AbstractAdminTest { assertEquals(200, accessTokenResponse.getStatusCode()); offlineSessionCount = realm.clients().get(id).getOfflineSessionCount(); - assertEquals(new Long(1), offlineSessionCount.get("count")); + assertEquals(Long.valueOf(1), offlineSessionCount.get("count")); List offlineUserSessions = realm.clients().get(id).getOfflineUserSessions(0, 100); assertEquals(1, offlineUserSessions.size()); diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/ConsentsTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/ConsentsTest.java index 7ea69c5563..b6269cc17e 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/ConsentsTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/ConsentsTest.java @@ -50,7 +50,6 @@ import java.util.Collections; import java.util.List; import java.util.Map; -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-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/DeclarativeUserTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/DeclarativeUserTest.java index f96bb12b57..c01783cfa8 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/DeclarativeUserTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/DeclarativeUserTest.java @@ -34,11 +34,9 @@ import org.keycloak.testsuite.util.AdminClientUtil; import org.keycloak.testsuite.util.UserBuilder; import org.keycloak.userprofile.DeclarativeUserProfileProvider; import org.keycloak.userprofile.UserProfileProvider; -import org.keycloak.utils.StringUtil; import java.util.Arrays; import java.util.Collections; -import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/FineGrainAdminUnitTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/FineGrainAdminUnitTest.java index 2d5b47bc93..5031d27247 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/FineGrainAdminUnitTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/FineGrainAdminUnitTest.java @@ -72,6 +72,8 @@ import java.util.stream.Collectors; import static org.hamcrest.Matchers.hasItem; import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.oneOf; import static org.keycloak.testsuite.admin.ImpersonationDisabledTest.IMPERSONATION_DISABLED; import static org.keycloak.testsuite.auth.page.AuthRealm.TEST; import static org.keycloak.testsuite.util.ServerURLs.getAuthServerContextRoot; @@ -1142,10 +1144,10 @@ public class FineGrainAdminUnitTest extends AbstractKeycloakTest { List result = client.realm("test").clients().findAll(null, true, false, 0, 1); Assert.assertEquals(1, result.size()); - assertThat(result, Matchers.hasItem(Matchers.hasProperty("clientId", Matchers.is("client-search-09")))); + assertThat(result, Matchers.hasItem(Matchers.hasProperty("clientId", is("client-search-09")))); result = client.realm("test").clients().findAll(null, true, false, 1, 1); - assertThat(result, Matchers.hasItem(Matchers.hasProperty("clientId", Matchers.is("client-search-10")))); + assertThat(result, Matchers.hasItem(Matchers.hasProperty("clientId", is("client-search-10")))); Assert.assertEquals(1, result.size()); @@ -1196,7 +1198,7 @@ public class FineGrainAdminUnitTest extends AbstractKeycloakTest { List result = client.realm("test").clients().findAll("client-search-", true, true, 0, 10); clients.addAll(result); Assert.assertEquals(10, result.size()); - assertThat(result.stream().map(rep -> rep.getClientId()).collect(Collectors.toList()), Matchers.is(Arrays.asList("client-search-09", + assertThat(result.stream().map(rep -> rep.getClientId()).collect(Collectors.toList()), is(Arrays.asList("client-search-09", "client-search-10", "client-search-11", "client-search-12", @@ -1210,7 +1212,7 @@ public class FineGrainAdminUnitTest extends AbstractKeycloakTest { result = client.realm("test").clients().findAll("client-search-", true, true, 10, 10); clients.addAll(result); Assert.assertEquals(10, result.size()); - assertThat(result.stream().map(rep -> rep.getClientId()).collect(Collectors.toList()), Matchers.is(Arrays.asList("client-search-19", + assertThat(result.stream().map(rep -> rep.getClientId()).collect(Collectors.toList()), is(Arrays.asList("client-search-19", "client-search-20", "client-search-21", "client-search-22", @@ -1225,7 +1227,7 @@ public class FineGrainAdminUnitTest extends AbstractKeycloakTest { clients.addAll(result); Assert.assertEquals(1, result.size()); assertThat(result, Matchers.hasItems( - Matchers.hasProperty("clientId", Matchers.isOneOf("client-search-29")))); + Matchers.hasProperty("clientId", is(oneOf("client-search-29"))))); } } @@ -1279,7 +1281,7 @@ public class FineGrainAdminUnitTest extends AbstractKeycloakTest { List result = client.realm("test").clients().findAll("client-search-", true, true, 0, 10); clients.addAll(result); Assert.assertEquals(10, result.size()); - assertThat(result.stream().map(rep -> rep.getClientId()).collect(Collectors.toList()), Matchers.is(Arrays.asList( + assertThat(result.stream().map(rep -> rep.getClientId()).collect(Collectors.toList()), is(Arrays.asList( "client-search-15", "client-search-16", "client-search-17", @@ -1294,7 +1296,7 @@ public class FineGrainAdminUnitTest extends AbstractKeycloakTest { result = client.realm("test").clients().findAll("client-search-", true, true, 10, 10); clients.addAll(result); Assert.assertEquals(5, result.size()); - assertThat(result.stream().map(rep -> rep.getClientId()).collect(Collectors.toList()), Matchers.is(Arrays.asList( + assertThat(result.stream().map(rep -> rep.getClientId()).collect(Collectors.toList()), is(Arrays.asList( "client-search-25", "client-search-26", "client-search-27", 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 2fb913ed68..e528c8c49c 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 @@ -1149,7 +1149,7 @@ public class IdentityProviderTest extends AbstractAdminTest { X509Certificate activeX509SigCert = XMLSignatureUtil.getX509CertificateFromKeyInfoString(activeSigCert); assertThat("KeyName matches subject DN", - keyNameElement.getTextContent().trim(), equalTo(activeX509SigCert.getSubjectDN().getName())); + keyNameElement.getTextContent().trim(), equalTo(activeX509SigCert.getSubjectX500Principal().getName())); assertThat("Signing cert matches active realm cert", x509CertificateElement.getTextContent().trim(), equalTo(Base64.getEncoder().encodeToString(activeX509SigCert.getEncoded()))); diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/InitialAccessTokenResourceTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/InitialAccessTokenResourceTest.java index 8807d1d51a..b0dbe4dbb1 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/InitialAccessTokenResourceTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/InitialAccessTokenResourceTest.java @@ -64,9 +64,9 @@ public class InitialAccessTokenResourceTest extends AbstractAdminTest { assertAdminEvents.assertEvent(realmId, OperationType.CREATE, AdminEventPaths.clientInitialAccessPath(response.getId()), rep, ResourceType.CLIENT_INITIAL_ACCESS_MODEL); assertNotNull(response.getId()); - assertEquals(new Integer(2), response.getCount()); - assertEquals(new Integer(2), response.getRemainingCount()); - assertEquals(new Integer(100), response.getExpiration()); + assertEquals(Integer.valueOf(2), response.getCount()); + assertEquals(Integer.valueOf(2), response.getRemainingCount()); + assertEquals(Integer.valueOf(100), response.getExpiration()); assertThat(response.getTimestamp(), allOf(greaterThanOrEqualTo(time), lessThanOrEqualTo(Time.currentTime()))); assertNotNull(response.getToken()); 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 c729a192e4..86450d478e 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 @@ -28,6 +28,7 @@ import org.keycloak.admin.client.resource.RealmResource; import org.keycloak.common.Profile; import org.keycloak.models.AdminRoles; import org.keycloak.models.Constants; +import org.keycloak.models.UserModel; import org.keycloak.models.credential.OTPCredentialModel; import org.keycloak.representations.KeyStoreConfig; import org.keycloak.representations.idm.AuthenticationExecutionInfoRepresentation; @@ -1546,7 +1547,7 @@ public class PermissionsTest extends AbstractKeycloakTest { }, Resource.USER, true); invoke(new Invocation() { public void invoke(RealmResource realm) { - realm.users().get(user.getId()).resetPasswordEmail(); + realm.users().get(user.getId()).executeActionsEmail(List.of(UserModel.RequiredAction.UPDATE_PASSWORD.name())); } }, Resource.USER, true); invoke(new Invocation() { 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 2224125eff..9329b1e409 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 @@ -32,7 +32,6 @@ import org.keycloak.testsuite.AbstractKeycloakTest; import org.keycloak.testsuite.Assert; import org.keycloak.testsuite.util.KeyUtils; import org.keycloak.testsuite.util.KeystoreUtils; -import org.keycloak.testsuite.util.WaitUtils; import java.util.List; import java.util.Map; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/TimeOffsetTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/TimeOffsetTest.java index 4e4fe96dfb..4a9c2c63ff 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/TimeOffsetTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/TimeOffsetTest.java @@ -16,13 +16,10 @@ */ package org.keycloak.testsuite.admin; -import org.keycloak.Config; import org.keycloak.common.util.Time; import org.keycloak.events.Event; import org.keycloak.events.EventStoreProvider; -import org.keycloak.events.EventStoreSpi; import org.keycloak.events.EventType; -import org.keycloak.events.jpa.JpaEventStoreProviderFactory; import org.keycloak.models.RealmModel; import org.junit.Test; 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 3e24d1e1e1..0fa1115356 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 @@ -64,11 +64,9 @@ import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.representations.idm.RequiredActionProviderRepresentation; import org.keycloak.representations.idm.RoleRepresentation; import org.keycloak.representations.idm.UserRepresentation; -import org.keycloak.services.resources.RealmsResource; import org.keycloak.storage.StorageId; import org.keycloak.storage.UserStorageProvider; import org.keycloak.testsuite.ProfileAssume; -import org.keycloak.testsuite.arquillian.annotation.DisableFeature; import org.keycloak.testsuite.federation.DummyUserFederationProviderFactory; import org.keycloak.testsuite.federation.UserMapStorageFactory; import org.keycloak.testsuite.page.LoginPasswordUpdatePage; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/concurrency/ConcurrencyTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/concurrency/ConcurrencyTest.java index 375657c1f7..2a846f37bd 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/concurrency/ConcurrencyTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/concurrency/ConcurrencyTest.java @@ -17,7 +17,6 @@ package org.keycloak.testsuite.admin.concurrency; -import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import org.junit.Test; import org.keycloak.admin.client.Keycloak; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/concurrency/ConcurrentLoginTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/concurrency/ConcurrentLoginTest.java index db834ff698..27bf39272e 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/concurrency/ConcurrentLoginTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/concurrency/ConcurrentLoginTest.java @@ -21,6 +21,7 @@ import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.URI; import java.net.URISyntaxException; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -42,7 +43,6 @@ import org.apache.http.util.EntityUtils; import org.jsoup.Jsoup; import org.jsoup.nodes.Element; import org.junit.Assert; -import org.junit.Assume; import org.junit.Before; import org.junit.Test; import org.keycloak.Config; @@ -71,9 +71,7 @@ import org.apache.http.impl.client.BasicCookieStore; import org.hamcrest.Matchers; import org.keycloak.util.JsonSerialization; -import static org.hamcrest.CoreMatchers.not; import static org.hamcrest.Matchers.containsString; -import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.MatcherAssert.assertThat; import static org.keycloak.testsuite.util.ServerURLs.AUTH_SERVER_SSL_REQUIRED; /** @@ -333,7 +331,7 @@ public class ConcurrentLoginTest extends AbstractConcurrencyTest { } private static Map getQueryFromUrl(String url) throws URISyntaxException { - return URLEncodedUtils.parse(new URI(url), "UTF-8").stream() + return URLEncodedUtils.parse(new URI(url), StandardCharsets.UTF_8).stream() .collect(Collectors.toMap(p -> p.getName(), p -> p.getValue())); } 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 19e3b7e730..5166ed4db7 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,14 +17,11 @@ package org.keycloak.testsuite.admin.event; import org.junit.Before; -import org.junit.Rule; import org.keycloak.admin.client.resource.RealmResource; import org.keycloak.representations.idm.RealmEventsConfigRepresentation; import org.keycloak.testsuite.AbstractAuthTest; -import org.keycloak.testsuite.util.TestCleanup; import java.util.Collections; -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/EmailEventListenerTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/event/EmailEventListenerTest.java index d71670551d..afdf7bf77e 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/event/EmailEventListenerTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/event/EmailEventListenerTest.java @@ -24,10 +24,8 @@ import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.keycloak.admin.client.resource.RealmResource; -import org.keycloak.common.Profile; import org.keycloak.events.email.EmailEventListenerProviderFactory; import org.keycloak.representations.idm.RealmRepresentation; -import org.keycloak.testsuite.arquillian.annotation.DisableFeature; import org.keycloak.testsuite.util.GreenMailRule; import org.keycloak.testsuite.util.UserBuilder; 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 44a01db55a..143f13a5ac 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 @@ -1135,9 +1135,9 @@ public class GroupTest extends AbstractGroupTest { assertEquals(0, noResultSearch.size()); // Count - assertEquals(new Long(allGroups.size()), realm.groups().count().get("count")); - assertEquals(new Long(search.size()), realm.groups().count("group1").get("count")); - assertEquals(new Long(noResultSearch.size()), realm.groups().count("abcd").get("count")); + assertEquals(Long.valueOf(allGroups.size()), realm.groups().count().get("count")); + assertEquals(Long.valueOf(search.size()), realm.groups().count("group1").get("count")); + assertEquals(Long.valueOf(noResultSearch.size()), realm.groups().count("abcd").get("count")); // Add a subgroup for onlyTopLevel flag testing GroupRepresentation level2Group = new GroupRepresentation(); @@ -1146,8 +1146,8 @@ public class GroupTest extends AbstractGroupTest { response.close(); assertAdminEvents.assertEvent(testRealmId, OperationType.CREATE, AdminEventPaths.groupSubgroupsPath(firstGroupId), level2Group, ResourceType.GROUP); - assertEquals(new Long(allGroups.size()), realm.groups().count(true).get("count")); - assertEquals(new Long(allGroups.size() + 1), realm.groups().count(false).get("count")); + assertEquals(Long.valueOf(allGroups.size()), realm.groups().count(true).get("count")); + assertEquals(Long.valueOf(allGroups.size() + 1), realm.groups().count(false).get("count")); //add another subgroup GroupRepresentation level2Group2 = new GroupRepresentation(); level2Group2.setName("group111111"); 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 4749331b43..23a6e367c0 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 @@ -76,6 +76,7 @@ import jakarta.ws.rs.BadRequestException; import jakarta.ws.rs.NotFoundException; import jakarta.ws.rs.core.Response; import java.io.IOException; +import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -641,7 +642,7 @@ public class RealmTest extends AbstractAdminTest { @Test public void convertOIDCClientDescription() throws IOException { - String description = IOUtils.toString(getClass().getResourceAsStream("/client-descriptions/client-oidc.json")); + String description = IOUtils.toString(getClass().getResourceAsStream("/client-descriptions/client-oidc.json"), Charset.defaultCharset()); ClientRepresentation converted = realm.convertClientDescription(description); assertEquals(1, converted.getRedirectUris().size()); @@ -650,7 +651,7 @@ public class RealmTest extends AbstractAdminTest { @Test public void convertSAMLClientDescription() throws IOException { - String description = IOUtils.toString(getClass().getResourceAsStream("/client-descriptions/saml-entity-descriptor.xml")); + String description = IOUtils.toString(getClass().getResourceAsStream("/client-descriptions/saml-entity-descriptor.xml"), Charset.defaultCharset()); ClientRepresentation converted = realm.convertClientDescription(description); assertEquals("loadbalancer-9.siroe.com", converted.getClientId()); diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/userprofile/UserProfileAdminTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/userprofile/UserProfileAdminTest.java index afc642351b..c3edca8fbb 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/userprofile/UserProfileAdminTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/userprofile/UserProfileAdminTest.java @@ -26,7 +26,6 @@ import static org.junit.Assert.assertTrue; import static org.keycloak.userprofile.DeclarativeUserProfileProvider.REALM_USER_PROFILE_ENABLED; import static org.keycloak.userprofile.config.UPConfigUtils.readDefaultConfig; -import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/AbstractAuthzTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/AbstractAuthzTest.java index f54c5a8aa5..a7837e1bd2 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/AbstractAuthzTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/AbstractAuthzTest.java @@ -1,13 +1,11 @@ package org.keycloak.testsuite.authz; import org.junit.BeforeClass; -import org.keycloak.common.Profile; import org.keycloak.jose.jws.JWSInput; import org.keycloak.jose.jws.JWSInputException; import org.keycloak.representations.AccessToken; import org.keycloak.testsuite.AbstractKeycloakTest; import org.keycloak.testsuite.ProfileAssume; -import org.keycloak.testsuite.arquillian.annotation.EnableFeature; import static org.keycloak.common.Profile.Feature.AUTHORIZATION; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/AuthzClientTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/AuthzClientTest.java index 8fd134f6c6..884f925f64 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/AuthzClientTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/AuthzClientTest.java @@ -2,11 +2,12 @@ package org.keycloak.testsuite.authz; import java.io.ByteArrayInputStream; +import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; +import org.junit.Assert; import org.junit.Rule; import org.junit.Test; import org.junit.contrib.java.lang.system.EnvironmentVariables; -import org.junit.rules.ExpectedException; import org.keycloak.authorization.client.AuthzClient; public class AuthzClientTest { @@ -14,30 +15,29 @@ public class AuthzClientTest { @Rule public final EnvironmentVariables envVars = new EnvironmentVariables(); - @Rule - public ExpectedException expectedException = ExpectedException.none(); - @Test public void testCreateWithEnvVars() { envVars.set("KEYCLOAK_REALM", "test"); envVars.set("KEYCLOAK_AUTH_SERVER", "http://test"); - expectedException.expect(RuntimeException.class); - expectedException.expectMessage(Matchers.containsString("Could not obtain configuration from server")); + RuntimeException runtimeException = Assert.assertThrows(RuntimeException.class, () -> { - AuthzClient.create(new ByteArrayInputStream(("{\n" - + " \"realm\": \"${env.KEYCLOAK_REALM}\",\n" - + " \"auth-server-url\": \"${env.KEYCLOAK_AUTH_SERVER}\",\n" - + " \"ssl-required\": \"external\",\n" - + " \"enable-cors\": true,\n" - + " \"resource\": \"my-server\",\n" - + " \"credentials\": {\n" - + " \"secret\": \"${env.KEYCLOAK_SECRET}\"\n" - + " },\n" - + " \"confidential-port\": 0,\n" - + " \"policy-enforcer\": {\n" - + " \"enforcement-mode\": \"ENFORCING\"\n" - + " }\n" - + "}").getBytes())); + AuthzClient.create(new ByteArrayInputStream(("{\n" + + " \"realm\": \"${env.KEYCLOAK_REALM}\",\n" + + " \"auth-server-url\": \"${env.KEYCLOAK_AUTH_SERVER}\",\n" + + " \"ssl-required\": \"external\",\n" + + " \"enable-cors\": true,\n" + + " \"resource\": \"my-server\",\n" + + " \"credentials\": {\n" + + " \"secret\": \"${env.KEYCLOAK_SECRET}\"\n" + + " },\n" + + " \"confidential-port\": 0,\n" + + " \"policy-enforcer\": {\n" + + " \"enforcement-mode\": \"ENFORCING\"\n" + + " }\n" + + "}").getBytes())); + }); + + MatcherAssert.assertThat(runtimeException.getMessage(), Matchers.containsString("Could not obtain configuration from server")); } } diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/EntitlementAPITest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/EntitlementAPITest.java index 902b94ad06..429329ee5b 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/EntitlementAPITest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/EntitlementAPITest.java @@ -24,7 +24,6 @@ import static org.junit.Assert.assertNull; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import static org.keycloak.testsuite.AssertEvents.isUUID; import jakarta.ws.rs.core.Response; import java.io.IOException; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/GroupNamePolicyTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/GroupNamePolicyTest.java index aab876d2cf..01db04a55d 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/GroupNamePolicyTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/GroupNamePolicyTest.java @@ -35,7 +35,6 @@ import org.keycloak.admin.client.resource.ClientsResource; import org.keycloak.admin.client.resource.RealmResource; import org.keycloak.authorization.client.AuthorizationDeniedException; import org.keycloak.authorization.client.AuthzClient; -import org.keycloak.authorization.model.Resource; import org.keycloak.protocol.oidc.OIDCLoginProtocol; import org.keycloak.protocol.oidc.mappers.GroupMembershipMapper; import org.keycloak.protocol.oidc.mappers.OIDCAttributeMapperHelper; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/PolicyEvaluationTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/PolicyEvaluationTest.java index 42f1e5ddda..1cab003b5f 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/PolicyEvaluationTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/PolicyEvaluationTest.java @@ -37,7 +37,6 @@ import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; import org.keycloak.models.UserModel; import org.keycloak.models.utils.KeycloakModelUtils; -import org.keycloak.models.utils.RepresentationToModel; import org.keycloak.protocol.oidc.OIDCLoginProtocol; import org.keycloak.protocol.oidc.mappers.GroupMembershipMapper; import org.keycloak.protocol.oidc.mappers.OIDCAttributeMapperHelper; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/ScriptCacheTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/ScriptCacheTest.java index 350396f154..2a562c4207 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/ScriptCacheTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/ScriptCacheTest.java @@ -21,13 +21,9 @@ import static java.util.concurrent.TimeUnit.MILLISECONDS; import static java.util.concurrent.locks.LockSupport.parkNanos; import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; -import java.util.concurrent.locks.LockSupport; -import java.util.function.BiConsumer; import javax.script.ScriptContext; import org.junit.Test; import org.keycloak.authorization.policy.provider.js.ScriptCache; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/UserManagedAccessTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/UserManagedAccessTest.java index d0dc6276e2..779daa6af2 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/UserManagedAccessTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/UserManagedAccessTest.java @@ -21,7 +21,6 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import static org.keycloak.testsuite.AssertEvents.isUUID; import java.util.Arrays; import java.util.ArrayList; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/UserManagedPermissionServiceTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/UserManagedPermissionServiceTest.java index 4fb14dcada..536026106a 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/UserManagedPermissionServiceTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/UserManagedPermissionServiceTest.java @@ -45,7 +45,6 @@ import org.keycloak.authorization.model.Policy; import org.keycloak.authorization.model.Resource; import org.keycloak.authorization.model.ResourceServer; import org.keycloak.authorization.store.PolicyStore; -import org.keycloak.common.Profile; import org.keycloak.models.ClientModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/adapter/example/AbstractBaseServletAuthzAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/adapter/example/AbstractBaseServletAuthzAdapterTest.java index b6094c5f70..4d9472a7d1 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/adapter/example/AbstractBaseServletAuthzAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/adapter/example/AbstractBaseServletAuthzAdapterTest.java @@ -19,7 +19,6 @@ package org.keycloak.testsuite.authz.adapter.example; import org.jboss.arquillian.container.test.api.Deployer; import org.jboss.arquillian.graphene.page.Page; import org.jboss.arquillian.test.api.ArquillianResource; -import org.junit.Before; import org.junit.BeforeClass; import org.keycloak.admin.client.resource.AuthorizationResource; import org.keycloak.admin.client.resource.ClientResource; @@ -31,7 +30,6 @@ import org.keycloak.representations.idm.authorization.ResourceServerRepresentati import org.keycloak.representations.idm.authorization.UserPolicyRepresentation; import org.keycloak.testsuite.ProfileAssume; import org.keycloak.testsuite.adapter.AbstractExampleAdapterTest; -import org.keycloak.testsuite.arquillian.annotation.EnableFeature; import org.keycloak.testsuite.pages.InfoPage; import org.keycloak.testsuite.pages.LogoutConfirmPage; import org.keycloak.testsuite.util.UIUtils; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/admin/GroupPolicyManagementTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/admin/GroupPolicyManagementTest.java index 08e7302ebe..12ce2fadbb 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/admin/GroupPolicyManagementTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/admin/GroupPolicyManagementTest.java @@ -18,7 +18,6 @@ package org.keycloak.testsuite.authz.admin; 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 static org.junit.Assert.fail; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/admin/ScopeManagementTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/admin/ScopeManagementTest.java index 3d3ff2c563..9880dab571 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/admin/ScopeManagementTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/authz/admin/ScopeManagementTest.java @@ -29,8 +29,6 @@ import jakarta.ws.rs.NotFoundException; import jakarta.ws.rs.core.Response; 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 java.util.List; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/AbstractAdvancedBrokerTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/AbstractAdvancedBrokerTest.java index 47537b1668..ce65202bad 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/AbstractAdvancedBrokerTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/AbstractAdvancedBrokerTest.java @@ -37,7 +37,6 @@ import jakarta.ws.rs.core.Response; import java.net.URI; import java.util.Arrays; import java.util.Collections; -import java.util.Objects; import java.util.Set; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/AbstractGroupMapperTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/AbstractGroupMapperTest.java index 63742fcde3..6714f9df57 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/AbstractGroupMapperTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/AbstractGroupMapperTest.java @@ -6,7 +6,6 @@ import static org.hamcrest.Matchers.empty; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.not; -import org.junit.Assert; import org.junit.Before; import org.keycloak.admin.client.CreatedResponseUtil; import org.keycloak.broker.provider.ConfigConstants; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/BrokerRunOnServerUtil.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/BrokerRunOnServerUtil.java index 21a5979792..683819e9b9 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/BrokerRunOnServerUtil.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/BrokerRunOnServerUtil.java @@ -18,8 +18,6 @@ package org.keycloak.testsuite.broker; import static org.junit.Assert.assertEquals; -import java.util.List; - import org.keycloak.authentication.authenticators.broker.IdpAutoLinkAuthenticatorFactory; import org.keycloak.authentication.authenticators.browser.OTPFormAuthenticatorFactory; import org.keycloak.authentication.authenticators.browser.PasswordFormFactory; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/BrokerWithLegacyIdTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/BrokerWithLegacyIdTest.java index e942390c7e..396a373cb7 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/BrokerWithLegacyIdTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/BrokerWithLegacyIdTest.java @@ -17,7 +17,6 @@ package org.keycloak.testsuite.broker; -import org.junit.Assert; import org.junit.Test; import org.keycloak.admin.client.resource.RealmResource; import org.keycloak.admin.client.resource.UserResource; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcOidcBrokerConfiguration.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcOidcBrokerConfiguration.java index a1da71c9de..963716d12a 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcOidcBrokerConfiguration.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcOidcBrokerConfiguration.java @@ -5,7 +5,6 @@ import org.keycloak.models.IdentityProviderModel; import org.keycloak.models.IdentityProviderSyncMode; import org.keycloak.protocol.ProtocolMapperUtils; import org.keycloak.protocol.oidc.OIDCAdvancedConfigWrapper; -import org.keycloak.protocol.oidc.OIDCConfigAttributes; import org.keycloak.protocol.oidc.OIDCLoginProtocol; import org.keycloak.protocol.oidc.mappers.HardcodedClaim; import org.keycloak.protocol.oidc.mappers.OIDCAttributeMapperHelper; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcOidcBrokerFrontendUrlTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcOidcBrokerFrontendUrlTest.java index 6461c5c628..bef5460c27 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcOidcBrokerFrontendUrlTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcOidcBrokerFrontendUrlTest.java @@ -17,7 +17,6 @@ import org.junit.Rule; import org.junit.Test; import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.representations.idm.RealmRepresentation; -import org.keycloak.testsuite.Assert; import org.keycloak.testsuite.util.ReverseProxy; public final class KcOidcBrokerFrontendUrlTest extends AbstractBrokerTest { diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcOidcBrokerJWETest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcOidcBrokerJWETest.java index 11e15e9a90..1e8c673e8e 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcOidcBrokerJWETest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcOidcBrokerJWETest.java @@ -23,7 +23,6 @@ import static org.junit.Assert.assertFalse; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.concurrent.TimeUnit; import java.util.function.Predicate; import com.google.common.collect.ImmutableMap; @@ -43,7 +42,6 @@ import org.keycloak.models.IdentityProviderMapperModel; import org.keycloak.models.IdentityProviderMapperSyncMode; import org.keycloak.models.utils.DefaultKeyProviders; import org.keycloak.protocol.ProtocolMapperUtils; -import org.keycloak.protocol.oidc.OIDCAdvancedConfigWrapper; import org.keycloak.protocol.oidc.OIDCConfigAttributes; import org.keycloak.protocol.oidc.OIDCLoginProtocol; import org.keycloak.protocol.oidc.mappers.HardcodedClaim; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcOidcBrokerLoginHintTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcOidcBrokerLoginHintTest.java index 3a181bbff8..fc274628b7 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcOidcBrokerLoginHintTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcOidcBrokerLoginHintTest.java @@ -3,8 +3,7 @@ package org.keycloak.testsuite.broker; import java.util.List; import java.util.Map; -import static junit.framework.Assert.assertTrue; -import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; 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.USER_EMAIL; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcOidcBrokerTransientSessionsTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcOidcBrokerTransientSessionsTest.java index 922d0615f8..389e63ee1e 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcOidcBrokerTransientSessionsTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcOidcBrokerTransientSessionsTest.java @@ -87,7 +87,6 @@ import static org.hamcrest.Matchers.notNullValue; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; -import static org.keycloak.testsuite.broker.BrokerTestConstants.CLIENT_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.BrokerTestTools.getConsumerRoot; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcSamlBrokerAllowedClockSkewTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcSamlBrokerAllowedClockSkewTest.java index 09ef30399c..7b89363c82 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcSamlBrokerAllowedClockSkewTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcSamlBrokerAllowedClockSkewTest.java @@ -19,7 +19,7 @@ package org.keycloak.testsuite.broker; import java.io.Closeable; import jakarta.ws.rs.core.Response; import org.hamcrest.Matchers; -import org.junit.Assert; + import static org.hamcrest.MatcherAssert.assertThat; import org.junit.Test; import org.keycloak.broker.saml.SAMLIdentityProviderConfig; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcSamlBrokerFrontendUrlTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcSamlBrokerFrontendUrlTest.java index 7a239e06f9..2a7eb489b9 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcSamlBrokerFrontendUrlTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcSamlBrokerFrontendUrlTest.java @@ -14,7 +14,6 @@ import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.saml.common.constants.JBossSAMLURIConstants; import org.keycloak.saml.processing.core.saml.v2.common.SAMLDocumentHolder; -import org.keycloak.testsuite.Assert; import org.keycloak.testsuite.AssertEvents; import org.keycloak.testsuite.util.Matchers; import org.keycloak.testsuite.util.ReverseProxy; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcSamlIdPInitiatedSsoTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcSamlIdPInitiatedSsoTest.java index 2824d9dd67..65c993b20d 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcSamlIdPInitiatedSsoTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcSamlIdPInitiatedSsoTest.java @@ -38,6 +38,7 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.net.URI; +import java.nio.charset.Charset; import java.util.List; import java.util.Map; import java.util.Properties; @@ -94,7 +95,7 @@ public class KcSamlIdPInitiatedSsoTest extends AbstractKeycloakTest { private RealmRepresentation loadFromClasspath(String fileName, Properties properties) { InputStream is = KcSamlIdPInitiatedSsoTest.class.getResourceAsStream(fileName); try { - String template = StreamUtil.readString(is); + String template = StreamUtil.readString(is, Charset.defaultCharset()); String realmString = StringPropertyReplacer.replaceProperties(template, properties); return IOUtil.loadRealm(new ByteArrayInputStream(realmString.getBytes("UTF-8"))); } catch (IOException ex) { diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcSamlRequestedAuthnContextBrokerTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcSamlRequestedAuthnContextBrokerTest.java index 70f6e16bf8..0973d3715b 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcSamlRequestedAuthnContextBrokerTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcSamlRequestedAuthnContextBrokerTest.java @@ -13,7 +13,6 @@ import org.keycloak.testsuite.util.SamlClientBuilder; import java.io.Closeable; import org.hamcrest.Matchers; -import org.junit.Assert; import org.junit.Test; import org.w3c.dom.Document; import org.w3c.dom.Element; 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 deff1140cd..bf65998d30 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 @@ -42,7 +42,6 @@ import javax.xml.namespace.QName; import org.apache.http.HttpResponse; import org.hamcrest.Matcher; import org.hamcrest.Matchers; -import org.junit.Assert; import org.junit.Test; import org.w3c.dom.DOMException; import org.w3c.dom.Document; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcSamlXPathAttributeMapperTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcSamlXPathAttributeMapperTest.java index 6f827c34a6..bb94eaeb41 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcSamlXPathAttributeMapperTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcSamlXPathAttributeMapperTest.java @@ -1,10 +1,8 @@ package org.keycloak.testsuite.broker; import com.google.common.collect.ImmutableMap; -import org.junit.Assert; import org.junit.Test; import org.keycloak.admin.client.resource.RealmResource; -import org.keycloak.broker.saml.mappers.UserAttributeMapper; import org.keycloak.broker.saml.mappers.XPathAttributeMapper; import org.keycloak.dom.saml.v2.protocol.AuthnRequestType; import org.keycloak.models.IdentityProviderMapperModel; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cli/AbstractCliTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cli/AbstractCliTest.java index 0cc912a45e..4850e3563b 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cli/AbstractCliTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cli/AbstractCliTest.java @@ -7,7 +7,6 @@ import org.keycloak.testsuite.AbstractKeycloakTest; import org.keycloak.testsuite.arquillian.AuthServerTestEnricher; import org.keycloak.testsuite.cli.exec.AbstractExec; -import java.io.File; import java.util.List; /** diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cli/admin/AbstractAdmCliTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cli/admin/AbstractAdmCliTest.java index cdcbd53c14..a9afe73139 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cli/admin/AbstractAdmCliTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cli/admin/AbstractAdmCliTest.java @@ -11,7 +11,6 @@ import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.representations.idm.UserRepresentation; import org.keycloak.testsuite.cli.AbstractCliTest; import org.keycloak.testsuite.cli.KcAdmExec; -import org.keycloak.testsuite.cli.KcRegExec; import org.keycloak.testsuite.util.ClientBuilder; import org.keycloak.testsuite.util.UserBuilder; import org.keycloak.util.JsonSerialization; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cli/registration/AbstractRegCliTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cli/registration/AbstractRegCliTest.java index 03b92ce976..30e5816a59 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cli/registration/AbstractRegCliTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cli/registration/AbstractRegCliTest.java @@ -2,7 +2,6 @@ package org.keycloak.testsuite.cli.registration; import org.junit.Assert; import org.junit.Before; -import org.keycloak.admin.client.Keycloak; import org.keycloak.admin.client.resource.ClientInitialAccessResource; import org.keycloak.admin.client.resource.RealmResource; import org.keycloak.authentication.authenticators.client.ClientIdAndSecretAuthenticator; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/AbstractFAPITest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/AbstractFAPITest.java index 90c4b6073c..1b5587ce3c 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/AbstractFAPITest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/AbstractFAPITest.java @@ -37,6 +37,7 @@ import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpPost; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.message.BasicNameValuePair; +import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.jboss.arquillian.graphene.page.Page; import org.junit.Assume; @@ -152,8 +153,8 @@ public abstract class AbstractFAPITest extends AbstractClientPoliciesTest { protected void assertSuccessfulTokenResponse(OAuthClient.AccessTokenResponse tokenResponse) { assertEquals(200, tokenResponse.getStatusCode()); - Assert.assertThat(tokenResponse.getIdToken(), Matchers.notNullValue()); - Assert.assertThat(tokenResponse.getAccessToken(), Matchers.notNullValue()); + MatcherAssert.assertThat(tokenResponse.getIdToken(), Matchers.notNullValue()); + MatcherAssert.assertThat(tokenResponse.getAccessToken(), Matchers.notNullValue()); // Scope parameter must be present per FAPI Assert.assertNotNull(tokenResponse.getScope()); diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/CIBATest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/CIBATest.java index d94586d44a..a6a19e6b00 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/CIBATest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/CIBATest.java @@ -17,6 +17,7 @@ package org.keycloak.testsuite.client; import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.emptyOrNullString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.containsString; @@ -2088,7 +2089,7 @@ public class CIBATest extends AbstractClientPoliciesTest { String cAppDynamicClientId = createClientDynamically(generateSuffixedName("App-in-Dynamic"), (OIDCClientRepresentation clientRep) -> { clientRep.setBackchannelAuthenticationRequestSigningAlg(org.keycloak.crypto.Algorithm.ES256); }); - events.expect(EventType.CLIENT_REGISTER).client(cAppDynamicClientId).user(org.hamcrest.Matchers.isEmptyOrNullString()).assertEvent(); + events.expect(EventType.CLIENT_REGISTER).client(cAppDynamicClientId).user(is(emptyOrNullString())).assertEvent(); // update dynamically - fail try { diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/FAPICIBATest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/FAPICIBATest.java index 3599fac9ed..e236759298 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/FAPICIBATest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/FAPICIBATest.java @@ -29,7 +29,6 @@ import static org.keycloak.protocol.oidc.grants.ciba.CibaGrantType.AUTH_REQ_ID; import static org.keycloak.protocol.oidc.grants.ciba.CibaGrantType.BINDING_MESSAGE; import static org.keycloak.protocol.oidc.grants.ciba.channel.AuthenticationChannelResponse.Status.SUCCEED; import static org.keycloak.protocol.oidc.grants.ciba.channel.AuthenticationChannelResponse.Status.CANCELLED; -import static org.keycloak.testsuite.admin.AbstractAdminTest.loadJson; import static org.keycloak.testsuite.util.ClientPoliciesUtil.createAnyClientConditionConfig; import java.io.IOException; @@ -38,7 +37,6 @@ import java.net.URISyntaxException; import java.security.KeyPair; import java.security.PrivateKey; import java.security.PublicKey; -import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.LinkedList; @@ -48,18 +46,13 @@ import java.util.Optional; import java.util.function.Supplier; import org.apache.http.NameValuePair; -import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.HttpPost; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.message.BasicNameValuePair; -import org.junit.Assume; -import org.junit.BeforeClass; import org.junit.Test; import org.keycloak.OAuth2Constants; import org.keycloak.OAuthErrorException; import org.keycloak.admin.client.resource.ClientResource; -import org.keycloak.admin.client.resource.UserResource; import org.keycloak.authentication.authenticators.client.ClientIdAndSecretAuthenticator; import org.keycloak.authentication.authenticators.client.JWTClientAuthenticator; import org.keycloak.authentication.authenticators.client.JWTClientSecretAuthenticator; @@ -67,9 +60,7 @@ import org.keycloak.authentication.authenticators.client.X509ClientAuthenticator import org.keycloak.common.util.Base64Url; import org.keycloak.common.util.Time; import org.keycloak.crypto.Algorithm; -import org.keycloak.models.AdminRoles; import org.keycloak.models.CibaConfig; -import org.keycloak.models.Constants; import org.keycloak.protocol.oidc.OIDCAdvancedConfigWrapper; import org.keycloak.protocol.oidc.OIDCConfigAttributes; import org.keycloak.protocol.oidc.OIDCLoginProtocol; @@ -78,28 +69,21 @@ import org.keycloak.representations.AccessToken; import org.keycloak.representations.IDToken; import org.keycloak.representations.RefreshToken; import org.keycloak.representations.idm.ClientRepresentation; -import org.keycloak.representations.idm.CredentialRepresentation; import org.keycloak.representations.idm.EventRepresentation; -import org.keycloak.representations.idm.RealmRepresentation; -import org.keycloak.representations.idm.UserRepresentation; import org.keycloak.services.Urls; import org.keycloak.services.clientpolicy.ClientPolicyException; import org.keycloak.services.clientpolicy.condition.AnyClientConditionFactory; import org.keycloak.testsuite.Assert; -import org.keycloak.testsuite.AssertEvents; -import org.keycloak.testsuite.admin.ApiUtil; import org.keycloak.testsuite.client.resources.TestApplicationResourceUrls; import org.keycloak.testsuite.client.resources.TestOIDCEndpointsApplicationResource; import org.keycloak.testsuite.rest.representation.TestAuthenticationChannelRequest; import org.keycloak.testsuite.rest.resource.TestingOIDCEndpointsApplicationResource.AuthorizationEndpointRequestObject; import org.keycloak.testsuite.util.MutualTLSUtils; import org.keycloak.testsuite.util.OAuthClient; -import org.keycloak.testsuite.util.ServerURLs; import org.keycloak.testsuite.util.ClientPoliciesUtil.ClientPoliciesBuilder; import org.keycloak.testsuite.util.ClientPoliciesUtil.ClientPolicyBuilder; import org.keycloak.testsuite.util.OAuthClient.AuthenticationRequestAcknowledgement; import org.keycloak.util.JsonSerialization; -import org.keycloak.testsuite.client.policies.AbstractClientPoliciesTest; /** * Test for the FAPI CIBA specifications (still implementer's draft): 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 87e5577f2d..0ae58d57ad 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 @@ -23,8 +23,6 @@ import org.junit.Test; import org.keycloak.admin.client.resource.ClientsResource; import org.keycloak.client.registration.Auth; import org.keycloak.client.registration.ClientRegistrationException; -import org.keycloak.client.registration.HttpErrorException; -import org.keycloak.events.Errors; import org.keycloak.protocol.saml.SamlConfigAttributes; import org.keycloak.protocol.saml.SamlProtocol; import org.keycloak.protocol.saml.mappers.AttributeStatementHelper; @@ -35,17 +33,16 @@ import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.representations.idm.ProtocolMapperRepresentation; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.representations.idm.RoleRepresentation; -import org.keycloak.saml.common.constants.JBossSAMLURIConstants; import org.keycloak.testsuite.Assert; import org.keycloak.testsuite.util.KeycloakModelUtils; import java.io.IOException; +import java.nio.charset.Charset; import java.util.Arrays; import java.util.List; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; -import static org.junit.Assert.assertTrue; import static org.keycloak.testsuite.auth.page.AuthRealm.TEST; /** @@ -74,7 +71,7 @@ public class SAMLClientRegistrationTest extends AbstractClientRegistrationTest { @Test public void createClient() throws ClientRegistrationException, IOException { - String entityDescriptor = IOUtils.toString(getClass().getResourceAsStream("/clientreg-test/saml-entity-descriptor.xml")); + String entityDescriptor = IOUtils.toString(getClass().getResourceAsStream("/clientreg-test/saml-entity-descriptor.xml"), Charset.defaultCharset()); assertClientCreation(entityDescriptor); } @@ -92,7 +89,7 @@ public class SAMLClientRegistrationTest extends AbstractClientRegistrationTest { String accessToken = oauth.clientId("oidc-client").doClientCredentialsGrantAccessTokenRequest("secret").getAccessToken(); reg.auth(Auth.token(accessToken)); - String entityDescriptor = IOUtils.toString(getClass().getResourceAsStream("/clientreg-test/saml-entity-descriptor.xml")); + String entityDescriptor = IOUtils.toString(getClass().getResourceAsStream("/clientreg-test/saml-entity-descriptor.xml"), Charset.defaultCharset()); assertClientCreation(entityDescriptor); } diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/policies/ClientPoliciesExecutorTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/policies/ClientPoliciesExecutorTest.java index 415a8ede58..582ba43ce5 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/policies/ClientPoliciesExecutorTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/policies/ClientPoliciesExecutorTest.java @@ -17,6 +17,8 @@ package org.keycloak.testsuite.client.policies; +import static org.hamcrest.Matchers.emptyOrNullString; +import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; @@ -948,7 +950,7 @@ public class ClientPoliciesExecutorTest extends AbstractClientPoliciesTest { clientRep.setIdTokenSignedResponseAlg(Algorithm.PS256); clientRep.setTokenEndpointAuthSigningAlg(Algorithm.PS256); }); - events.expect(EventType.CLIENT_REGISTER).client(cAppDynamicClientId).user(Matchers.isEmptyOrNullString()).assertEvent(); + events.expect(EventType.CLIENT_REGISTER).client(cAppDynamicClientId).user(is(emptyOrNullString())).assertEvent(); // update dynamically - fail try { diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/policies/ClientPoliciesExtendedEventTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/policies/ClientPoliciesExtendedEventTest.java index 3aac533972..70ac36ad69 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/policies/ClientPoliciesExtendedEventTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/policies/ClientPoliciesExtendedEventTest.java @@ -65,7 +65,6 @@ import org.keycloak.testsuite.pages.ErrorPage; import org.keycloak.testsuite.pages.LogoutConfirmPage; import org.keycloak.testsuite.pages.OAuth2DeviceVerificationPage; import org.keycloak.testsuite.pages.OAuthGrantPage; -import org.keycloak.testsuite.services.clientpolicy.executor.TestEnhancedPluggableTokenManagerExecutor; import org.keycloak.testsuite.services.clientpolicy.executor.TestEnhancedPluggableTokenManagerExecutorFactory; import org.keycloak.testsuite.services.clientpolicy.executor.TestRaiseExceptionExecutorFactory; import org.keycloak.testsuite.util.ClientBuilder; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/policies/ClientPoliciesTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/policies/ClientPoliciesTest.java index df6dff43c0..ff76004038 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/policies/ClientPoliciesTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/client/policies/ClientPoliciesTest.java @@ -18,6 +18,7 @@ package org.keycloak.testsuite.client.policies; import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.emptyOrNullString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.is; @@ -108,7 +109,6 @@ import org.keycloak.services.clientpolicy.executor.RejectImplicitGrantExecutorFa import org.keycloak.services.clientpolicy.executor.RejectRequestExecutorFactory; import org.keycloak.services.clientpolicy.executor.RejectResourceOwnerPasswordCredentialsGrantExecutorFactory; import org.keycloak.services.clientpolicy.executor.SecureClientAuthenticatorExecutorFactory; -import org.keycloak.services.clientpolicy.executor.SecureParContentsExecutorFactory; import org.keycloak.services.clientpolicy.executor.SecureSessionEnforceExecutorFactory; import org.keycloak.services.clientpolicy.executor.SecureSigningAlgorithmForSignedJwtExecutorFactory; import org.keycloak.testsuite.arquillian.annotation.EnableFeature; @@ -120,7 +120,6 @@ import org.keycloak.testsuite.util.ClientPoliciesUtil.ClientPoliciesBuilder; import org.keycloak.testsuite.util.ClientPoliciesUtil.ClientPolicyBuilder; import org.keycloak.testsuite.util.ClientPoliciesUtil.ClientProfileBuilder; import org.keycloak.testsuite.util.ClientPoliciesUtil.ClientProfilesBuilder; -import org.keycloak.testsuite.util.OAuthClient.ParResponse; import org.keycloak.testsuite.util.OAuthClient; import org.keycloak.testsuite.util.RoleBuilder; import org.keycloak.testsuite.util.ServerURLs; @@ -249,8 +248,8 @@ public class ClientPoliciesTest extends AbstractClientPoliciesTest { }); OIDCClientRepresentation clientRep = getClientDynamically(clientId); assertEquals(OIDCLoginProtocol.CLIENT_SECRET_BASIC, clientRep.getTokenEndpointAuthMethod()); - events.expect(EventType.CLIENT_REGISTER).client(clientId).user(Matchers.isEmptyOrNullString()).assertEvent(); - events.expect(EventType.CLIENT_INFO).client(clientId).user(Matchers.isEmptyOrNullString()).assertEvent(); + events.expect(EventType.CLIENT_REGISTER).client(clientId).user(is(emptyOrNullString())).assertEvent(); + events.expect(EventType.CLIENT_INFO).client(clientId).user(is(emptyOrNullString())).assertEvent(); adminClient.realm(REALM_NAME).clients().get(clientId).roles().create(RoleBuilder.create().name(SAMPLE_CLIENT_ROLE).build()); successfulLoginAndLogout(clientId, clientRep.getClientSecret()); @@ -388,12 +387,12 @@ public class ClientPoliciesTest extends AbstractClientPoliciesTest { String clientName = generateSuffixedName(CLIENT_NAME); String clientId = createClientDynamically(clientName, (OIDCClientRepresentation clientRep) -> { }); - events.expect(EventType.CLIENT_REGISTER).client(clientId).user(Matchers.isEmptyOrNullString()).assertEvent(); + events.expect(EventType.CLIENT_REGISTER).client(clientId).user(is(emptyOrNullString())).assertEvent(); OIDCClientRepresentation response = getClientDynamically(clientId); String clientSecret = response.getClientSecret(); assertEquals(clientName, response.getClientName()); assertEquals(OIDCLoginProtocol.CLIENT_SECRET_BASIC, response.getTokenEndpointAuthMethod()); - events.expect(EventType.CLIENT_INFO).client(clientId).user(Matchers.isEmptyOrNullString()).assertEvent(); + events.expect(EventType.CLIENT_INFO).client(clientId).user(is(emptyOrNullString())).assertEvent(); adminClient.realm(REALM_NAME).clients().get(clientId).roles().create(RoleBuilder.create().name(SAMPLE_CLIENT_ROLE).build()); diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cluster/AbstractFailoverClusterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cluster/AbstractFailoverClusterTest.java index 7da32d1a98..fe955bbb07 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cluster/AbstractFailoverClusterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cluster/AbstractFailoverClusterTest.java @@ -23,7 +23,6 @@ import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; -import org.keycloak.OAuth2Constants; import org.keycloak.models.UserModel; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.representations.idm.UserRepresentation; @@ -38,7 +37,6 @@ import org.keycloak.testsuite.util.URLUtils; import org.keycloak.testsuite.util.UserBuilder; import org.openqa.selenium.Cookie; -import static org.hamcrest.Matchers.is; 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/crossdc/ActionTokenCrossDCTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/crossdc/ActionTokenCrossDCTest.java index 6247c1194b..7590f52c61 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/crossdc/ActionTokenCrossDCTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/crossdc/ActionTokenCrossDCTest.java @@ -17,9 +17,7 @@ package org.keycloak.testsuite.crossdc; import org.junit.Ignore; -import org.keycloak.admin.client.Keycloak; import org.keycloak.admin.client.resource.UserResource; -import org.keycloak.common.Profile; import org.keycloak.common.util.Retry; import org.keycloak.connections.infinispan.InfinispanConnectionProvider; import org.keycloak.models.UserModel; @@ -38,7 +36,6 @@ import jakarta.mail.internet.MimeMessage; import jakarta.ws.rs.core.Response; import org.jboss.arquillian.graphene.page.Page; import org.junit.Assert; -import org.junit.Assume; import org.junit.Rule; import org.junit.Test; import static org.junit.Assert.assertEquals; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/crossdc/InvalidationCrossDCTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/crossdc/InvalidationCrossDCTest.java index 644c01694c..2e8d9f37c2 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/crossdc/InvalidationCrossDCTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/crossdc/InvalidationCrossDCTest.java @@ -22,7 +22,6 @@ import java.util.concurrent.atomic.AtomicInteger; import jakarta.ws.rs.core.Response; -import org.junit.BeforeClass; import org.junit.Test; import org.keycloak.admin.client.resource.ClientResource; import org.keycloak.admin.client.resource.ResourcesResource; 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 bc9c4f8769..3935f16615 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 @@ -50,8 +50,6 @@ import org.keycloak.testsuite.runonserver.RunHelpers; import org.keycloak.testsuite.util.JsonTestUtils; import org.keycloak.testsuite.util.UserBuilder; import org.keycloak.userprofile.DeclarativeUserProfileProvider; -import org.keycloak.util.JsonSerialization; -import org.keycloak.utils.JsonUtils; import java.io.File; import java.io.IOException; 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 69e7043476..9b9fd05e02 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 @@ -169,7 +169,7 @@ public class ExportImportUtil { UserRepresentation wburke = findByUsername(realmRsc, "wburke"); // user with creation timestamp in import - Assert.assertEquals(new Long(123654), wburke.getCreatedTimestamp()); + Assert.assertEquals(Long.valueOf(123654), wburke.getCreatedTimestamp()); allRoles = allRoles(realmRsc, wburke); Assert.assertEquals(2, allRoles.size()); Assert.assertFalse(containsRole(allRoles, findRealmRole(realmRsc, "admin"))); @@ -182,7 +182,7 @@ public class ExportImportUtil { UserRepresentation loginclient = findByUsername(realmRsc, "loginclient"); // user with creation timestamp as string in import - Assert.assertEquals(new Long(123655), loginclient.getCreatedTimestamp()); + Assert.assertEquals(Long.valueOf(123655), loginclient.getCreatedTimestamp()); UserRepresentation hashedPasswordUser = findByUsername(realmRsc, "hashedpassworduser"); CredentialRepresentation password = realmRsc.users().get(hashedPasswordUser.getId()).credentials().stream() diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/kerberos/AbstractKerberosTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/kerberos/AbstractKerberosTest.java index 63ab22b866..1df9b27d65 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/kerberos/AbstractKerberosTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/kerberos/AbstractKerberosTest.java @@ -21,6 +21,7 @@ import static org.keycloak.testsuite.admin.AbstractAdminTest.loadJson; import static org.keycloak.testsuite.auth.page.AuthRealm.TEST; import java.net.URI; +import java.nio.charset.StandardCharsets; import java.util.Hashtable; import java.util.List; import java.util.Map; @@ -319,7 +320,7 @@ public abstract class AbstractKerberosTest extends AbstractAuthTest { protected OAuthClient.AccessTokenResponse assertAuthenticationSuccess(String codeUrl) throws Exception { - List pairs = URLEncodedUtils.parse(new URI(codeUrl), "UTF-8"); + List pairs = URLEncodedUtils.parse(new URI(codeUrl), StandardCharsets.UTF_8); String code = null; String state = null; for (NameValuePair pair : pairs) { diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/kerberos/KeycloakSPNegoSchemeFactory.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/kerberos/KeycloakSPNegoSchemeFactory.java index db6c9aac3e..00a722b456 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/kerberos/KeycloakSPNegoSchemeFactory.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/kerberos/KeycloakSPNegoSchemeFactory.java @@ -32,7 +32,6 @@ import org.keycloak.federation.kerberos.CommonKerberosConfig; import org.keycloak.federation.kerberos.impl.KerberosUsernamePasswordAuthenticator; import javax.security.auth.Subject; -import javax.security.auth.login.LoginException; import java.security.PrivilegedExceptionAction; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPAccountRestApiTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPAccountRestApiTest.java index 01adb76afe..d375c05893 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPAccountRestApiTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPAccountRestApiTest.java @@ -187,7 +187,7 @@ public class LDAPAccountRestApiTest extends AbstractLDAPTest { // Password won't have createdDate and any metadata set Assert.assertEquals(PasswordCredentialModel.TYPE, userPassword.getType()); - Assert.assertEquals(userPassword.getCreatedDate(), new Long(-1L)); + Assert.assertEquals(userPassword.getCreatedDate(), Long.valueOf(-1L)); Assert.assertNull(userPassword.getCredentialData()); Assert.assertNull(userPassword.getSecretData()); } diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPBinaryAttributesTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPBinaryAttributesTest.java index 59221c20af..b7ebe8bd01 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPBinaryAttributesTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPBinaryAttributesTest.java @@ -41,7 +41,6 @@ import org.keycloak.testsuite.client.KeycloakTestingClient; import org.keycloak.testsuite.util.LDAPRule; import org.keycloak.testsuite.util.LDAPTestUtils; -import jakarta.ws.rs.ClientErrorException; import jakarta.ws.rs.core.Response; import java.util.Arrays; import java.util.Collections; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPGroupMapper2WaySyncTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPGroupMapper2WaySyncTest.java index 796109f0da..e7779234f0 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPGroupMapper2WaySyncTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPGroupMapper2WaySyncTest.java @@ -105,7 +105,7 @@ public class LDAPGroupMapper2WaySyncTest extends AbstractLDAPTest { LDAPStorageProvider ldapProvider = LDAPTestUtils.getLdapProvider(session, ctx.getLdapModel()); // Update group mapper to skip preserve inheritance and check it will pass now - LDAPTestUtils.updateGroupMapperConfigOptions(mapperModel, GroupMapperConfig.PRESERVE_GROUP_INHERITANCE, "false"); + LDAPTestUtils.updateConfigOptions(mapperModel, GroupMapperConfig.PRESERVE_GROUP_INHERITANCE, "false"); realm.updateComponent(mapperModel); // Sync from Keycloak into LDAP @@ -172,8 +172,8 @@ public class LDAPGroupMapper2WaySyncTest extends AbstractLDAPTest { LDAPStorageProvider ldapProvider = LDAPTestUtils.getLdapProvider(session, ctx.getLdapModel()); // Update group mapper to skip preserve inheritance and check it will pass now - LDAPTestUtils.updateGroupMapperConfigOptions(mapperModel, GroupMapperConfig.PRESERVE_GROUP_INHERITANCE, "true"); - LDAPTestUtils.updateGroupMapperConfigOptions(mapperModel, GroupMapperConfig.DROP_NON_EXISTING_GROUPS_DURING_SYNC, "false"); + LDAPTestUtils.updateConfigOptions(mapperModel, GroupMapperConfig.PRESERVE_GROUP_INHERITANCE, "true"); + LDAPTestUtils.updateConfigOptions(mapperModel, GroupMapperConfig.DROP_NON_EXISTING_GROUPS_DURING_SYNC, "false"); realm.updateComponent(mapperModel); // Sync from Keycloak into LDAP @@ -241,7 +241,7 @@ public class LDAPGroupMapper2WaySyncTest extends AbstractLDAPTest { Assert.assertNotNull(LDAPTestUtils.getGroupMapper(mapperModel, ctx.getLdapProvider(), realm).loadLDAPGroupByName("group3")); // Change config to drop non-existing groups - LDAPTestUtils.updateGroupMapperConfigOptions(mapperModel, GroupMapperConfig.DROP_NON_EXISTING_GROUPS_DURING_SYNC, "true"); + LDAPTestUtils.updateConfigOptions(mapperModel, GroupMapperConfig.DROP_NON_EXISTING_GROUPS_DURING_SYNC, "true"); realm.updateComponent(mapperModel); // Sync and assert group removed from LDAP diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPGroupMapperSyncTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPGroupMapperSyncTest.java index daaae5517c..2ae482cdcc 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPGroupMapperSyncTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPGroupMapperSyncTest.java @@ -137,7 +137,7 @@ public class LDAPGroupMapperSyncTest extends AbstractLDAPTest { testingClient.server().run(session -> { LDAPTestContext ctx = LDAPTestContext.init(session); ComponentModel mapperModel = LDAPTestUtils.getSubcomponentByName(ctx.getRealm(), ctx.getLdapModel(), "groupsMapper"); - LDAPTestUtils.updateGroupMapperConfigOptions(mapperModel, GroupMapperConfig.PRESERVE_GROUP_INHERITANCE, "false"); + LDAPTestUtils.updateConfigOptions(mapperModel, GroupMapperConfig.PRESERVE_GROUP_INHERITANCE, "false"); ctx.getRealm().updateComponent(mapperModel); }); @@ -183,7 +183,7 @@ public class LDAPGroupMapperSyncTest extends AbstractLDAPTest { testingClient.server().run(session -> { LDAPTestContext ctx = LDAPTestContext.init(session); ComponentModel mapperModel = LDAPTestUtils.getSubcomponentByName(ctx.getRealm(), ctx.getLdapModel(), "groupsMapper"); - LDAPTestUtils.updateGroupMapperConfigOptions(mapperModel, GroupMapperConfig.PRESERVE_GROUP_INHERITANCE, "true"); + LDAPTestUtils.updateConfigOptions(mapperModel, GroupMapperConfig.PRESERVE_GROUP_INHERITANCE, "true"); ctx.getRealm().updateComponent(mapperModel); }); @@ -312,7 +312,7 @@ public class LDAPGroupMapperSyncTest extends AbstractLDAPTest { Assert.assertNotNull(KeycloakModelUtils.findGroupByPath(session, realm, "/group1/model2")); // Update group mapper to drop non-existing groups during sync - LDAPTestUtils.updateGroupMapperConfigOptions(mapperModel, GroupMapperConfig.DROP_NON_EXISTING_GROUPS_DURING_SYNC, "true"); + LDAPTestUtils.updateConfigOptions(mapperModel, GroupMapperConfig.DROP_NON_EXISTING_GROUPS_DURING_SYNC, "true"); realm.updateComponent(mapperModel); // Sync groups again from LDAP. Assert LDAP non-existing groups deleted @@ -335,7 +335,7 @@ public class LDAPGroupMapperSyncTest extends AbstractLDAPTest { testingClient.server().run(session -> { LDAPTestContext ctx = LDAPTestContext.init(session); ComponentModel mapperModel = LDAPTestUtils.getSubcomponentByName(ctx.getRealm(), ctx.getLdapModel(), "groupsMapper"); - LDAPTestUtils.updateGroupMapperConfigOptions(mapperModel, GroupMapperConfig.PRESERVE_GROUP_INHERITANCE, "false"); + LDAPTestUtils.updateConfigOptions(mapperModel, GroupMapperConfig.PRESERVE_GROUP_INHERITANCE, "false"); ctx.getRealm().updateComponent(mapperModel); }); @@ -387,7 +387,7 @@ public class LDAPGroupMapperSyncTest extends AbstractLDAPTest { testingClient.server().run(session -> { LDAPTestContext ctx = LDAPTestContext.init(session); ComponentModel mapperModel = LDAPTestUtils.getSubcomponentByName(ctx.getRealm(), ctx.getLdapModel(), "groupsMapper"); - LDAPTestUtils.updateGroupMapperConfigOptions(mapperModel, GroupMapperConfig.PRESERVE_GROUP_INHERITANCE, "true"); + LDAPTestUtils.updateConfigOptions(mapperModel, GroupMapperConfig.PRESERVE_GROUP_INHERITANCE, "true"); ctx.getRealm().updateComponent(mapperModel); }); @@ -427,7 +427,7 @@ public class LDAPGroupMapperSyncTest extends AbstractLDAPTest { // Set group mapper to skip preservation of inheritance to test group creation ComponentModel mapperModel = LDAPTestUtils.getSubcomponentByName(ctx.getRealm(), ctx.getLdapModel(), "groupsMapper"); - LDAPTestUtils.updateGroupMapperConfigOptions(mapperModel, GroupMapperConfig.PRESERVE_GROUP_INHERITANCE, "false"); + LDAPTestUtils.updateConfigOptions(mapperModel, GroupMapperConfig.PRESERVE_GROUP_INHERITANCE, "false"); ctx.getRealm().updateComponent(mapperModel); }); @@ -449,7 +449,7 @@ public class LDAPGroupMapperSyncTest extends AbstractLDAPTest { * created groups, existing as the result of (N-1)-th iteration are "just" updated. * Also see NOTE: and the subsequent for loop, commented out, below for details. */ - Long elapsedTime = new Long(0); + Long elapsedTime = Long.valueOf(0); for (int i = 1; i <= GROUPS_COUNT; i++) { LDAPTestUtils.createLDAPGroup(session, appRealm, diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPGroupMapperSyncWithGroupsPathTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPGroupMapperSyncWithGroupsPathTest.java index a38f3d8a1c..82def01da1 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPGroupMapperSyncWithGroupsPathTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPGroupMapperSyncWithGroupsPathTest.java @@ -198,7 +198,7 @@ public class LDAPGroupMapperSyncWithGroupsPathTest extends AbstractLDAPTest { Assert.assertNotNull(KeycloakModelUtils.findGroupByPath(session, realm, "/outside")); // Update group mapper to drop non-existing groups during sync - LDAPTestUtils.updateGroupMapperConfigOptions(mapperModel, GroupMapperConfig.DROP_NON_EXISTING_GROUPS_DURING_SYNC, "true"); + LDAPTestUtils.updateConfigOptions(mapperModel, GroupMapperConfig.DROP_NON_EXISTING_GROUPS_DURING_SYNC, "true"); realm.updateComponent(mapperModel); // Sync groups again from LDAP. Assert LDAP non-existing groups deleted diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPGroupMapperTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPGroupMapperTest.java index b1a53daff1..0f10510026 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPGroupMapperTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPGroupMapperTest.java @@ -85,7 +85,7 @@ public class LDAPGroupMapperTest extends AbstractLDAPTest { RealmModel appRealm = ctx.getRealm(); ComponentModel mapperModel = LDAPTestUtils.getSubcomponentByName(appRealm, ctx.getLdapModel(), "groupsMapper"); - LDAPTestUtils.updateGroupMapperConfigOptions(mapperModel, GroupMapperConfig.MODE, LDAPGroupMapperMode.LDAP_ONLY.toString()); + LDAPTestUtils.updateConfigOptions(mapperModel, GroupMapperConfig.MODE, LDAPGroupMapperMode.LDAP_ONLY.toString()); appRealm.updateComponent(mapperModel); UserModel john = session.users().getUserByUsername(appRealm, "johnkeycloak"); @@ -221,7 +221,7 @@ public class LDAPGroupMapperTest extends AbstractLDAPTest { RealmModel appRealm = ctx.getRealm(); ComponentModel mapperModel = LDAPTestUtils.getSubcomponentByName(appRealm, ctx.getLdapModel(), "groupsMapper"); - LDAPTestUtils.updateGroupMapperConfigOptions(mapperModel, GroupMapperConfig.MODE, LDAPGroupMapperMode.READ_ONLY.toString()); + LDAPTestUtils.updateConfigOptions(mapperModel, GroupMapperConfig.MODE, LDAPGroupMapperMode.READ_ONLY.toString()); appRealm.updateComponent(mapperModel); GroupModel group1 = KeycloakModelUtils.findGroupByPath(session, appRealm, "/group1"); @@ -402,7 +402,7 @@ public class LDAPGroupMapperTest extends AbstractLDAPTest { RealmModel appRealm = ctx.getRealm(); ComponentModel mapperModel = LDAPTestUtils.getSubcomponentByName(appRealm, ctx.getLdapModel(), "groupsMapper"); - LDAPTestUtils.updateGroupMapperConfigOptions(mapperModel, GroupMapperConfig.MODE, LDAPGroupMapperMode.IMPORT.toString()); + LDAPTestUtils.updateConfigOptions(mapperModel, GroupMapperConfig.MODE, LDAPGroupMapperMode.IMPORT.toString()); appRealm.updateComponent(mapperModel); // Add some group mappings directly in LDAP @@ -486,7 +486,7 @@ public class LDAPGroupMapperTest extends AbstractLDAPTest { RealmModel appRealm = ctx.getRealm(); ComponentModel mapperModel = LDAPTestUtils.getSubcomponentByName(appRealm, ctx.getLdapModel(), "groupsMapper"); - LDAPTestUtils.updateGroupMapperConfigOptions(mapperModel, GroupMapperConfig.MODE, LDAPGroupMapperMode.LDAP_ONLY.toString()); + LDAPTestUtils.updateConfigOptions(mapperModel, GroupMapperConfig.MODE, LDAPGroupMapperMode.LDAP_ONLY.toString()); appRealm.updateComponent(mapperModel); // Ignoring this test on ActiveDirectory as it's not allowed to have LDAP group referencing nonexistent member. KEYCLOAK-2682 was related to OpenLDAP TODO: Better solution than programmatic... @@ -551,7 +551,7 @@ public class LDAPGroupMapperTest extends AbstractLDAPTest { LDAPTestUtils.updateLDAPPassword(ctx.getLdapProvider(), carlos, "Password1"); // Update group mapper - LDAPTestUtils.updateGroupMapperConfigOptions(mapperModel, + LDAPTestUtils.updateConfigOptions(mapperModel, GroupMapperConfig.USER_ROLES_RETRIEVE_STRATEGY, GroupMapperConfig.GET_GROUPS_FROM_USER_MEMBEROF_ATTRIBUTE, GroupMapperConfig.MEMBEROF_LDAP_ATTRIBUTE, LDAPConstants.STREET); appRealm.updateComponent(mapperModel); @@ -665,7 +665,7 @@ public class LDAPGroupMapperTest extends AbstractLDAPTest { RealmModel appRealm = ctx.getRealm(); ComponentModel mapperModel = LDAPTestUtils.getSubcomponentByName(appRealm, ctx.getLdapModel(), "groupsMapper"); - LDAPTestUtils.updateGroupMapperConfigOptions(mapperModel, GroupMapperConfig.MODE, LDAPGroupMapperMode.IMPORT.toString()); + LDAPTestUtils.updateConfigOptions(mapperModel, GroupMapperConfig.MODE, LDAPGroupMapperMode.IMPORT.toString()); appRealm.updateComponent(mapperModel); UserModel david = session.users().addUser(appRealm, "davidkeycloak"); @@ -713,7 +713,7 @@ public class LDAPGroupMapperTest extends AbstractLDAPTest { RealmModel appRealm = ctx.getRealm(); ComponentModel mapperModel = LDAPTestUtils.getSubcomponentByName(appRealm, ctx.getLdapModel(), "groupsMapper"); - LDAPTestUtils.updateGroupMapperConfigOptions(mapperModel, GroupMapperConfig.MODE, LDAPGroupMapperMode.LDAP_ONLY.toString()); + LDAPTestUtils.updateConfigOptions(mapperModel, GroupMapperConfig.MODE, LDAPGroupMapperMode.LDAP_ONLY.toString()); appRealm.updateComponent(mapperModel); // Ignoring this test on ActiveDirectory and rhds as it's currently impossible to import more than 60 users without timeout diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPMSADMapperTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPMSADMapperTest.java index a691aafdfb..764c97df3d 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPMSADMapperTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPMSADMapperTest.java @@ -43,7 +43,6 @@ import org.keycloak.testsuite.util.LDAPRule; import org.keycloak.testsuite.util.LDAPTestConfiguration; import org.keycloak.testsuite.util.LDAPTestUtils; -import static org.junit.Assert.assertFalse; import static org.hamcrest.MatcherAssert.assertThat; /** diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPNoCacheTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPNoCacheTest.java index 259d47f5e1..08aaec56b8 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPNoCacheTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPNoCacheTest.java @@ -37,7 +37,6 @@ import org.keycloak.models.LDAPConstants; import org.keycloak.models.RealmModel; import org.keycloak.models.UserModel; import org.keycloak.models.UserProvider; -import org.keycloak.representations.idm.UserRepresentation; import org.keycloak.storage.UserStoragePrivateUtil; import org.keycloak.storage.UserStorageProviderModel; import org.keycloak.storage.ldap.LDAPStorageProvider; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPProvidersIntegrationTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPProvidersIntegrationTest.java index ab8f0887bd..9cd62a31ee 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPProvidersIntegrationTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPProvidersIntegrationTest.java @@ -1046,7 +1046,7 @@ public class LDAPProvidersIntegrationTest extends AbstractLDAPTest { LDAPTestAsserts.assertUserImported(UserStoragePrivateUtil.userLocalStorage(session), appRealm, "username11", "John11", "Doel11", "user11@email.org", "124"); // search by a string that has special characters. Should succeed with an empty set, but no exceptions. - Assert.assertEquals(0, session.users().searchForUserStream(appRealm, "John)").count()); + Assert.assertEquals(0, session.users().searchForUserStream(appRealm, Map.of(UserModel.SEARCH,"John)")).count()); }); } diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPReadOnlyTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPReadOnlyTest.java index b9586d1d1b..dcf6771b84 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPReadOnlyTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPReadOnlyTest.java @@ -31,12 +31,10 @@ import org.keycloak.common.Profile; import org.keycloak.models.AuthenticationExecutionModel; import org.keycloak.models.LDAPConstants; import org.keycloak.models.RealmModel; -import org.keycloak.models.UserCredentialModel; import org.keycloak.models.UserModel; import org.keycloak.models.credential.OTPCredentialModel; import org.keycloak.models.utils.TimeBasedOTP; import org.keycloak.representations.idm.UserRepresentation; -import org.keycloak.storage.ReadOnlyException; import org.keycloak.storage.StorageId; import org.keycloak.storage.UserStorageProvider; import org.keycloak.storage.ldap.LDAPStorageProvider; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPRoleMapperTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPRoleMapperTest.java index c1aa6e7147..7002493f09 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPRoleMapperTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPRoleMapperTest.java @@ -102,7 +102,7 @@ public class LDAPRoleMapperTest extends AbstractLDAPTest { try { ComponentModel mapperModel = LDAPTestUtils.getSubcomponentByName(appRealm, ctx.getLdapModel(), "rolesMapper"); - LDAPTestUtils.updateGroupMapperConfigOptions(mapperModel, + LDAPTestUtils.updateConfigOptions(mapperModel, RoleMapperConfig.USE_REALM_ROLES_MAPPING, "false", RoleMapperConfig.CLIENT_ID, rolesClient.getClientId()); appRealm.updateComponent(mapperModel); @@ -155,7 +155,7 @@ public class LDAPRoleMapperTest extends AbstractLDAPTest { try { ComponentModel mapperModel = LDAPTestUtils.getSubcomponentByName(appRealm, ctx.getLdapModel(), "rolesMapper"); - LDAPTestUtils.updateGroupMapperConfigOptions(mapperModel, + LDAPTestUtils.updateConfigOptions(mapperModel, RoleMapperConfig.USE_REALM_ROLES_MAPPING, "false", RoleMapperConfig.CLIENT_ID, clientId); appRealm.updateComponent(mapperModel); diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPRoleMappingsTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPRoleMappingsTest.java index 44c4dfb9b1..530f9991ad 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPRoleMappingsTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPRoleMappingsTest.java @@ -446,7 +446,7 @@ public class LDAPRoleMappingsTest extends AbstractLDAPTest { LDAPTestUtils.updateLDAPPassword(ctx.getLdapProvider(), carlos, "Password1"); // Update group mapper - LDAPTestUtils.updateGroupMapperConfigOptions(mapperModel, + LDAPTestUtils.updateConfigOptions(mapperModel, RoleMapperConfig.USER_ROLES_RETRIEVE_STRATEGY, RoleMapperConfig.GET_ROLES_FROM_USER_MEMBEROF_ATTRIBUTE, RoleMapperConfig.MEMBEROF_LDAP_ATTRIBUTE, LDAPConstants.STREET); appRealm.updateComponent(mapperModel); diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPSpecialCharsTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPSpecialCharsTest.java index 2cd25660cb..1f19f03de5 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPSpecialCharsTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPSpecialCharsTest.java @@ -150,7 +150,7 @@ public class LDAPSpecialCharsTest extends AbstractLDAPTest { RealmModel appRealm = ctx.getRealm(); ComponentModel mapperModel = LDAPTestUtils.getSubcomponentByName(appRealm, ctx.getLdapModel(), "groupsMapper"); - LDAPTestUtils.updateGroupMapperConfigOptions(mapperModel, GroupMapperConfig.MODE, LDAPGroupMapperMode.LDAP_ONLY.toString()); + LDAPTestUtils.updateConfigOptions(mapperModel, GroupMapperConfig.MODE, LDAPGroupMapperMode.LDAP_ONLY.toString()); appRealm.updateComponent(mapperModel); UserModel specialUser = session.users().getUserByUsername(appRealm, "jamees,key*cložak)ppp"); diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPSyncTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPSyncTest.java index 804a342f6d..bebe0186df 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPSyncTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/ldap/LDAPSyncTest.java @@ -455,7 +455,7 @@ public class LDAPSyncTest extends AbstractLDAPTest { LDAPUtils.addMember(ctx.getLdapProvider(), MembershipType.DN, LDAPConstants.MEMBER, "not-used", group2, group1); ComponentModel mapperModel = LDAPTestUtils.getSubcomponentByName(appRealm, ctx.getLdapModel(), "groupsMapper"); - LDAPTestUtils.updateGroupMapperConfigOptions(mapperModel, GroupMapperConfig.PRESERVE_GROUP_INHERITANCE, "false"); + LDAPTestUtils.updateConfigOptions(mapperModel, GroupMapperConfig.PRESERVE_GROUP_INHERITANCE, "false"); ctx.getRealm().updateComponent(mapperModel); // sync groups to Keycloak diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/storage/BackwardsCompatibilityUserStorageTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/storage/BackwardsCompatibilityUserStorageTest.java index 7b69678b2d..51051b4026 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/storage/BackwardsCompatibilityUserStorageTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/storage/BackwardsCompatibilityUserStorageTest.java @@ -28,10 +28,10 @@ import org.keycloak.admin.client.resource.UserResource; import org.keycloak.broker.provider.util.SimpleHttp; import org.keycloak.common.Profile.Feature; import org.keycloak.common.util.MultivaluedHashMap; -import org.keycloak.credential.CredentialModel; import org.keycloak.models.RealmModel; import org.keycloak.models.UserModel; import org.keycloak.models.credential.OTPCredentialModel; +import org.keycloak.models.credential.PasswordCredentialModel; import org.keycloak.models.utils.TimeBasedOTP; import org.keycloak.representations.account.CredentialMetadataRepresentation; import org.keycloak.representations.idm.ComponentRepresentation; @@ -152,7 +152,7 @@ public class BackwardsCompatibilityUserStorageTest extends AbstractTestRealmKeyc // Update his password CredentialRepresentation passwordRep = new CredentialRepresentation(); - passwordRep.setType(CredentialModel.PASSWORD); + passwordRep.setType(PasswordCredentialModel.TYPE); passwordRep.setValue(password); passwordRep.setTemporary(false); diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/storage/UserStorageTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/storage/UserStorageTest.java index 2fcbf1e9fc..5c9a73d4e3 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/storage/UserStorageTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/federation/storage/UserStorageTest.java @@ -1,6 +1,7 @@ package org.keycloak.testsuite.federation.storage; import org.apache.commons.io.FileUtils; +import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.jboss.arquillian.graphene.page.Page; import org.junit.After; @@ -892,11 +893,11 @@ public class UserStorageTest extends AbstractAuthTest { List users = session.users().getRoleMembersStream(realm, roleModel1).map(UserModel::getUsername).collect(Collectors.toList()); Assert.assertEquals(2, users.size()); - Assert.assertThat(users, Matchers.containsInAnyOrder("thor", "zeus")); + MatcherAssert.assertThat(users, Matchers.containsInAnyOrder("thor", "zeus")); users = session.users().getRoleMembersStream(realm, roleModel2).map(UserModel::getUsername).collect(Collectors.toList()); Assert.assertEquals(1, users.size()); - Assert.assertThat(users, Matchers.containsInAnyOrder("thor")); + MatcherAssert.assertThat(users, Matchers.containsInAnyOrder("thor")); }); testRealmResource().roles().get("role1").remove(); @@ -948,7 +949,7 @@ public class UserStorageTest extends AbstractAuthTest { RealmModel realm = currentSession.realms().getRealmByName("test"); UserModel user = currentSession.users().getUserByUsername(realm, "thor"); - Assert.assertFalse(StorageId.isLocalStorage(user)); + Assert.assertFalse(StorageId.isLocalStorage(user.getId())); Stream credentials = user.credentialManager().getStoredCredentialsStream(); org.keycloak.testsuite.Assert.assertEquals(0, credentials.count()); @@ -1057,7 +1058,7 @@ public class UserStorageTest extends AbstractAuthTest { RealmModel realm = session.realms().getRealmByName("test"); UserModel user = session.users().getUserByUsername(realm, "thor"); - Assert.assertFalse(StorageId.isLocalStorage(user)); + Assert.assertFalse(StorageId.isLocalStorage(user.getId())); CredentialModel otp1 = OTPCredentialModel.createFromPolicy(realm, "secret1"); user.credentialManager().createStoredCredential(otp1); diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/ConditionalUserAttributeAuthenticatorTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/ConditionalUserAttributeAuthenticatorTest.java index bf9e2d8a18..dc623dd5b9 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/ConditionalUserAttributeAuthenticatorTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/ConditionalUserAttributeAuthenticatorTest.java @@ -15,7 +15,6 @@ import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.representations.idm.UserRepresentation; import org.keycloak.testsuite.AbstractTestRealmKeycloakTest; import org.keycloak.testsuite.AssertEvents; -import org.keycloak.testsuite.admin.ApiUtil; import org.keycloak.authentication.authenticators.conditional.ConditionalUserAttributeValueFactory; import org.keycloak.testsuite.pages.ErrorPage; import org.keycloak.testsuite.pages.LoginUsernameOnlyPage; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/DirectGrantFlowTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/DirectGrantFlowTest.java index 7977fd0b5e..a36a91262b 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/DirectGrantFlowTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/DirectGrantFlowTest.java @@ -18,11 +18,7 @@ package org.keycloak.testsuite.forms; -import java.util.List; -import java.util.function.Consumer; - import org.jboss.arquillian.drone.api.annotation.Drone; -import org.jboss.arquillian.graphene.page.Page; import org.jboss.arquillian.test.api.ArquillianResource; import org.junit.Rule; import org.junit.Test; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/HiddenProviderTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/HiddenProviderTest.java index eae92a7ceb..8aa4a124a4 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/HiddenProviderTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/HiddenProviderTest.java @@ -18,7 +18,6 @@ package org.keycloak.testsuite.forms; import org.jboss.arquillian.graphene.page.Page; import org.junit.Assert; -import static org.junit.Assert.assertTrue; import org.junit.Test; import org.keycloak.admin.client.resource.RealmResource; import org.keycloak.representations.idm.RealmRepresentation; 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 83884e475d..37962ae674 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 @@ -23,7 +23,6 @@ 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.credential.OTPCredentialModel; import org.keycloak.models.utils.HmacOTP; import org.keycloak.representations.idm.RealmRepresentation; 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 217ddcbc3e..7f69ee7cdc 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 @@ -29,7 +29,6 @@ import org.keycloak.events.EventType; import org.keycloak.models.AuthenticationExecutionModel; import org.keycloak.models.Constants; import org.keycloak.models.utils.SystemClientUtil; -import org.keycloak.protocol.oidc.utils.RedirectUtils; import org.keycloak.representations.idm.EventRepresentation; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.representations.idm.UserRepresentation; @@ -68,9 +67,6 @@ import jakarta.mail.internet.MimeMessage; import java.io.Closeable; import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.Map; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/ScriptAuthenticatorTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/ScriptAuthenticatorTest.java index 4a5a321232..c4b15061e0 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/ScriptAuthenticatorTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/ScriptAuthenticatorTest.java @@ -16,15 +16,12 @@ */ package org.keycloak.testsuite.forms; -import com.google.common.collect.ImmutableMap; -import org.apache.commons.io.IOUtils; import org.jboss.arquillian.graphene.page.Page; import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Rule; import org.junit.Test; -import org.keycloak.authentication.authenticators.browser.ScriptBasedAuthenticatorFactory; import org.keycloak.authentication.authenticators.browser.UsernamePasswordFormFactory; import org.keycloak.common.Profile; import org.keycloak.events.Details; @@ -33,7 +30,6 @@ import org.keycloak.events.EventType; import org.keycloak.models.AuthenticationExecutionModel; import org.keycloak.representations.idm.AuthenticationExecutionRepresentation; import org.keycloak.representations.idm.AuthenticationFlowRepresentation; -import org.keycloak.representations.idm.AuthenticatorConfigRepresentation; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.representations.idm.UserRepresentation; import org.keycloak.testsuite.AssertEvents; @@ -46,8 +42,7 @@ import org.keycloak.testsuite.util.RealmBuilder; import org.keycloak.testsuite.util.UserBuilder; import jakarta.ws.rs.core.Response; -import java.io.IOException; -import java.util.Map; + import java.util.UUID; import static org.keycloak.common.Profile.Feature.AUTHORIZATION; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/ThemeSelectorTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/ThemeSelectorTest.java index 59a0c089f4..286fe9ce4d 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/ThemeSelectorTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/ThemeSelectorTest.java @@ -3,14 +3,10 @@ package org.keycloak.testsuite.forms; import org.jboss.arquillian.graphene.page.Page; import org.junit.Test; import org.keycloak.representations.idm.ClientRepresentation; -import org.keycloak.representations.idm.ClientScopeRepresentation; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.testsuite.AbstractTestRealmKeycloakTest; -import org.keycloak.testsuite.admin.ApiUtil; import org.keycloak.testsuite.pages.LoginPage; -import java.util.HashMap; - import static org.junit.Assert.assertEquals; public class ThemeSelectorTest extends AbstractTestRealmKeycloakTest { diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/VerifyProfileTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/VerifyProfileTest.java index fcac6b0a02..7ced537d6e 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/VerifyProfileTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/VerifyProfileTest.java @@ -30,8 +30,6 @@ import java.util.HashMap; import java.util.List; import java.util.UUID; -import jakarta.ws.rs.core.Response; - import org.apache.commons.lang3.StringUtils; import org.jboss.arquillian.graphene.page.Page; import org.jboss.arquillian.test.api.ArquillianResource; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/i18n/LoginPageWithUserProfileTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/i18n/LoginPageWithUserProfileTest.java index 30c9b1f979..471e49b4c6 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/i18n/LoginPageWithUserProfileTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/i18n/LoginPageWithUserProfileTest.java @@ -16,40 +16,8 @@ */ package org.keycloak.testsuite.i18n; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.containsString; -import static org.hamcrest.Matchers.not; -import static org.junit.Assert.assertEquals; - -import java.io.IOException; -import java.util.Arrays; -import java.util.Locale; - -import jakarta.ws.rs.core.Response; -import org.apache.http.impl.client.CloseableHttpClient; -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.ApacheHttpClient43Engine; -import org.junit.Assert; -import org.junit.Test; -import org.keycloak.OAuth2Constants; -import org.keycloak.adapters.HttpClientBuilder; -import org.keycloak.admin.client.resource.UserResource; import org.keycloak.common.Profile.Feature; -import org.keycloak.locale.LocaleSelectorProvider; -import org.keycloak.models.UserModel; -import org.keycloak.representations.idm.RealmRepresentation; -import org.keycloak.representations.idm.UserRepresentation; -import org.keycloak.testsuite.admin.ApiUtil; import org.keycloak.testsuite.arquillian.annotation.EnableFeature; -import org.keycloak.testsuite.pages.AppPage; -import org.keycloak.testsuite.pages.LanguageComboboxAwarePage; -import org.keycloak.testsuite.pages.LoginPage; -import org.keycloak.testsuite.pages.LoginPasswordUpdatePage; -import org.keycloak.testsuite.pages.OAuthGrantPage; -import org.keycloak.testsuite.util.IdentityProviderBuilder; -import org.openqa.selenium.Cookie; /** * @author Michael Gerber diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/keys/ImportedRsaKeyProviderTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/keys/ImportedRsaKeyProviderTest.java index 259f065552..c9ee1fd4bb 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/keys/ImportedRsaKeyProviderTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/keys/ImportedRsaKeyProviderTest.java @@ -26,7 +26,6 @@ import org.keycloak.common.util.MultivaluedHashMap; import org.keycloak.common.util.PemUtils; import org.keycloak.crypto.Algorithm; import org.keycloak.crypto.KeyUse; -import org.keycloak.jose.jwe.JWEConstants; import org.keycloak.jose.jws.AlgorithmType; import org.keycloak.keys.Attributes; import org.keycloak.keys.ImportedRsaEncKeyProviderFactory; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/migration/AbstractJsonFileImportMigrationTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/migration/AbstractJsonFileImportMigrationTest.java index 108a5948fb..785c505f2d 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/migration/AbstractJsonFileImportMigrationTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/migration/AbstractJsonFileImportMigrationTest.java @@ -20,7 +20,7 @@ import org.keycloak.common.Profile.Feature; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; -import org.junit.Assert; + import org.junit.Before; import org.keycloak.representations.idm.RealmRepresentation; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/migration/AbstractMigrationTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/migration/AbstractMigrationTest.java index 593fa10888..2a8e9726a8 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/migration/AbstractMigrationTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/migration/AbstractMigrationTest.java @@ -53,7 +53,6 @@ import org.keycloak.representations.idm.AuthenticationExecutionInfoRepresentatio import org.keycloak.representations.idm.AuthenticationFlowRepresentation; import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.representations.idm.ClientScopeRepresentation; -import org.keycloak.representations.idm.ComponentExportRepresentation; import org.keycloak.representations.idm.ComponentRepresentation; import org.keycloak.representations.idm.MappingsRepresentation; import org.keycloak.representations.idm.ProtocolMapperRepresentation; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/model/BadRealmTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/model/BadRealmTest.java index 3d968c1807..ed5862ec82 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/model/BadRealmTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/model/BadRealmTest.java @@ -1,8 +1,6 @@ package org.keycloak.testsuite.model; -import org.junit.Ignore; import org.junit.Test; -import org.keycloak.common.Profile; import org.keycloak.models.KeycloakSession; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.services.managers.RealmManager; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/model/ImportTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/model/ImportTest.java index 4d30f90bad..2458ece322 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/model/ImportTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/model/ImportTest.java @@ -41,10 +41,8 @@ import org.keycloak.userprofile.UserProfileProvider; import org.keycloak.representations.userprofile.config.UPAttribute; import org.keycloak.representations.userprofile.config.UPAttributeSelector; import org.keycloak.representations.userprofile.config.UPConfig; -import org.keycloak.userprofile.config.UPConfigUtils; import org.keycloak.util.JsonSerialization; -import java.io.ByteArrayInputStream; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.util.Collection; 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 f4e3754b42..3ec05d713e 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 @@ -24,7 +24,6 @@ import org.apache.http.client.methods.HttpPost; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.message.BasicNameValuePair; -import org.junit.Assert; import org.junit.Rule; import org.junit.Test; import org.keycloak.OAuth2Constants; 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 6f12fab10c..d31492b506 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 @@ -1508,10 +1508,10 @@ public class ClientAuthSignedJWTTest extends AbstractKeycloakTest { if (isClaimEnabled("subject")) reqToken.subject(clientId); if (isClaimEnabled("audience")) reqToken.audience(realmInfoUrl); - int now = Time.currentTime(); - if (isClaimEnabled("issuedAt")) reqToken.issuedAt(now); - if (isClaimEnabled("expiration")) reqToken.expiration(now + getTokenTimeout()); - if (isClaimEnabled("notBefore")) reqToken.notBefore(now); + long now = Time.currentTime(); + if (isClaimEnabled("issuedAt")) reqToken.iat(now); + if (isClaimEnabled("expiration")) reqToken.exp(now + getTokenTimeout()); + if (isClaimEnabled("notBefore")) reqToken.nbf(now); return reqToken; } @@ -1623,10 +1623,10 @@ public class ClientAuthSignedJWTTest extends AbstractKeycloakTest { reqToken.subject(clientId); reqToken.audience(realmInfoUrl); - int now = Time.currentTime(); - reqToken.issuedAt(now); - reqToken.expiration(now + 10); - reqToken.notBefore(now); + long now = Time.currentTime(); + reqToken.iat(now); + reqToken.exp(now + 10); + reqToken.nbf(now); return reqToken; } diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/LegacyLogoutTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/LegacyLogoutTest.java index 516a4a3320..3b71751ee9 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/LegacyLogoutTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/LegacyLogoutTest.java @@ -30,7 +30,6 @@ import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.keycloak.OAuth2Constants; -import org.keycloak.OAuthErrorException; import org.keycloak.admin.client.resource.ClientResource; import org.keycloak.admin.client.resource.ClientsResource; import org.keycloak.events.Details; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/LogoutTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/LogoutTest.java index cffcf158e4..63dfdd3459 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/LogoutTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/LogoutTest.java @@ -17,6 +17,7 @@ package org.keycloak.testsuite.oauth; +import org.hamcrest.MatcherAssert; import org.jboss.arquillian.graphene.page.Page; import org.junit.Before; import org.junit.Rule; @@ -105,7 +106,7 @@ public class LogoutTest extends AbstractKeycloakTest { String refreshTokenString = tokenResponse.getRefreshToken(); try (CloseableHttpResponse response = oauth.doLogout(refreshTokenString, "password")) { - assertThat(response, Matchers.statusCodeIsHC(Status.NO_CONTENT)); + MatcherAssert.assertThat(response, Matchers.statusCodeIsHC(Status.NO_CONTENT)); assertNotNull(testingClient.testApp().getAdminLogoutAction()); } @@ -125,7 +126,7 @@ public class LogoutTest extends AbstractKeycloakTest { // Logout should succeed with expired refresh token, see KEYCLOAK-3302 try (CloseableHttpResponse response = oauth.doLogout(refreshTokenString, "password")) { - assertThat(response, Matchers.statusCodeIsHC(Status.NO_CONTENT)); + MatcherAssert.assertThat(response, Matchers.statusCodeIsHC(Status.NO_CONTENT)); assertNotNull(testingClient.testApp().getAdminLogoutAction()); } @@ -167,7 +168,7 @@ public class LogoutTest extends AbstractKeycloakTest { // finally POST logout with VALID token should succeed try (CloseableHttpResponse response = oauth.doLogout(tokenResponse2.getRefreshToken(), "password")) { - assertThat(response, Matchers.statusCodeIsHC(Status.NO_CONTENT)); + MatcherAssert.assertThat(response, Matchers.statusCodeIsHC(Status.NO_CONTENT)); assertNotNull(testingClient.testApp().getAdminLogoutAction()); } @@ -188,7 +189,7 @@ public class LogoutTest extends AbstractKeycloakTest { // Assert logout fails with 400 when trying to use different client credentials try (CloseableHttpResponse response = oauth.doLogout(refreshTokenString, "password")) { - assertThat(response, Matchers.statusCodeIsHC(Status.BAD_REQUEST)); + MatcherAssert.assertThat(response, Matchers.statusCodeIsHC(Status.BAD_REQUEST)); } oauth.clientId("test-app"); @@ -245,8 +246,8 @@ public class LogoutTest extends AbstractKeycloakTest { try (CloseableHttpClient c = HttpClientBuilder.create().disableRedirectHandling().build(); CloseableHttpResponse response = c.execute(new HttpGet(logoutUrl))) { - assertThat(response, Matchers.statusCodeIsHC(Status.FOUND)); - assertThat(response.getFirstHeader(HttpHeaders.LOCATION).getValue(), is(oauth.APP_AUTH_ROOT)); + MatcherAssert.assertThat(response, Matchers.statusCodeIsHC(Status.FOUND)); + MatcherAssert.assertThat(response.getFirstHeader(HttpHeaders.LOCATION).getValue(), is(oauth.APP_AUTH_ROOT)); } } @@ -288,8 +289,8 @@ public class LogoutTest extends AbstractKeycloakTest { try (CloseableHttpClient c = HttpClientBuilder.create().disableRedirectHandling().build(); CloseableHttpResponse response = c.execute(new HttpGet(logoutUrl))) { - assertThat(response, Matchers.statusCodeIsHC(Status.FOUND)); - assertThat(response.getFirstHeader(HttpHeaders.LOCATION).getValue(), is(oauth.APP_AUTH_ROOT)); + MatcherAssert.assertThat(response, Matchers.statusCodeIsHC(Status.FOUND)); + MatcherAssert.assertThat(response.getFirstHeader(HttpHeaders.LOCATION).getValue(), is(oauth.APP_AUTH_ROOT)); } // Assert logout event triggered for backchannel logout @@ -327,8 +328,8 @@ public class LogoutTest extends AbstractKeycloakTest { try (CloseableHttpClient c = HttpClientBuilder.create().disableRedirectHandling().build(); CloseableHttpResponse response = c.execute(new HttpGet(logoutUrl))) { - assertThat(response, Matchers.statusCodeIsHC(Status.FOUND)); - assertThat(response.getFirstHeader(HttpHeaders.LOCATION).getValue(), is(oauth.APP_AUTH_ROOT)); + MatcherAssert.assertThat(response, Matchers.statusCodeIsHC(Status.FOUND)); + MatcherAssert.assertThat(response.getFirstHeader(HttpHeaders.LOCATION).getValue(), is(oauth.APP_AUTH_ROOT)); } assertNotNull(testingClient.testApp().getBackChannelLogoutToken()); diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/OAuth2DeviceAuthorizationGrantTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/OAuth2DeviceAuthorizationGrantTest.java index f5622788fb..5cac4f58b4 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/OAuth2DeviceAuthorizationGrantTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/OAuth2DeviceAuthorizationGrantTest.java @@ -67,7 +67,6 @@ import org.apache.http.impl.client.CloseableHttpClient; import org.keycloak.util.BasicAuthHelper; import org.openqa.selenium.Cookie; -import java.io.IOException; import java.util.List; import java.util.LinkedList; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/OIDCProtocolMappersTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/OIDCProtocolMappersTest.java index fdaedfd198..c3b0f6d1fe 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/OIDCProtocolMappersTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/OIDCProtocolMappersTest.java @@ -77,12 +77,12 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.anyOf; import static org.hamcrest.Matchers.arrayContainingInAnyOrder; import static org.hamcrest.Matchers.containsInAnyOrder; +import static org.hamcrest.Matchers.emptyOrNullString; import static org.hamcrest.Matchers.hasItem; import static org.hamcrest.Matchers.hasItems; import static org.hamcrest.Matchers.in; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.isEmptyOrNullString; import static org.hamcrest.Matchers.not; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; @@ -530,7 +530,7 @@ public class OIDCProtocolMappersTest extends AbstractKeycloakTest { IDToken idToken = oauth.verifyIDToken(response.getIdToken()); Object empty = idToken.getOtherClaims().get("empty"); - assertThat((empty == null ? null : (String) empty), isEmptyOrNullString()); + assertThat((empty == null ? null : (String) empty), is(emptyOrNullString())); Object nulll = idToken.getOtherClaims().get("null"); assertNull(nulll); diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/ServiceAccountTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/ServiceAccountTest.java index 15cb825dc3..1189ea63fb 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/ServiceAccountTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/ServiceAccountTest.java @@ -64,7 +64,9 @@ import java.util.List; import java.util.Map; import static org.hamcrest.Matchers.empty; +import static org.hamcrest.Matchers.emptyOrNullString; import static org.hamcrest.Matchers.hasSize; +import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; @@ -348,7 +350,7 @@ public class ServiceAccountTest extends AbstractKeycloakTest { representation.setCredentials(Arrays.asList(password)); this.expectedException.expect(Matchers.allOf(Matchers.instanceOf(ClientErrorException.class), - Matchers.hasProperty("response", Matchers.hasProperty("status", Matchers.is(400))))); + Matchers.hasProperty("response", Matchers.hasProperty("status", is(400))))); this.expectedException.reportMissingExceptionWithMessage("Should fail, should not be possible to manage credentials for service accounts"); serviceAccount.update(representation); @@ -370,7 +372,7 @@ public class ServiceAccountTest extends AbstractKeycloakTest { events.expect(EventType.REVOKE_GRANT) .client("service-account-cl") .user(userIdCl) - .session(Matchers.isEmptyOrNullString()) + .session(is(emptyOrNullString())) .detail(Details.TOKEN_ID, accessToken.getId()) .assertEvent(); @@ -379,8 +381,8 @@ public class ServiceAccountTest extends AbstractKeycloakTest { // TODO: This would be better to be "INTROSPECT_TOKEN_ERROR" events.expect(EventType.INTROSPECT_TOKEN) .client("service-account-cl") - .user(Matchers.isEmptyOrNullString()) - .session(Matchers.isEmptyOrNullString()) + .user(is(emptyOrNullString())) + .session(is(emptyOrNullString())) .assertEvent(); } @@ -426,8 +428,8 @@ public class ServiceAccountTest extends AbstractKeycloakTest { Assert.assertTrue(getIntrospectionResponse("service-account-cl", "secret1", tokenString)); events.expect(EventType.INTROSPECT_TOKEN) .client("service-account-cl") - .user(Matchers.isEmptyOrNullString()) - .session(Matchers.isEmptyOrNullString()) + .user(is(emptyOrNullString())) + .session(is(emptyOrNullString())) .assertEvent(); return tokenString; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/TokenRevocationCorsTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/TokenRevocationCorsTest.java index 445c16c3ba..3476335228 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/TokenRevocationCorsTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/TokenRevocationCorsTest.java @@ -26,6 +26,7 @@ import java.util.List; import jakarta.ws.rs.core.Response.Status; import org.apache.http.client.methods.CloseableHttpResponse; +import org.hamcrest.MatcherAssert; import org.junit.Test; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.representations.oidc.TokenMetadataRepresentation; @@ -62,7 +63,7 @@ public class TokenRevocationCorsTest extends AbstractKeycloakTest { oauth.origin(VALID_CORS_URL); CloseableHttpResponse response = oauth.doTokenRevoke(tokenResponse.getRefreshToken(), "refresh_token", "password"); - assertThat(response, Matchers.statusCodeIsHC(Status.OK)); + MatcherAssert.assertThat(response, Matchers.statusCodeIsHC(Status.OK)); assertCors(response); isTokenDisabled(tokenResponse, "test-app2"); @@ -78,7 +79,7 @@ public class TokenRevocationCorsTest extends AbstractKeycloakTest { oauth.origin(INVALID_CORS_URL); CloseableHttpResponse response = oauth.doTokenRevoke(tokenResponse.getRefreshToken(), "refresh_token", "password"); - assertThat(response, Matchers.statusCodeIsHC(Status.OK)); + MatcherAssert.assertThat(response, Matchers.statusCodeIsHC(Status.OK)); assertNotCors(response); isTokenDisabled(tokenResponse, "test-app2"); diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/TokenRevocationTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/TokenRevocationTest.java index 69e6a09f3b..cad12776e7 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/TokenRevocationTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/TokenRevocationTest.java @@ -37,7 +37,6 @@ import jakarta.ws.rs.core.Response.Status; import org.apache.commons.io.output.ByteArrayOutputStream; import org.apache.http.NameValuePair; -import org.apache.http.client.HttpClient; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpPost; @@ -55,7 +54,6 @@ import org.keycloak.admin.client.Keycloak; import org.keycloak.admin.client.resource.RealmResource; import org.keycloak.admin.client.resource.UserResource; import org.keycloak.broker.provider.util.SimpleHttp; -import org.keycloak.representations.account.UserRepresentation; import org.keycloak.representations.idm.OAuth2ErrorRepresentation; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.representations.idm.UserSessionRepresentation; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/hok/HoKTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/hok/HoKTest.java index 575d2d3caf..dc71e39165 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/hok/HoKTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/hok/HoKTest.java @@ -70,7 +70,6 @@ import org.keycloak.testsuite.util.KeycloakModelUtils; import org.keycloak.testsuite.util.OAuthClient; import org.keycloak.testsuite.util.UserInfoClientUtil; import org.keycloak.testsuite.util.OAuthClient.AccessTokenResponse; -import org.keycloak.testsuite.util.WaitUtils; import org.keycloak.util.JsonSerialization; import org.openqa.selenium.WebDriver; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/OIDCDynamicScopeTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/OIDCDynamicScopeTest.java index 962cb7a2f8..fe0c2f4908 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/OIDCDynamicScopeTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/OIDCDynamicScopeTest.java @@ -40,7 +40,6 @@ import org.keycloak.testsuite.util.UserBuilder; import jakarta.ws.rs.core.Response; import java.util.HashMap; import java.util.List; -import java.util.Optional; import java.util.stream.Collectors; import static org.keycloak.common.Profile.Feature.DYNAMIC_SCOPES; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/OIDCScopeTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/OIDCScopeTest.java index 1230f5c902..d0464148de 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/OIDCScopeTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oidc/OIDCScopeTest.java @@ -222,7 +222,7 @@ public class OIDCScopeTest extends AbstractOIDCScopeTest { Assert.assertEquals("John", idToken.getGivenName()); Assert.assertEquals("Doe", idToken.getFamilyName()); Assert.assertEquals("John Doe", idToken.getName()); - Assert.assertEquals(new Long(1643282255L),idToken.getUpdatedAt()); + Assert.assertEquals(Long.valueOf(1643282255L),idToken.getUpdatedAt()); } else { Assert.assertNull(idToken.getPreferredUsername()); Assert.assertNull(idToken.getGivenName()); 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 ec72b02e66..cfc3c66a24 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 @@ -20,7 +20,6 @@ package org.keycloak.testsuite.oidc.flows; import org.junit.Before; import org.junit.Test; import org.keycloak.events.Details; -import org.keycloak.jose.jws.crypto.HashUtils; import org.keycloak.protocol.oidc.utils.OIDCResponseType; import org.keycloak.representations.IDToken; import org.keycloak.representations.idm.EventRepresentation; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/runonserver/ServerVersion.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/runonserver/ServerVersion.java index 3e565dc1a6..8f9a181b97 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/runonserver/ServerVersion.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/runonserver/ServerVersion.java @@ -1,8 +1,6 @@ package org.keycloak.testsuite.runonserver; import org.keycloak.common.Version; -import org.keycloak.models.utils.ModelToRepresentation; -import org.keycloak.representations.idm.ComponentRepresentation; /** * Created by st on 26.01.17. diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/saml/ArtifactBindingTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/saml/ArtifactBindingTest.java index e799c1ddd3..7413dd7696 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/saml/ArtifactBindingTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/saml/ArtifactBindingTest.java @@ -60,10 +60,10 @@ import java.util.regex.Pattern; import static org.awaitility.Awaitility.await; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.emptyOrNullString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.isEmptyOrNullString; import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; @@ -180,7 +180,7 @@ public class ArtifactBindingTest extends AbstractSamlTest { assertThat(m.find(), is(true)); String artifactB64 = m.group(1); - assertThat(artifactB64,not(isEmptyOrNullString())); + assertThat(artifactB64,not(is(emptyOrNullString()))); byte[] artifact = Base64.getDecoder().decode(artifactB64); assertThat(artifact.length, is(44)); @@ -210,7 +210,7 @@ public class ArtifactBindingTest extends AbstractSamlTest { assertThat(artifactResponse, isSamlStatusResponse(JBossSAMLURIConstants.STATUS_SUCCESS)); assertThat(artifactResponse.getSignature(), nullValue()); assertThat(artifactResponse.getAny(), instanceOf(ResponseType.class)); - assertThat(artifactResponse.getInResponseTo(), not(isEmptyOrNullString())); + assertThat(artifactResponse.getInResponseTo(), not(is(emptyOrNullString()))); ResponseType samlResponse = (ResponseType)artifactResponse.getAny(); assertThat(samlResponse, isSamlStatusResponse(JBossSAMLURIConstants.STATUS_SUCCESS)); } @@ -365,7 +365,7 @@ public class ArtifactBindingTest extends AbstractSamlTest { assertThat(artifactResponse, isSamlStatusResponse(JBossSAMLURIConstants.STATUS_SUCCESS)); assertThat(artifactResponse.getSignature(), notNullValue()); assertThat(artifactResponse.getAny(), instanceOf(ResponseType.class)); - assertThat(artifactResponse.getInResponseTo(), not(isEmptyOrNullString())); + assertThat(artifactResponse.getInResponseTo(), not(is(emptyOrNullString()))); ResponseType samlResponse = (ResponseType)artifactResponse.getAny(); assertThat(samlResponse, isSamlStatusResponse(JBossSAMLURIConstants.STATUS_SUCCESS)); @@ -388,7 +388,7 @@ public class ArtifactBindingTest extends AbstractSamlTest { ArtifactResponseType artifactResponse = (ArtifactResponseType)response.getSamlObject(); assertThat(artifactResponse, isSamlStatusResponse(JBossSAMLURIConstants.STATUS_SUCCESS)); assertThat(artifactResponse.getAny(), instanceOf(ResponseType.class)); - assertThat(artifactResponse.getInResponseTo(), not(isEmptyOrNullString())); + assertThat(artifactResponse.getInResponseTo(), not(is(emptyOrNullString()))); ResponseType samlResponse = (ResponseType)artifactResponse.getAny(); assertThat(samlResponse, isSamlStatusResponse(JBossSAMLURIConstants.STATUS_SUCCESS)); } @@ -440,7 +440,7 @@ public class ArtifactBindingTest extends AbstractSamlTest { assertThat(true, is(m.find())); String artifactB64 = m.group(1); - assertThat(artifactB64, not(isEmptyOrNullString())); + assertThat(artifactB64, not(is(emptyOrNullString()))); byte[] artifact = Base64.getDecoder().decode(artifactB64); assertThat(artifact.length, is(44)); diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/saml/AuthnRequestTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/saml/AuthnRequestTest.java index 6e4d7f3ccd..aba8606f97 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/saml/AuthnRequestTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/saml/AuthnRequestTest.java @@ -18,7 +18,6 @@ package org.keycloak.testsuite.saml; import org.keycloak.testsuite.util.SamlClientBuilder; import org.apache.http.util.EntityUtils; -import org.junit.Ignore; import org.junit.Test; import static org.hamcrest.Matchers.*; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/saml/IdpInitiatedLoginTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/saml/IdpInitiatedLoginTest.java index 57e4f9597e..3707972c55 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/saml/IdpInitiatedLoginTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/saml/IdpInitiatedLoginTest.java @@ -18,7 +18,7 @@ package org.keycloak.testsuite.saml; import java.io.Closeable; import java.io.IOException; -import org.junit.Assert; + import org.keycloak.admin.client.resource.ClientsResource; import org.keycloak.admin.client.resource.UsersResource; import org.keycloak.dom.saml.v2.protocol.ResponseType; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/saml/IncludeOneTimeUseConditionTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/saml/IncludeOneTimeUseConditionTest.java index 16e47f7161..85727442dd 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/saml/IncludeOneTimeUseConditionTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/saml/IncludeOneTimeUseConditionTest.java @@ -18,14 +18,11 @@ package org.keycloak.testsuite.saml; import com.google.common.collect.Collections2; import org.junit.Test; -import org.keycloak.admin.client.resource.ClientResource; -import org.keycloak.admin.client.resource.ClientsResource; import org.keycloak.dom.saml.v2.assertion.ConditionAbstractType; import org.keycloak.dom.saml.v2.assertion.ConditionsType; import org.keycloak.dom.saml.v2.assertion.OneTimeUseType; import org.keycloak.dom.saml.v2.protocol.ResponseType; import org.keycloak.protocol.saml.SamlConfigAttributes; -import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.saml.processing.core.saml.v2.common.SAMLDocumentHolder; import org.keycloak.testsuite.updaters.ClientAttributeUpdater; import org.keycloak.testsuite.util.SamlClient.Binding; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/script/DeployedScriptAuthenticatorTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/script/DeployedScriptAuthenticatorTest.java index 59c17d6258..dd8c5a3668 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/script/DeployedScriptAuthenticatorTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/script/DeployedScriptAuthenticatorTest.java @@ -54,7 +54,6 @@ import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.representations.idm.UserRepresentation; import org.keycloak.representations.provider.ScriptProviderDescriptor; import org.keycloak.testsuite.AssertEvents; -import org.keycloak.testsuite.admin.ApiUtil; import org.keycloak.testsuite.admin.authentication.AbstractAuthenticationTest; import org.keycloak.testsuite.arquillian.annotation.DisableFeature; import org.keycloak.testsuite.arquillian.annotation.EnableFeature; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/sessionlimits/AbstractUserSessionLimitsBrokerTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/sessionlimits/AbstractUserSessionLimitsBrokerTest.java index 9dd33148a3..3f6a847eb0 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/sessionlimits/AbstractUserSessionLimitsBrokerTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/sessionlimits/AbstractUserSessionLimitsBrokerTest.java @@ -5,7 +5,6 @@ import org.keycloak.authentication.authenticators.sessionlimits.UserSessionLimit import org.keycloak.models.AuthenticationFlowModel; import org.keycloak.models.IdentityProviderModel; import org.keycloak.models.RealmModel; -import org.keycloak.testsuite.Assert; import org.keycloak.testsuite.broker.AbstractInitializedBaseBrokerTest; import static org.junit.Assert.assertEquals; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/theme/CustomAccountResourceProviderTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/theme/CustomAccountResourceProviderTest.java index 8b2b7d0db2..13226a39d8 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/theme/CustomAccountResourceProviderTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/theme/CustomAccountResourceProviderTest.java @@ -1,13 +1,11 @@ package org.keycloak.testsuite.theme; -import java.io.IOException; import org.junit.Assert; import org.junit.Test; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.services.resource.AccountResourceProvider; import org.keycloak.testsuite.AbstractTestRealmKeycloakTest; import org.keycloak.testsuite.theme.CustomAccountResourceProviderFactory; -import org.keycloak.theme.Theme; public class CustomAccountResourceProviderTest extends AbstractTestRealmKeycloakTest { diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/AdapterServletDeployment.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/AdapterServletDeployment.java index d8328c262f..e30a2275d2 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/AdapterServletDeployment.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/AdapterServletDeployment.java @@ -24,6 +24,7 @@ import org.jboss.shrinkwrap.api.spec.WebArchive; import java.io.IOException; import java.net.URL; +import java.nio.charset.Charset; /** * Expects a structure like adapter-test directory @@ -81,7 +82,7 @@ public class AdapterServletDeployment { public static void addContextXml(Archive archive, String contextPath) { // hardcoded for now try { - String contextXmlContent = IOUtils.toString(tomcatContext.openStream()) + String contextXmlContent = IOUtils.toString(tomcatContext.openStream(), Charset.defaultCharset()) .replace("%CONTEXT_PATH%", contextPath); archive.add(new StringAsset(contextXmlContent), "/META-INF/context.xml"); } catch (IOException ex) { diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/ClientManager.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/ClientManager.java index e4ccd87bb4..131f435800 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/ClientManager.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/ClientManager.java @@ -3,7 +3,6 @@ package org.keycloak.testsuite.util; import org.keycloak.admin.client.resource.ClientResource; import org.keycloak.admin.client.resource.RealmResource; import org.keycloak.protocol.oidc.OIDCAdvancedConfigWrapper; -import org.keycloak.protocol.oidc.OIDCConfigAttributes; import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.representations.idm.ProtocolMapperRepresentation; import org.keycloak.representations.idm.RoleRepresentation; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/TextFileCheckerTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/TextFileCheckerTest.java index 0af46fa347..36c57403d1 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/TextFileCheckerTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/TextFileCheckerTest.java @@ -26,7 +26,6 @@ import java.util.function.Consumer; import java.util.stream.Stream; import org.hamcrest.Matchers; import org.junit.After; -import org.junit.Assert; import org.junit.Before; import org.junit.Test; 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 8ae4bf1ddb..f3963597f5 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 @@ -28,8 +28,6 @@ import org.junit.Assert; import org.keycloak.testsuite.auth.page.login.PageWithLoginUrl; import org.keycloak.testsuite.page.AbstractPage; import org.openqa.selenium.WebDriver; -import org.openqa.selenium.support.ui.ExpectedConditions; -import org.openqa.selenium.support.ui.WebDriverWait; import java.io.IOException; import java.io.InputStreamReader; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/validation/ValidatorsTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/validation/ValidatorsTest.java index 1e8d101247..9dea81d78a 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/validation/ValidatorsTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/validation/ValidatorsTest.java @@ -124,7 +124,7 @@ public class ValidatorsTest extends AbstractKeycloakTest { Assert.assertEquals(LengthValidator.ID, error.getValidatorId()); Assert.assertEquals(inputHint, error.getInputHint()); Assert.assertEquals(LengthValidator.MESSAGE_INVALID_LENGTH_TOO_SHORT, error.getMessage()); - Assert.assertEquals(new Integer(2), error.getMessageParameters()[0]); + Assert.assertEquals(Integer.valueOf(2), error.getMessageParameters()[0]); Assert.assertTrue(result.hasErrorsForValidatorId(LengthValidator.ID)); Assert.assertFalse(result.hasErrorsForValidatorId("unknown")); diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/x509/AbstractX509AuthenticationTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/x509/AbstractX509AuthenticationTest.java index c9a70337a7..c6b38c86f0 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/x509/AbstractX509AuthenticationTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/x509/AbstractX509AuthenticationTest.java @@ -72,6 +72,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import static org.hamcrest.Matchers.emptyOrNullString; +import static org.hamcrest.Matchers.is; import static org.keycloak.authentication.authenticators.x509.X509AuthenticatorConfigModel.IdentityMapperType.USERNAME_EMAIL; import static org.keycloak.authentication.authenticators.x509.X509AuthenticatorConfigModel.IdentityMapperType.USER_ATTRIBUTE; import static org.keycloak.authentication.authenticators.x509.X509AuthenticatorConfigModel.MappingSourceType.ISSUERDN; @@ -553,7 +555,7 @@ public abstract class AbstractX509AuthenticationTest extends AbstractTestRealmKe protected AssertEvents.ExpectedEvent addX509CertificateDetails(AssertEvents.ExpectedEvent expectedEvent) { return expectedEvent - .detail(Details.X509_CERTIFICATE_SERIAL_NUMBER, Matchers.not(Matchers.isEmptyOrNullString())) + .detail(Details.X509_CERTIFICATE_SERIAL_NUMBER, Matchers.not(is(emptyOrNullString()))) .detail(Details.X509_CERTIFICATE_SUBJECT_DISTINGUISHED_NAME, Matchers.startsWith("EMAILADDRESS=test-user@localhost")) .detail(Details.X509_CERTIFICATE_ISSUER_DISTINGUISHED_NAME, Matchers.startsWith("EMAILADDRESS=contact@keycloak.org")); } diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/x509/X509BrowserCRLTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/x509/X509BrowserCRLTest.java index 8c23eaac5d..5020646f95 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/x509/X509BrowserCRLTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/x509/X509BrowserCRLTest.java @@ -30,7 +30,6 @@ import org.keycloak.representations.idm.AuthenticatorConfigRepresentation; import org.keycloak.testsuite.pages.AppPage; import org.keycloak.testsuite.util.ContainerAssume; import org.keycloak.testsuite.util.PhantomJSBrowser; -import org.keycloak.testsuite.util.WaitUtils; import org.openqa.selenium.WebDriver; import static org.hamcrest.Matchers.containsString; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/x509/X509BrowserLoginTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/x509/X509BrowserLoginTest.java index 32c8ade3be..5f99432da6 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/x509/X509BrowserLoginTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/x509/X509BrowserLoginTest.java @@ -46,7 +46,7 @@ import static org.keycloak.authentication.authenticators.x509.X509AuthenticatorC import static org.keycloak.authentication.authenticators.x509.X509AuthenticatorConfigModel.MappingSourceType.SERIALNUMBER; import static org.keycloak.authentication.authenticators.x509.X509AuthenticatorConfigModel.MappingSourceType.SUBJECTDN; import static org.keycloak.authentication.authenticators.x509.X509AuthenticatorConfigModel.MappingSourceType.SUBJECTDN_EMAIL; -import org.keycloak.testsuite.ProfileAssume; + import org.keycloak.testsuite.util.DroneUtils; import org.openqa.selenium.WebDriver; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/x509/X509OCSPResponderFailOpenTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/x509/X509OCSPResponderFailOpenTest.java index 15fdb727e7..32a056226e 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/x509/X509OCSPResponderFailOpenTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/x509/X509OCSPResponderFailOpenTest.java @@ -3,17 +3,15 @@ package org.keycloak.testsuite.x509; import com.google.common.base.Charsets; import io.undertow.Undertow; -import io.undertow.server.handlers.BlockingHandler; import java.nio.file.Paths; import java.util.function.Supplier; -import jakarta.ws.rs.core.Response; + import jakarta.ws.rs.core.Response; import org.apache.commons.io.IOUtils; import org.apache.http.impl.client.CloseableHttpClient; import org.jboss.arquillian.drone.api.annotation.Drone; -import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/x509/X509OCSPResponderTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/x509/X509OCSPResponderTest.java index 37b81d3009..b503f240e1 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/x509/X509OCSPResponderTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/x509/X509OCSPResponderTest.java @@ -39,8 +39,7 @@ import static org.keycloak.authentication.authenticators.x509.X509AuthenticatorC import io.undertow.Undertow; import io.undertow.server.handlers.BlockingHandler; -import org.keycloak.testsuite.util.PhantomJSBrowser; -import org.openqa.selenium.WebDriver; + import java.nio.file.Paths; import java.util.function.Supplier; import org.apache.commons.io.IOUtils;