Merge pull request #4403 from mhajas/KEYCLOAK-5313

KEYCLOAK-5313 Assume preview profile for InstallationTests
This commit is contained in:
Pavel Drozd 2017-08-28 10:28:13 +02:00 committed by GitHub
commit 53fe96db78

View file

@ -19,8 +19,10 @@ package org.keycloak.testsuite.admin.client;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.keycloak.admin.client.resource.ClientResource;
import org.keycloak.testsuite.ProfileAssume;
import org.keycloak.testsuite.admin.ApiUtil;
import org.keycloak.testsuite.arquillian.AuthServerTestEnricher;
@ -52,11 +54,9 @@ public class InstallationTest extends AbstractClientTest {
public void createClients() {
oidcClientId = createOidcClient(OIDC_NAME);
oidcBearerOnlyClientId = createOidcBearerOnlyClient(OIDC_NAME_BEARER_ONLY_NAME);
oidcBearerOnlyClientWithAuthzId = createOidcBearerOnlyClientWithAuthz(OIDC_NAME_BEARER_ONLY_WITH_AUTHZ_NAME);
oidcClient = findClientResource(OIDC_NAME);
oidcBearerOnlyClient = findClientResource(OIDC_NAME_BEARER_ONLY_NAME);
oidcBearerOnlyClientWithAuthz = findClientResource(OIDC_NAME_BEARER_ONLY_WITH_AUTHZ_NAME);
samlClientId = createSamlClient(SAML_NAME);
samlClient = findClientResource(SAML_NAME);
@ -66,7 +66,6 @@ public class InstallationTest extends AbstractClientTest {
public void tearDown() {
removeClient(oidcClientId);
removeClient(oidcBearerOnlyClientId);
removeClient(oidcBearerOnlyClientWithAuthzId);
removeClient(samlClientId);
}
@ -102,12 +101,19 @@ public class InstallationTest extends AbstractClientTest {
@Test
public void testOidcBearerOnlyWithAuthzJson() {
ProfileAssume.assumePreview();
oidcBearerOnlyClientWithAuthzId = createOidcBearerOnlyClientWithAuthz(OIDC_NAME_BEARER_ONLY_WITH_AUTHZ_NAME);
oidcBearerOnlyClientWithAuthz = findClientResource(OIDC_NAME_BEARER_ONLY_WITH_AUTHZ_NAME);
String json = oidcBearerOnlyClientWithAuthz.getInstallationProvider("keycloak-oidc-keycloak-json");
assertOidcInstallationConfig(json);
assertThat(json, containsString("bearer-only"));
assertThat(json, not(containsString("public-client")));
assertThat(json, containsString("credentials"));
assertThat(json, containsString("secret"));
removeClient(oidcBearerOnlyClientWithAuthzId);
}
private void assertOidcInstallationConfig(String config) {