diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/KeycloakArquillianExtension.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/KeycloakArquillianExtension.java index 5c82c3f551..287d516f6d 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/KeycloakArquillianExtension.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/KeycloakArquillianExtension.java @@ -9,7 +9,6 @@ import org.jboss.arquillian.core.spi.LoadableExtension; import org.jboss.arquillian.graphene.location.CustomizableURLResourceProvider; import org.jboss.arquillian.test.spi.enricher.resource.ResourceProvider; import org.jboss.arquillian.test.spi.execution.TestExecutionDecider; -import org.keycloak.testsuite.arquillian.jira.JiraTestExecutionDecider; import org.keycloak.testsuite.arquillian.karaf.CustomKarafContainer; import org.keycloak.testsuite.arquillian.migration.MigrationTestExecutionDecider; import org.keycloak.testsuite.arquillian.undertow.CustomUndertowContainer; @@ -39,7 +38,6 @@ public class KeycloakArquillianExtension implements LoadableExtension { .service(DeployableContainer.class, CustomKarafContainer.class); builder - //.service(TestExecutionDecider.class, JiraTestExecutionDecider.class) .service(TestExecutionDecider.class, MigrationTestExecutionDecider.class); builder diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/jira/JBossJiraParser.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/jira/JBossJiraParser.java deleted file mode 100644 index adf513db30..0000000000 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/jira/JBossJiraParser.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package org.keycloak.testsuite.arquillian.jira; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import javax.ws.rs.client.Client; -import javax.ws.rs.client.ClientBuilder; -import javax.ws.rs.client.WebTarget; -import javax.ws.rs.core.MediaType; - -/** - * - * @author Petr Mensik - */ -public class JBossJiraParser { - - private static final String JBOSS_TRACKER_REST_URL = "https://issues.jboss.org/rest/api/latest/issue/"; - - public static boolean isIssueClosed(String issueId) { - Status issueStatus; - try { - issueStatus = getIssueStatus(issueId); - } catch (Exception e) { - issueStatus = Status.CLOSED; //let the test run in case there is no connection - } - return issueStatus == Status.CLOSED || issueStatus == Status.RESOLVED; - } - - private static Status getIssueStatus(String issueId) throws Exception { - Client client = ClientBuilder.newClient(); - WebTarget target = client.target(JBOSS_TRACKER_REST_URL); - String json = target.path(issueId).request().accept(MediaType.APPLICATION_JSON_TYPE).get(String.class); - JsonObject jsonObject = new Gson().fromJson(json, JsonElement.class).getAsJsonObject(); - String status = jsonObject.getAsJsonObject("fields").getAsJsonObject("status").get("name").getAsString(); - client.close(); - return Status.getByStatus(status); - } -} diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/jira/Jira.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/jira/Jira.java deleted file mode 100644 index 52b69b5553..0000000000 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/jira/Jira.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package org.keycloak.testsuite.arquillian.jira; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Value should contain name of the issue listed in JBoss JIRA (like - * KEYCLOAK-1234), it can also contain multiple names separated by coma. - * - * @author Petr Mensik - * - */ -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.METHOD}) -@Documented -public @interface Jira { - - String value(); - boolean enabled() default true; -} diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/jira/JiraTestExecutionDecider.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/jira/JiraTestExecutionDecider.java deleted file mode 100644 index 0ce98c5435..0000000000 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/jira/JiraTestExecutionDecider.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package org.keycloak.testsuite.arquillian.jira; - -import java.lang.reflect.Method; -import java.util.HashMap; -import java.util.Map; -import org.jboss.arquillian.test.spi.execution.ExecutionDecision; -import org.jboss.arquillian.test.spi.execution.TestExecutionDecider; - -import static org.keycloak.testsuite.arquillian.jira.JBossJiraParser.isIssueClosed; - -/** - * - * @author Petr Mensik - */ -public class JiraTestExecutionDecider implements TestExecutionDecider { - - private static Map cache = new HashMap<>(); - - @Override - public ExecutionDecision decide(Method method) { - Jira jiraAnnotation = method.getAnnotation(Jira.class); - if (jiraAnnotation != null && jiraAnnotation.enabled()) { - boolean executeTest = true; - String[] issueIds = getIssuesId(jiraAnnotation.value()); - for (String issueId : issueIds) { - if (cache.containsKey(issueId)) { - executeTest = cache.get(issueId); - } else { - if (isIssueClosed(issueId)) { - cache.put(issueId, true); - } else { - executeTest = false; - cache.put(issueId, false); - } - } - } - - if (executeTest) { - return ExecutionDecision.execute(); - } else { - return ExecutionDecision.dontExecute("Issue is still opened, therefore skipping the test " + method.getName()); - } - } - return ExecutionDecision.execute(); - } - - private String[] getIssuesId(String value) { - return value.replaceAll("\\s+", "").split(","); - } - - @Override - public int precedence() { - return 0; - } - -} diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/jira/Status.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/jira/Status.java deleted file mode 100644 index 47f707a1e4..0000000000 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/jira/Status.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package org.keycloak.testsuite.arquillian.jira; - -/** - * - * @author Petr Mensik - */ -public enum Status { - - OPEN("Open"), CLOSED("Closed"), PULL_REQUEST_SENT("Pull Request Sent"), REOPENED("Reopened"), - RESOLVED("Resolved"), CODING_IN_PROGRESS("Coding In Progress "); - - private String status; - - private Status(String status) { - this.status = status; - } - - public String getStatus() { - return status; - } - - public static Status getByStatus(String status) { - for (Status s : Status.values()) { - if (s.getStatus().equals(status)) { - return s; - } - } - return null; - } - -} diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/AbstractCorsExampleAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/AbstractCorsExampleAdapterTest.java index 72db4bb163..24933cb9da 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/AbstractCorsExampleAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/AbstractCorsExampleAdapterTest.java @@ -10,7 +10,6 @@ import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.testsuite.adapter.AbstractExampleAdapterTest; import org.keycloak.testsuite.adapter.page.AngularCorsProductExample; import org.keycloak.testsuite.adapter.page.CorsDatabaseServiceExample; -import org.keycloak.testsuite.arquillian.jira.Jira; import org.keycloak.testsuite.auth.page.account.Account; import java.io.File; @@ -63,7 +62,6 @@ public abstract class AbstractCorsExampleAdapterTest extends AbstractExampleAdap driver.manage().deleteAllCookies(); } - @Jira("KEYCLOAK-1546") @Test public void angularCorsProductTest() { angularCorsProductExample.navigateTo(); diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/AbstractDemoServletsAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/AbstractDemoServletsAdapterTest.java index 9fb8165e3c..8a470ad79b 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/AbstractDemoServletsAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/AbstractDemoServletsAdapterTest.java @@ -34,7 +34,6 @@ import org.keycloak.testsuite.adapter.page.CustomerPortal; import org.keycloak.testsuite.adapter.page.InputPortal; import org.keycloak.testsuite.adapter.page.ProductPortal; import org.keycloak.testsuite.adapter.page.SecurePortal; -import org.keycloak.testsuite.arquillian.jira.Jira; import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlEquals; import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWithLoginUrlOf; import org.keycloak.util.BasicAuthHelper; @@ -224,7 +223,6 @@ public abstract class AbstractDemoServletsAdapterTest extends AbstractServletsAd } @Test - @Jira(value = "KEYCLOAK-1478") // rejected public void testLoginSSOIdleRemoveExpiredUserSessions() { // test login to customer-portal which does a bearer request to customer-db customerPortal.navigateTo(); @@ -279,7 +277,6 @@ public abstract class AbstractDemoServletsAdapterTest extends AbstractServletsAd testRealmResource().update(demoRealmRep); } - @Jira("KEYCLOAK-518") @Test public void testNullBearerToken() { Client client = ClientBuilder.newClient(); @@ -293,7 +290,6 @@ public abstract class AbstractDemoServletsAdapterTest extends AbstractServletsAd client.close(); } - @Jira("KEYCLOAK-1368") @Test public void testNullBearerTokenCustomErrorPage() { Client client = ClientBuilder.newClient(); @@ -326,7 +322,6 @@ public abstract class AbstractDemoServletsAdapterTest extends AbstractServletsAd client.close(); } - @Jira("KEYCLOAK-518") @Test public void testBadUser() { Client client = ClientBuilder.newClient(); diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/AbstractSessionServletAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/AbstractSessionServletAdapterTest.java index 79c0befd18..cd969a36fa 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/AbstractSessionServletAdapterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/AbstractSessionServletAdapterTest.java @@ -16,7 +16,6 @@ import org.keycloak.protocol.oidc.OIDCLoginProtocolService; import org.keycloak.representations.idm.ClientRepresentation; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.testsuite.adapter.page.SessionPortal; -import org.keycloak.testsuite.arquillian.jira.Jira; import static org.keycloak.testsuite.auth.page.AuthRealm.DEMO; import org.keycloak.testsuite.auth.page.account.Sessions; import org.keycloak.testsuite.auth.page.login.Login; @@ -60,7 +59,6 @@ public abstract class AbstractSessionServletAdapterTest extends AbstractServlets @SecondBrowser protected WebDriver driver2; - @Jira("KEYCLOAK-732") @Test public void testSingleSessionInvalidated() { @@ -102,7 +100,6 @@ public abstract class AbstractSessionServletAdapterTest extends AbstractServlets } @Test - @Jira("KEYCLOAK-741, KEYCLOAK-1485") public void testSessionInvalidatedAfterFailedRefresh() { RealmRepresentation testRealmRep = testRealmResource().toRepresentation(); ClientResource sessionPortalRes = null; @@ -139,7 +136,6 @@ public abstract class AbstractSessionServletAdapterTest extends AbstractServlets } @Test - @Jira("KEYCLOAK-942") public void testAdminApplicationLogout() { // login as bburke loginAndCheckSession(driver, testRealmLoginPage); @@ -157,7 +153,6 @@ public abstract class AbstractSessionServletAdapterTest extends AbstractServlets } @Test - @Jira("KEYCLOAK-1216, KEYCLOAK-1485") public void testAccountManagementSessionsLogout() { // login as bburke loginAndCheckSession(driver, testRealmLoginPage); diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/console/authentication/OTPPolicyTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/console/authentication/OTPPolicyTest.java index 8e6359312a..72455e216a 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/console/authentication/OTPPolicyTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/console/authentication/OTPPolicyTest.java @@ -26,7 +26,6 @@ import static org.junit.Assert.*; import org.junit.Before; import org.junit.Test; import org.keycloak.representations.idm.RealmRepresentation; -import org.keycloak.testsuite.arquillian.jira.Jira; import org.keycloak.testsuite.console.AbstractConsoleTest; import org.keycloak.testsuite.console.page.authentication.otppolicy.OTPPolicy; import org.keycloak.testsuite.console.page.authentication.otppolicy.OTPPolicyForm.Digits; @@ -67,7 +66,6 @@ public class OTPPolicyTest extends AbstractConsoleTest { } @Test - @Jira(value = "KEYCLOAK-2031") public void invalidValuesTest() { otpPolicyPage.form().setValues(OTPType.TIME_BASED, OTPHashAlg.SHA1, Digits.EMPTY, "", "30"); assertEquals("Error! Missing or invalid field(s). Please verify the fields in red.", otpPolicyPage.getErrorMessage());