approvalID = RevocationApprovalRequest.generateApprovalId(approvalType, username, reason, null, null);
}
Query q = new Query(Query.TYPE_APPROVALQUERY);
q.add(ApprovalMatch.MATCH_WITH_APPROVALID, BasicMatch.MATCH_TYPE_EQUALS, Integer.toString(approvalID));
ApprovalDataVO approvalData = (ApprovalDataVO) (approvalSession.query(internalAdmin, q, 0, 1, "cAId="+approvalCAID, "(endEntityProfileId="+SecConst.EMPTY_ENDENTITYPROFILE+")").get(0));
Approval approval = new Approval("Approved during testing.");
approvalExecutionSession.approve(approvingAdmin, approvalID, approval, globalConfigurationSession.getCachedGlobalConfiguration(new Admin(Admin.INTERNALCAID)));
approvalData = (ApprovalDataVO) approvalSession.findApprovalDataVO(internalAdmin, approvalID).iterator().next();
assertEquals(approvalData.getStatus(), ApprovalDataVO.STATUS_EXECUTED);
CertificateStatus status = certificateStoreSession.getStatus(issuerDN, serialNumber);
assertEquals(status.revocationReason, reason);