Search in sources :

Example 91 with BeforeTest

use of org.testng.annotations.BeforeTest in project OpenAM by OpenRock.

the class RealmTest method suiteSetup.

/**
     * Create the CLIManager.
     */
@BeforeTest(groups = { "cli-realm" })
public void suiteSetup() throws CLIException {
    Map<String, Object> env = new HashMap<String, Object>();
    env.put(CLIConstants.SYS_PROPERTY_COMMAND_NAME, "amadm");
    env.put(CLIConstants.SYS_PROPERTY_DEFINITION_FILES, "com.sun.identity.cli.AccessManager");
    env.put(CLIConstants.SYS_PROPERTY_OUTPUT_WRITER, outputWriter);
    cmdManager = new CommandManager(env);
}
Also used : CommandManager(com.sun.identity.cli.CommandManager) HashMap(java.util.HashMap) BeforeTest(org.testng.annotations.BeforeTest)

Example 92 with BeforeTest

use of org.testng.annotations.BeforeTest in project OpenAM by OpenRock.

the class IdRepoTest method suiteSetup.

/**
     * Create the CLIManager.
     */
@BeforeTest(groups = { "cli-idrepo" })
public void suiteSetup() throws CLIException {
    Map<String, Object> env = new HashMap<String, Object>();
    env.put(CLIConstants.SYS_PROPERTY_COMMAND_NAME, "amadm");
    env.put(CLIConstants.SYS_PROPERTY_DEFINITION_FILES, "com.sun.identity.cli.AccessManager");
    env.put(CLIConstants.SYS_PROPERTY_OUTPUT_WRITER, outputWriter);
    cmdManager = new CommandManager(env);
}
Also used : CommandManager(com.sun.identity.cli.CommandManager) HashMap(java.util.HashMap) BeforeTest(org.testng.annotations.BeforeTest)

Example 93 with BeforeTest

use of org.testng.annotations.BeforeTest in project OpenAM by OpenRock.

the class SAML2Test method suiteSetup.

/**
     * Create the CLIManager.
     */
@BeforeTest(groups = { "cli" })
public void suiteSetup() throws CLIException {
    Map<String, Object> env = new HashMap<String, Object>();
    env.put(CLIConstants.SYS_PROPERTY_COMMAND_NAME, "famadm");
    env.put(CLIConstants.SYS_PROPERTY_DEFINITION_FILES, "com.sun.identity.federation.cli.FederationManager");
    env.put(CLIConstants.SYS_PROPERTY_OUTPUT_WRITER, outputWriter);
    cmdManager = new CommandManager(env);
}
Also used : CommandManager(com.sun.identity.cli.CommandManager) HashMap(java.util.HashMap) BeforeTest(org.testng.annotations.BeforeTest)

Example 94 with BeforeTest

use of org.testng.annotations.BeforeTest in project OpenAM by OpenRock.

the class DelegationPrivilegeIdRepoAccessTest method setup.

@BeforeTest
public void setup() throws Exception {
    OrganizationConfigManager orgMgr = new OrganizationConfigManager(adminToken, "/");
    orgMgr.createSubOrganization(SUB_REALM.substring(1), Collections.EMPTY_MAP);
    delegatedUser = IdRepoUtils.createUser(SUB_REALM, DELEGATED_USER);
    delegatedUser1 = IdRepoUtils.createUser(SUB_REALM, DELEGATED_USER1);
    orgMgr = new OrganizationConfigManager(adminToken, SUB_REALM);
    orgMgr.createSubOrganization(SUB_SUB_REALM, Collections.EMPTY_MAP);
    Application appl = ApplicationManager.newApplication(APPLICATION_NAME, ApplicationTypeManager.getAppplicationType(PrivilegeManager.superAdminSubject, ApplicationTypeManager.URL_APPLICATION_TYPE_NAME));
    // Test disabled, unable to make model change.
    // Set<String> resources = new HashSet<String>();
    // resources.add(DELEGATED_RESOURCE);
    // appl.setResources(resources);
    appl.setEntitlementCombiner(DenyOverride.class);
    ApplicationManager.saveApplication(SubjectUtils.createSuperAdminSubject(), SUB_REALM, appl);
}
Also used : OrganizationConfigManager(com.sun.identity.sm.OrganizationConfigManager) BeforeTest(org.testng.annotations.BeforeTest)

