Search in sources :

Example 36 with AfterClass

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

the class PolicyWildcardTest method cleanup.

@AfterClass
public void cleanup() throws PolicyException, SSOException, IdRepoException {
    SSOTokenManager.getInstance().destroyToken(userSSOToken);
    SSOTokenManager.getInstance().destroyToken(adminUserSSOToken);
    PolicyManager pm = new PolicyManager(adminToken, REALM);
    pm.removePolicy(POLICY_NAME_USER);
    pm.removePolicy(POLICY_NAME_ADMIN);
    AMIdentityRepository amir = new AMIdentityRepository(adminToken, REALM);
    Set<AMIdentity> identities = new HashSet<AMIdentity>();
    identities.add(testAdminGroup);
    identities.add(testAdminUser);
    identities.add(testUser);
    amir.deleteIdentities(identities);
}
Also used : AMIdentity(com.sun.identity.idm.AMIdentity) AMIdentityRepository(com.sun.identity.idm.AMIdentityRepository) HashSet(java.util.HashSet) AfterClass(org.testng.annotations.AfterClass)

Example 37 with AfterClass

use of org.testng.annotations.AfterClass in project midpoint by Evolveum.

the class AbstractModelIntegrationTest method cleanUpSecurity.

@AfterClass
protected void cleanUpSecurity() {
    SecurityContext securityContext = SecurityContextHolder.getContext();
    securityContext.setAuthentication(null);
}
Also used : SecurityContext(org.springframework.security.core.context.SecurityContext) AfterClass(org.testng.annotations.AfterClass)

Aggregations

AfterClass (org.testng.annotations.AfterClass)37 OrganizationConfigManager (com.sun.identity.sm.OrganizationConfigManager)9 HashSet (java.util.HashSet)9 AMIdentity (com.sun.identity.idm.AMIdentity)8 SSOToken (com.iplanet.sso.SSOToken)6 PrivilegeManager (com.sun.identity.entitlement.PrivilegeManager)6 AMIdentityRepository (com.sun.identity.idm.AMIdentityRepository)5 File (java.io.File)4 PolicyPrivilegeManager (com.sun.identity.entitlement.opensso.PolicyPrivilegeManager)3 SSOException (com.iplanet.sso.SSOException)2 FutureCallback (com.linkedin.common.callback.FutureCallback)2 None (com.linkedin.common.util.None)2 Client (com.linkedin.r2.transport.common.Client)2 TransportClientFactory (com.linkedin.r2.transport.common.TransportClientFactory)2 IdRepoException (com.sun.identity.idm.IdRepoException)2 PolicyManager (com.sun.identity.policy.PolicyManager)2 Path (java.nio.file.Path)1 Set (java.util.Set)1 KafkaServerStartable (kafka.server.KafkaServerStartable)1 Logger (org.apache.log4j.Logger)1