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 index ea606b88b4..adf513db30 100644 --- 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 @@ -22,17 +22,17 @@ 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 - } + 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(); + 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(); 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 index 961ae82eae..52b69b5553 100644 --- 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 @@ -24,5 +24,5 @@ import java.lang.annotation.Target; public @interface Jira { String value(); - boolean enabled() default true; + 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 index fa3c571a67..0ce98c5435 100644 --- 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 @@ -19,43 +19,43 @@ import static org.keycloak.testsuite.arquillian.jira.JBossJiraParser.isIssueClos */ public class JiraTestExecutionDecider implements TestExecutionDecider { - private static Map cache = new HashMap(); + 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); - } - } - } + @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(); - } + 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(","); - } + private String[] getIssuesId(String value) { + return value.replaceAll("\\s+", "").split(","); + } - @Override - public int precedence() { - return 0; - } + @Override + public int precedence() { + return 0; + } }