diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/AccountApplicationsPage.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/AccountApplicationsPage.java
deleted file mode 100644
index d3243a1d64..0000000000
--- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/AccountApplicationsPage.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright 2016 Red Hat, Inc. and/or its affiliates
- * and other contributors as indicated by the @author tags.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.keycloak.testsuite.pages;
-
-import org.keycloak.services.Urls;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebElement;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import static org.keycloak.testsuite.util.UIUtils.clickLink;
-import static org.keycloak.testsuite.util.WaitUtils.waitForPageToLoad;
-
-/**
- * @author Marek Posolda
- */
-public class AccountApplicationsPage extends AbstractAccountPage {
-
- @Override
- public boolean isCurrent() {
- return driver.getTitle().contains("Account Management") && driver.getCurrentUrl().endsWith("/account/applications");
- }
-
- @Override
- public void open() {
- driver.navigate().to(getPath());
- waitForPageToLoad();
- }
-
- private String getPath() {
- return Urls.accountApplicationsPage(getAuthServerRoot(), "test").toString();
- }
-
- public void revokeGrant(String clientId) {
- clickLink(driver.findElement(By.id("revoke-" + clientId)));
- }
-
- public Map getApplications() {
- Map table = new HashMap();
- for (WebElement r : driver.findElements(By.tagName("tr"))) {
- int count = 0;
- AppEntry currentEntry = null;
-
- for (WebElement col : r.findElements(By.tagName("td"))) {
- count++;
- switch (count) {
- case 1:
- currentEntry = new AppEntry();
- String client = col.getText();
- WebElement link = null;
- try {
- link = col.findElement(By.tagName("a"));
- String href = link.getAttribute("href");
- currentEntry.setHref(href);
- } catch (Exception e) {
- //ignore
- }
- table.put(client, currentEntry);
- break;
- case 2:
- String rolesStr = col.getText();
- String[] roles = rolesStr.split(",");
- for (String role : roles) {
- role = role.trim();
- currentEntry.addAvailableRole(role);
- }
- break;
- case 3:
- String clientScopesStr = col.getText();
- if (clientScopesStr.isEmpty()) break;
- String[] clientScopes = clientScopesStr.split(",");
- for (String clientScope : clientScopes) {
- clientScope = clientScope.trim();
- currentEntry.addGrantedClientScope(clientScope);
- }
- break;
- case 4:
- String additionalGrant = col.getText();
- if (additionalGrant.isEmpty()) break;
- String[] grants = additionalGrant.split(",");
- for (String grant : grants) {
- grant = grant.trim();
- currentEntry.addAdditionalGrant(grant);
- }
- break;
- }
- }
- }
- table.remove("Application");
- return table;
- }
-
- public static class AppEntry {
-
- private final List rolesAvailable = new ArrayList();
- private final List clientScopesGranted = new ArrayList();
- private final List additionalGrants = new ArrayList<>();
- private String href = null;
-
- private void addAvailableRole(String role) {
- rolesAvailable.add(role);
- }
-
- private void addGrantedClientScope(String clientScope) {
- clientScopesGranted.add(clientScope);
- }
-
- private void addAdditionalGrant(String grant) {
- additionalGrants.add(grant);
- }
-
- public void setHref(String href) {
- this.href = href;
- }
-
- public String getHref() {
- return this.href;
- }
-
- public List getRolesAvailable() {
- return rolesAvailable;
- }
-
- public List getClientScopesGranted() {
- return clientScopesGranted;
- }
-
- public List getAdditionalGrants() {
- return additionalGrants;
- }
- }
-}
diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/OfflineServletsAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/OfflineServletsAdapterTest.java
index db4b270774..338f717cdc 100644
--- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/OfflineServletsAdapterTest.java
+++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/servlet/OfflineServletsAdapterTest.java
@@ -2,33 +2,32 @@ package org.keycloak.testsuite.adapter.servlet;
import javax.ws.rs.core.UriBuilder;
import java.util.List;
+import java.util.Map;
+import java.util.LinkedHashMap;
+import java.util.ArrayList;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.graphene.page.Page;
import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.keycloak.OAuth2Constants;
-import org.keycloak.common.Profile;
-import org.keycloak.events.Details;
-import org.keycloak.events.EventType;
import org.keycloak.representations.idm.RealmRepresentation;
import org.keycloak.testsuite.AssertEvents;
import org.keycloak.testsuite.adapter.AbstractServletsAdapterTest;
import org.keycloak.testsuite.adapter.filter.AdapterActionsFilter;
import org.keycloak.testsuite.adapter.page.OfflineToken;
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
-import org.keycloak.testsuite.arquillian.annotation.DisableFeature;
import org.keycloak.testsuite.updaters.ClientAttributeUpdater;
+import org.keycloak.testsuite.util.AccountHelper;
import org.keycloak.testsuite.util.InfinispanTestTimeServiceRule;
import org.keycloak.testsuite.util.WaitUtils;
import org.keycloak.testsuite.utils.arquillian.ContainerConstants;
-import org.keycloak.testsuite.pages.AccountApplicationsPage;
import org.keycloak.testsuite.pages.LoginPage;
import org.keycloak.testsuite.pages.OAuthGrantPage;
import org.keycloak.testsuite.utils.io.IOUtil;
import org.keycloak.util.TokenUtil;
-import org.hamcrest.Matchers;
import org.openqa.selenium.By;
import java.io.Closeable;
@@ -54,7 +53,6 @@ import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement;
@AppServerContainer(ContainerConstants.APP_SERVER_EAP)
@AppServerContainer(ContainerConstants.APP_SERVER_EAP6)
@AppServerContainer(ContainerConstants.APP_SERVER_EAP71)
-@DisableFeature(value = Profile.Feature.ACCOUNT2, skipRestart = true) // TODO remove this (KEYCLOAK-16228)
public class OfflineServletsAdapterTest extends AbstractServletsAdapterTest {
@Rule
@@ -64,8 +62,6 @@ public class OfflineServletsAdapterTest extends AbstractServletsAdapterTest {
@Page
protected LoginPage loginPage;
@Page
- protected AccountApplicationsPage accountAppPage;
- @Page
protected OAuthGrantPage oauthGrantPage;
@Rule
@@ -181,19 +177,17 @@ public class OfflineServletsAdapterTest extends AbstractServletsAdapterTest {
events.clear();
- // Go to account service and revoke grant
- accountAppPage.open();
+ // Check that Offline Token is granted
+ List