@Before public void setUp() throws Exception { // Now we have a role that can edit roles, we can edit this role to include more privileges final RoleData role = roleAccessSession.findRole(this.getClass().getSimpleName()); final List<AccessRuleData> accessRules = new ArrayList<AccessRuleData>(); accessRules.add( new AccessRuleData( role.getRoleName(), StandardRules.CAADD.resource(), AccessRuleState.RULE_ACCEPT, true)); accessRules.add( new AccessRuleData( role.getRoleName(), StandardRules.CAEDIT.resource(), AccessRuleState.RULE_ACCEPT, true)); accessRules.add( new AccessRuleData( role.getRoleName(), StandardRules.CAREMOVE.resource(), AccessRuleState.RULE_ACCEPT, true)); accessRules.add( new AccessRuleData( role.getRoleName(), StandardRules.CAACCESSBASE.resource(), AccessRuleState.RULE_ACCEPT, true)); accessRules.add( new AccessRuleData( role.getRoleName(), StandardRules.CREATECRL.resource(), AccessRuleState.RULE_ACCEPT, true)); accessRules.add( new AccessRuleData( role.getRoleName(), StandardRules.CREATECERT.resource(), AccessRuleState.RULE_ACCEPT, true)); roleManagementSession.addAccessRulesToRole(alwaysAllowToken, role, accessRules); // Remove any lingering testca before starting the tests caSession.removeCA(alwaysAllowToken, X509CADN.hashCode()); // Now add the test CA so it is available in the tests caSession.addCA(alwaysAllowToken, testx509ca); }