From 8418fec113f10aad2caeac2cdb1af96e6a148cb1 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 5 May 2016 11:53:17 -0300 Subject: [PATCH] Replace by ClientManager and make the code less verbose --- .../org/keycloak/testsuite/oauth/AccessTokenTest.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/AccessTokenTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/AccessTokenTest.java index 887aa26447..48b02759c2 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/AccessTokenTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/AccessTokenTest.java @@ -32,7 +32,6 @@ import org.keycloak.admin.client.resource.ClientTemplateResource; import org.keycloak.admin.client.resource.RealmResource; import org.keycloak.admin.client.resource.UserResource; import org.keycloak.common.enums.SslRequired; -import org.keycloak.common.util.Time; import org.keycloak.events.Details; import org.keycloak.events.Errors; import org.keycloak.jose.jws.JWSInput; @@ -55,6 +54,7 @@ import org.keycloak.representations.idm.UserRepresentation; import org.keycloak.testsuite.AbstractKeycloakTest; import org.keycloak.testsuite.AssertEvents; import org.keycloak.testsuite.util.ClientBuilder; +import org.keycloak.testsuite.util.ClientManager; import org.keycloak.testsuite.util.OAuthClient; import org.keycloak.testsuite.util.RealmManager; import org.keycloak.testsuite.util.RoleBuilder; @@ -110,11 +110,7 @@ public class AccessTokenTest extends AbstractKeycloakTest { @Before public void clientConfiguration() { - ClientResource clientResource = findClientByClientId(adminClient.realm("test"), "test-app"); - ClientRepresentation clientRepresentation = new ClientRepresentation(); - clientRepresentation.setDirectAccessGrantsEnabled(true); - clientResource.update(clientRepresentation); - + ClientManager.realm(adminClient.realm("test")).clientId("test-app").directAccessGrant(true); /* * Configure the default client ID. Seems like OAuthClient is keeping the state of clientID * For example: If some test case configure oauth.clientId("sample-public-client"), other tests