[keycloak-dev] Arquillian test override keycloak class

Youssef EL HOUTI youssef.elhouti at gmail.com
Fri Mar 9 16:35:27 EST 2018


Hi,

I'm writing a module for keycloak to deny access for clients using policies
(the same way it's done with UMA but before gicing the token the first
time). To achieve that I need my module to override some classes (ex:
org.keycloak.protocol.oidc.endpoints.TokenEndpoint).
In my Arquillian test, I do the following:

    @Deployment(name=MODULE_JAR, testable = false)
    @TargetsContainer("keycloak-remote")
    public static Archive<?> createProviderArchive() throws IOException {
        return ShrinkWrap.create(JavaArchive.class,
"keycloak-authorization.jar")
                .addClasses(

org.keycloak.protocol.oidc.endpoints.TokenEndpoint.class,
                        LocalAuthorizationService.class)
                .addAsManifestResource(new File("src/test/resources",
"MANIFEST.MF"))
        ;

Unfortunately it doesn't work, any ideas please.

Thank you.


More information about the keycloak-dev mailing list