Search in sources :

Example 6 with ScriptProviderDescriptor

use of org.keycloak.representations.provider.ScriptProviderDescriptor in project keycloak by keycloak.

the class UndeployedScriptMapperNotAvailableTest method deploy.

@Deployment(name = SCRIPT_DEPLOYMENT_NAME, managed = false, testable = false)
@TargetsContainer(AUTH_SERVER_CURRENT)
public static JavaArchive deploy() throws IOException {
    ScriptProviderDescriptor representation = new ScriptProviderDescriptor();
    representation.addMapper("My Mapper", "mapper-a.js");
    return ShrinkWrap.create(JavaArchive.class, SCRIPT_DEPLOYMENT_NAME).addAsManifestResource(new StringAsset(JsonSerialization.writeValueAsPrettyString(representation)), "keycloak-scripts.json").addAsResource("scripts/mapper-example.js", "mapper-a.js");
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) ScriptProviderDescriptor(org.keycloak.representations.provider.ScriptProviderDescriptor) Deployment(org.jboss.arquillian.container.test.api.Deployment) TargetsContainer(org.jboss.arquillian.container.test.api.TargetsContainer)

Aggregations

ScriptProviderDescriptor (org.keycloak.representations.provider.ScriptProviderDescriptor)6 Deployment (org.jboss.arquillian.container.test.api.Deployment)4 TargetsContainer (org.jboss.arquillian.container.test.api.TargetsContainer)4 StringAsset (org.jboss.shrinkwrap.api.asset.StringAsset)4 IOException (java.io.IOException)2 InputStream (java.io.InputStream)2 HashMap (java.util.HashMap)2 List (java.util.List)2 ScriptProviderMetadata (org.keycloak.representations.provider.ScriptProviderMetadata)2 URL (java.net.URL)1 ArrayList (java.util.ArrayList)1 Map (java.util.Map)1 JarEntry (java.util.jar.JarEntry)1 JarFile (java.util.jar.JarFile)1 ResourceRoot (org.jboss.as.server.deployment.module.ResourceRoot)1 JavaArchive (org.jboss.shrinkwrap.api.spec.JavaArchive)1 VirtualFile (org.jboss.vfs.VirtualFile)1 DefaultJpaConnectionProviderFactory (org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory)1 LiquibaseJpaUpdaterProviderFactory (org.keycloak.connections.jpa.updater.liquibase.LiquibaseJpaUpdaterProviderFactory)1 EnvironmentDependentProviderFactory (org.keycloak.provider.EnvironmentDependentProviderFactory)1