Example 95 with BeforeTest

use of org.testng.annotations.BeforeTest in project oxAuth by GluuFederation.

the class BaseTest method discovery.

@BeforeTest
public void discovery(ITestContext context) throws Exception {
    // Load Form Interaction
    loginFormUsername = context.getCurrentXmlTest().getParameter("loginFormUsername");
    loginFormPassword = context.getCurrentXmlTest().getParameter("loginFormPassword");
    loginFormLoginButton = context.getCurrentXmlTest().getParameter("loginFormLoginButton");
    authorizeFormAllowButton = context.getCurrentXmlTest().getParameter("authorizeFormAllowButton");
    authorizeFormDoNotAllowButton = context.getCurrentXmlTest().getParameter("authorizeFormDoNotAllowButton");
    String resource = context.getCurrentXmlTest().getParameter("swdResource");
    if (StringUtils.isNotBlank(resource)) {
        showTitle("OpenID Connect Discovery");
        OpenIdConnectDiscoveryClient openIdConnectDiscoveryClient = new OpenIdConnectDiscoveryClient(resource);
        OpenIdConnectDiscoveryResponse openIdConnectDiscoveryResponse = openIdConnectDiscoveryClient.exec(new ApacheHttpClient4Executor(createHttpClient(HostnameVerifierType.ALLOW_ALL)));
        showClient(openIdConnectDiscoveryClient);
        assertEquals(openIdConnectDiscoveryResponse.getStatus(), 200, "Unexpected response code");
        assertNotNull(openIdConnectDiscoveryResponse.getSubject());
        assertTrue(openIdConnectDiscoveryResponse.getLinks().size() > 0);
        configurationEndpoint = openIdConnectDiscoveryResponse.getLinks().get(0).getHref() + "/.well-known/openid-configuration";
        System.out.println("OpenID Connect Configuration");
        OpenIdConfigurationClient client = new OpenIdConfigurationClient(configurationEndpoint);
        OpenIdConfigurationResponse response = client.execOpenIdConfiguration();
        showClient(client);
        assertEquals(response.getStatus(), 200, "Unexpected response code");
        assertNotNull(response.getIssuer(), "The issuer is null");
        assertNotNull(response.getAuthorizationEndpoint(), "The authorizationEndpoint is null");
        assertNotNull(response.getTokenEndpoint(), "The tokenEndpoint is null");
        assertNotNull(response.getUserInfoEndpoint(), "The userInfoEndPoint is null");
        assertNotNull(response.getJwksUri(), "The jwksUri is null");
        assertNotNull(response.getRegistrationEndpoint(), "The registrationEndpoint is null");
        assertTrue(response.getScopesSupported().size() > 0, "The scopesSupported is empty");
        assertTrue(response.getScopeToClaimsMapping().size() > 0, "The scope to claims mapping is empty");
        assertTrue(response.getResponseTypesSupported().size() > 0, "The responseTypesSupported is empty");
        assertTrue(response.getGrantTypesSupported().size() > 0, "The grantTypesSupported is empty");
        assertTrue(response.getAcrValuesSupported().size() >= 0, "The acrValuesSupported is empty");
        assertTrue(response.getSubjectTypesSupported().size() > 0, "The subjectTypesSupported is empty");
        assertTrue(response.getIdTokenSigningAlgValuesSupported().size() > 0, "The idTokenSigningAlgValuesSupported is empty");
        assertTrue(response.getRequestObjectSigningAlgValuesSupported().size() > 0, "The requestObjectSigningAlgValuesSupported is empty");
        assertTrue(response.getTokenEndpointAuthMethodsSupported().size() > 0, "The tokenEndpointAuthMethodsSupported is empty");
        assertTrue(response.getClaimsSupported().size() > 0, "The claimsSupported is empty");
        authorizationEndpoint = response.getAuthorizationEndpoint();
        tokenEndpoint = response.getTokenEndpoint();
        userInfoEndpoint = response.getUserInfoEndpoint();
        clientInfoEndpoint = response.getClientInfoEndpoint();
        checkSessionIFrame = response.getCheckSessionIFrame();
        endSessionEndpoint = response.getEndSessionEndpoint();
        jwksUri = response.getJwksUri();
        registrationEndpoint = response.getRegistrationEndpoint();
        idGenEndpoint = response.getIdGenerationEndpoint();
        introspectionEndpoint = response.getIntrospectionEndpoint();
        scopeToClaimsMapping = response.getScopeToClaimsMapping();
        gluuConfigurationEndpoint = determineGluuConfigurationEndpoint(openIdConnectDiscoveryResponse.getLinks().get(0).getHref());
    } else {
        showTitle("Loading configuration endpoints from properties file");
        authorizationEndpoint = context.getCurrentXmlTest().getParameter("authorizationEndpoint");
        tokenEndpoint = context.getCurrentXmlTest().getParameter("tokenEndpoint");
        userInfoEndpoint = context.getCurrentXmlTest().getParameter("userInfoEndpoint");
        clientInfoEndpoint = context.getCurrentXmlTest().getParameter("clientInfoEndpoint");
        checkSessionIFrame = context.getCurrentXmlTest().getParameter("checkSessionIFrame");
        endSessionEndpoint = context.getCurrentXmlTest().getParameter("endSessionEndpoint");
        jwksUri = context.getCurrentXmlTest().getParameter("jwksUri");
        registrationEndpoint = context.getCurrentXmlTest().getParameter("registrationEndpoint");
        configurationEndpoint = context.getCurrentXmlTest().getParameter("configurationEndpoint");
        idGenEndpoint = context.getCurrentXmlTest().getParameter("idGenEndpoint");
        introspectionEndpoint = context.getCurrentXmlTest().getParameter("introspectionEndpoint");
        scopeToClaimsMapping = new HashMap<String, List<String>>();
    }
    authorizationPageEndpoint = determineAuthorizationPageEndpoint(authorizationEndpoint);
}
Also used : ApacheHttpClient4Executor(org.jboss.resteasy.client.core.executors.ApacheHttpClient4Executor) List(java.util.List) BeforeTest(org.testng.annotations.BeforeTest)

Aggregations

BeforeTest (org.testng.annotations.BeforeTest)142 Parameters (org.testng.annotations.Parameters)16 DatabaseConfiguration (com.google.refine.extension.database.DatabaseConfiguration)11 HashMap (java.util.HashMap)10 File (java.io.File)9 Series (com.axibase.tsd.api.model.series.Series)6 CommandManager (com.sun.identity.cli.CommandManager)6 Path (java.nio.file.Path)6 ArrayList (java.util.ArrayList)5 HashSet (java.util.HashSet)5 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)4 PinotHelixResourceManager (com.linkedin.pinot.controller.helix.core.PinotHelixResourceManager)4 Annotation (java.lang.annotation.Annotation)4 URL (java.net.URL)4 Injector (com.google.inject.Injector)3 AbstractTableConfig (com.linkedin.pinot.common.config.AbstractTableConfig)3 IntegrationTestContext (com.sequenceiq.it.IntegrationTestContext)3 Map (java.util.Map)3 WorkUnitState (org.apache.gobblin.configuration.WorkUnitState)3 SSOException (com.iplanet.sso.SSOException)2