Search in sources :

Example 1 with ManagementFraction

use of org.wildfly.swarm.management.ManagementFraction in project wildfly-swarm by wildfly-swarm.

the class MonitorSecurityTest method getContainer.

@CreateSwarm
public static Swarm getContainer() throws Exception {
    Swarm container = new Swarm();
    container.fraction(new JAXRSFraction());
    container.fraction(new MonitorFraction().securityRealm("TestRealm"));
    container.fraction(new ManagementFraction().securityRealm("TestRealm", (realm) -> {
        realm.inMemoryAuthentication((authn) -> {
            authn.add(new Properties() {

                {
                    put("admin", "password");
                }
            }, true);
        });
        realm.inMemoryAuthorization();
    }));
    return container;
}
Also used : MonitorFraction(org.wildfly.swarm.monitor.MonitorFraction) ShrinkWrap(org.jboss.shrinkwrap.api.ShrinkWrap) Properties(java.util.Properties) Arquillian(org.jboss.arquillian.junit.Arquillian) Swarm(org.wildfly.swarm.Swarm) ManagementFraction(org.wildfly.swarm.management.ManagementFraction) RunWith(org.junit.runner.RunWith) Test(org.junit.Test) Archive(org.jboss.shrinkwrap.api.Archive) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) ElytronFraction(org.wildfly.swarm.elytron.ElytronFraction) CreateSwarm(org.wildfly.swarm.arquillian.CreateSwarm) Ignore(org.junit.Ignore) Deployment(org.jboss.arquillian.container.test.api.Deployment) Assert(org.junit.Assert) Swarm(org.wildfly.swarm.Swarm) CreateSwarm(org.wildfly.swarm.arquillian.CreateSwarm) MonitorFraction(org.wildfly.swarm.monitor.MonitorFraction) ManagementFraction(org.wildfly.swarm.management.ManagementFraction) Properties(java.util.Properties) CreateSwarm(org.wildfly.swarm.arquillian.CreateSwarm)

Aggregations

Properties (java.util.Properties)1 Deployment (org.jboss.arquillian.container.test.api.Deployment)1 RunAsClient (org.jboss.arquillian.container.test.api.RunAsClient)1 Arquillian (org.jboss.arquillian.junit.Arquillian)1 Archive (org.jboss.shrinkwrap.api.Archive)1 ShrinkWrap (org.jboss.shrinkwrap.api.ShrinkWrap)1 Assert (org.junit.Assert)1 Ignore (org.junit.Ignore)1 Test (org.junit.Test)1 RunWith (org.junit.runner.RunWith)1 Swarm (org.wildfly.swarm.Swarm)1 CreateSwarm (org.wildfly.swarm.arquillian.CreateSwarm)1 ElytronFraction (org.wildfly.swarm.elytron.ElytronFraction)1 ManagementFraction (org.wildfly.swarm.management.ManagementFraction)1 MonitorFraction (org.wildfly.swarm.monitor.MonitorFraction)1