Search in sources :

Example 6 with Configurator

use of org.jenkinsci.plugins.casc.Configurator in project configuration-as-code-plugin by jenkinsci.

the class RoleStrategyTest method shouldReturnCustomConfigurator.

@Test
public void shouldReturnCustomConfigurator() {
    Configurator c = Configurator.lookup(RoleBasedAuthorizationStrategy.class);
    assertNotNull("Failed to find configurator for RoleBasedAuthorizationStrategy", c);
    assertEquals("Retrieved wrong configurator", RoleBasedAuthorizationStrategyConfigurator.class, c.getClass());
}
Also used : Configurator(org.jenkinsci.plugins.casc.Configurator) Test(org.junit.Test)

Example 7 with Configurator

use of org.jenkinsci.plugins.casc.Configurator in project configuration-as-code-plugin by jenkinsci.

the class RoleStrategyTest method shouldReturnCustomConfiguratorForBaseType.

@Test
@Issue("Issue #59")
public void shouldReturnCustomConfiguratorForBaseType() {
    Configurator c = Configurator.lookupForBaseType(AuthorizationStrategy.class, "roleStrategy");
    assertNotNull("Failed to find configurator for RoleBasedAuthorizationStrategy", c);
    assertEquals("Retrieved wrong configurator", RoleBasedAuthorizationStrategyConfigurator.class, c.getClass());
    Configurator.lookup(RoleBasedAuthorizationStrategy.class);
}
Also used : Configurator(org.jenkinsci.plugins.casc.Configurator) Issue(org.jvnet.hudson.test.Issue) Test(org.junit.Test)

Aggregations

Configurator (org.jenkinsci.plugins.casc.Configurator)7 Test (org.junit.Test)6 ProjectMatrixAuthorizationStrategyConfigurator (org.jenkinsci.plugins.casc.integrations.projectmatriaxauth.ProjectMatrixAuthorizationStrategyConfigurator)2 RoleBasedAuthorizationStrategy (com.michelin.cio.hudson.plugins.rolestrategy.RoleBasedAuthorizationStrategy)1 RoleMap (com.michelin.cio.hudson.plugins.rolestrategy.RoleMap)1 IOException (java.io.IOException)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 TreeMap (java.util.TreeMap)1 RootElementConfigurator (org.jenkinsci.plugins.casc.RootElementConfigurator)1 Issue (org.jvnet.hudson.test.Issue)1