From c23e1e0e2bef90730b1d4842f7ff4f0ef033def5 Mon Sep 17 00:00:00 2001 From: Aboullos <61687012+Aboullos@users.noreply.github.com> Date: Tue, 31 Oct 2023 09:06:09 +0100 Subject: [PATCH] Fix springboot tests (#24254) Co-authored-by: Michal Hajas --- .../test-apps/spring-boot-adapter-app/pom.xml | 2 +- .../tests/other/springboot-tests/pom.xml | 6 +++++ .../springboot/AccountLinkSpringBootTest.java | 23 +++++++++++++++---- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/testsuite/integration-arquillian/test-apps/spring-boot-adapter-app/pom.xml b/testsuite/integration-arquillian/test-apps/spring-boot-adapter-app/pom.xml index ab38ff036c..fa6b07021c 100644 --- a/testsuite/integration-arquillian/test-apps/spring-boot-adapter-app/pom.xml +++ b/testsuite/integration-arquillian/test-apps/spring-boot-adapter-app/pom.xml @@ -192,7 +192,7 @@ org.springframework.boot spring-boot-starter-parent - ${spring-boot.version} + ${spring-boot26.version} pom import diff --git a/testsuite/integration-arquillian/tests/other/springboot-tests/pom.xml b/testsuite/integration-arquillian/tests/other/springboot-tests/pom.xml index ec9ae1efef..a38950170e 100644 --- a/testsuite/integration-arquillian/tests/other/springboot-tests/pom.xml +++ b/testsuite/integration-arquillian/tests/other/springboot-tests/pom.xml @@ -49,6 +49,12 @@ 2.26 + + org.glassfish.jersey.inject + jersey-hk2 + 2.26 + + diff --git a/testsuite/integration-arquillian/tests/other/springboot-tests/src/test/java/org/keycloak/testsuite/springboot/AccountLinkSpringBootTest.java b/testsuite/integration-arquillian/tests/other/springboot-tests/src/test/java/org/keycloak/testsuite/springboot/AccountLinkSpringBootTest.java index 4f81c39bb5..e5255cef4e 100644 --- a/testsuite/integration-arquillian/tests/other/springboot-tests/src/test/java/org/keycloak/testsuite/springboot/AccountLinkSpringBootTest.java +++ b/testsuite/integration-arquillian/tests/other/springboot-tests/src/test/java/org/keycloak/testsuite/springboot/AccountLinkSpringBootTest.java @@ -1,3 +1,20 @@ +/* + * Copyright 2023 Red Hat, Inc. and/or its affiliates + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.keycloak.testsuite.springboot; import org.hamcrest.Matchers; @@ -24,7 +41,6 @@ import org.keycloak.testsuite.admin.ApiUtil; import org.keycloak.testsuite.arquillian.AuthServerTestEnricher; import org.keycloak.testsuite.arquillian.annotation.DisableFeature; import org.keycloak.testsuite.broker.BrokerTestTools; -//import org.keycloak.testsuite.pages.AccountUpdateProfilePage; import org.keycloak.testsuite.pages.ErrorPage; import org.keycloak.testsuite.pages.LoginUpdateProfilePage; import org.keycloak.testsuite.util.OAuthClient; @@ -74,9 +90,6 @@ public class AccountLinkSpringBootTest extends AbstractSpringBootTest { @Page private LinkingPage linkingPage; - //@Page - //private AccountUpdateProfilePage profilePage; - @Page private LoginUpdateProfilePage loginUpdateProfilePage; @@ -453,6 +466,8 @@ public class AccountLinkSpringBootTest extends AbstractSpringBootTest { links = realm.users().get(childUserId).getFederatedIdentity(); assertThat(links, is(empty())); + pause(500) + logoutAll(); log.info("testing link-only attack");