KEYCLOAK-5311 Fix authorization tests
This commit is contained in:
parent
efd44d86c5
commit
d58499acfb
3 changed files with 10 additions and 10 deletions
|
@ -88,13 +88,6 @@ public abstract class AbstractPhotozExampleAdapterTest extends AbstractExampleAd
|
|||
@Before
|
||||
public void beforePhotozExampleAdapterTest() throws FileNotFoundException {
|
||||
deleteAllCookiesForClientPage();
|
||||
|
||||
for (PolicyRepresentation policy : getAuthorizationResource().policies().policies()) {
|
||||
if ("Only Owner Policy".equals(policy.getName())) {
|
||||
policy.getConfig().put("mavenArtifactVersion", System.getProperty("project.version"));
|
||||
getAuthorizationResource().policies().policy(policy.getId()).update(policy);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -650,7 +643,13 @@ public abstract class AbstractPhotozExampleAdapterTest extends AbstractExampleAd
|
|||
}
|
||||
|
||||
private void importResourceServerSettings() throws FileNotFoundException {
|
||||
getAuthorizationResource().importSettings(loadJson(new FileInputStream(new File(TEST_APPS_HOME_DIR + "/photoz/photoz-restful-api-authz-service.json")), ResourceServerRepresentation.class));
|
||||
ResourceServerRepresentation authSettings = loadJson(new FileInputStream(new File(TEST_APPS_HOME_DIR + "/photoz/photoz-restful-api-authz-service.json")), ResourceServerRepresentation.class);
|
||||
|
||||
authSettings.getPolicies().stream()
|
||||
.filter(x -> "Only Owner Policy".equals(x.getName()))
|
||||
.forEach(x -> x.getConfig().put("mavenArtifactVersion", System.getProperty("project.version")));
|
||||
|
||||
getAuthorizationResource().importSettings(authSettings);
|
||||
}
|
||||
|
||||
private AuthorizationResource getAuthorizationResource() throws FileNotFoundException {
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
package org.keycloak.testsuite.adapter.example.authorization;
|
||||
|
||||
import org.jboss.arquillian.container.test.api.RunAsClient;
|
||||
import org.keycloak.testsuite.adapter.example.authorization.AbstractServletAuthzAdapterTest;
|
||||
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
|
||||
|
||||
/**
|
||||
|
@ -27,6 +26,6 @@ import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
|
|||
@RunAsClient
|
||||
@AppServerContainer("app-server-eap")
|
||||
//@AdapterLibsLocationProperty("adapter.libs.wildfly")
|
||||
public class EAPServletAuthzAdapterTest extends AbstractServletAuthzAdapterTest {
|
||||
public class EAPServletAuthzAdapterTest extends AbstractServletAuthzFunctionalAdapterTest {
|
||||
|
||||
}
|
||||
|
|
|
@ -68,6 +68,7 @@
|
|||
<app.server.2.management.port.jmx>10399</app.server.2.management.port.jmx>
|
||||
|
||||
<settings.path></settings.path>
|
||||
<maven.repo.local></maven.repo.local>
|
||||
<repo.url></repo.url>
|
||||
|
||||
<adapter.test.props>
|
||||
|
@ -81,6 +82,7 @@
|
|||
-Djava.security.krb5.conf=${project.build.directory}/dependency/kerberos/test-krb5.conf
|
||||
-Dkie.maven.settings.custom=${settings.path}
|
||||
-Drepo.url=${repo.url}
|
||||
-Dmaven.repo.local=${maven.repo.local}
|
||||
</adapter.test.props>
|
||||
|
||||
<app.server.home>${containers.home}/app-server-${app.server}</app.server.home>
|
||||
|
|
Loading…
Reference in a new issue