Package org.ejbca.core.model.approval.approvalrequests

Examples of org.ejbca.core.model.approval.approvalrequests.ChangeStatusEndEntityApprovalRequest


    super.setUp();
  }
 
  public void testNoOfApprovals() {
    int numOfApprovalsRequired = 1;
    ChangeStatusEndEntityApprovalRequest ar = new ChangeStatusEndEntityApprovalRequest("foo", UserDataConstants.STATUS_GENERATED, UserDataConstants.STATUS_NEW, admin, null, numOfApprovalsRequired, 1, 1);
    boolean approvalRequired = ApprovalExecutorUtil.requireApproval(ar, null);  
    assertTrue(approvalRequired);   
    numOfApprovalsRequired = 0;
    ar = new ChangeStatusEndEntityApprovalRequest("foo", UserDataConstants.STATUS_GENERATED, UserDataConstants.STATUS_NEW, admin, null, numOfApprovalsRequired, 1, 1);
    approvalRequired = ApprovalExecutorUtil.requireApproval(ar, null);  
    assertFalse(approvalRequired);   
  }
View Full Code Here


    assertFalse(approvalRequired);   
  }
 
  public void testGloballyExcludedClasses() {
    int numOfApprovalsRequired = 1;
    ChangeStatusEndEntityApprovalRequest ar = new ChangeStatusEndEntityApprovalRequest("foo", UserDataConstants.STATUS_GENERATED, UserDataConstants.STATUS_NEW, admin, null, numOfApprovalsRequired, 1, 1);
    boolean approvalRequired = ApprovalExecutorUtil.requireApproval(ar, null);  
    assertTrue(approvalRequired);
    ApprovalJunitHelper.JunitApprovalExecutorUtil1.init();
    approvalRequired = ApprovalJunitHelper.JunitApprovalExecutorUtil1.requireApproval(ar, null);  
    assertFalse(approvalRequired);
View Full Code Here

      new ApprovalOveradableClassName("org.ejbca.extra.caservice.ExtRACAProcess","processExtRARevocationRequest"),
      new ApprovalOveradableClassName("se.primeKey.cardPersonalization.ra.connection.ejbca.EjbcaConnection",null)
    };

    int numOfApprovalsRequired = 1;
    ChangeStatusEndEntityApprovalRequest ar = new ChangeStatusEndEntityApprovalRequest("foo", UserDataConstants.STATUS_GENERATED, UserDataConstants.STATUS_NEW, admin, null, numOfApprovalsRequired, 1, 1);
    boolean approvalRequired = ApprovalExecutorUtil.requireApproval(ar, NONAPPROVABLECLASSNAMES_SETUSERSTATUS);  
    assertTrue(approvalRequired);
    ApprovalOveradableClassName[] NONAPPROVABLECLASSNAMES_SETUSERSTATUS1 = {
        new ApprovalOveradableClassName("org.ejbca.core.ejb.ra.UserAdminSessionBean","revokeUser"),
        new ApprovalOveradableClassName("org.ejbca.core.ejb.ra.UserAdminSessionBean","revokeCert"),
        new ApprovalOveradableClassName("org.ejbca.core.model.approval.ApprovalExecutorUtilTest","foo"),
        new ApprovalOveradableClassName("org.ejbca.ui.web.admin.rainterface.RAInterfaceBean","markForRecovery"),
        new ApprovalOveradableClassName("org.ejbca.extra.caservice.ExtRACAProcess","processExtRARevocationRequest"),
        new ApprovalOveradableClassName("se.primeKey.cardPersonalization.ra.connection.ejbca.EjbcaConnection",null)
      };   
    ar = new ChangeStatusEndEntityApprovalRequest("foo", UserDataConstants.STATUS_GENERATED, UserDataConstants.STATUS_NEW, admin, null, numOfApprovalsRequired, 1, 1);
    approvalRequired = ApprovalExecutorUtil.requireApproval(ar, NONAPPROVABLECLASSNAMES_SETUSERSTATUS1);  
    assertTrue(approvalRequired);
    ApprovalOveradableClassName[] NONAPPROVABLECLASSNAMES_SETUSERSTATUS2 = {
        new ApprovalOveradableClassName("org.ejbca.core.ejb.ra.UserAdminSessionBean","revokeUser"),
        new ApprovalOveradableClassName("org.ejbca.core.ejb.ra.UserAdminSessionBean","revokeCert"),
        new ApprovalOveradableClassName("org.ejbca.core.model.approval.ApprovalExecutorUtilTest",null),
        new ApprovalOveradableClassName("org.ejbca.ui.web.admin.rainterface.RAInterfaceBean","markForRecovery"),
        new ApprovalOveradableClassName("org.ejbca.extra.caservice.ExtRACAProcess","processExtRARevocationRequest"),
        new ApprovalOveradableClassName("se.primeKey.cardPersonalization.ra.connection.ejbca.EjbcaConnection",null)
      };   
    ar = new ChangeStatusEndEntityApprovalRequest("foo", UserDataConstants.STATUS_GENERATED, UserDataConstants.STATUS_NEW, admin, null, numOfApprovalsRequired, 1, 1);
    approvalRequired = ApprovalExecutorUtil.requireApproval(ar, NONAPPROVABLECLASSNAMES_SETUSERSTATUS2);  
    assertFalse(approvalRequired);
    ApprovalOveradableClassName[] NONAPPROVABLECLASSNAMES_SETUSERSTATUS3 = {
        new ApprovalOveradableClassName("org.ejbca.core.ejb.ra.UserAdminSessionBean","revokeUser"),
        new ApprovalOveradableClassName("org.ejbca.core.ejb.ra.UserAdminSessionBean","revokeCert"),
        new ApprovalOveradableClassName("org.ejbca.core.model.approval.ApprovalExecutorUtilTest","testOverridableClassNames"),
        new ApprovalOveradableClassName("org.ejbca.ui.web.admin.rainterface.RAInterfaceBean","markForRecovery"),
        new ApprovalOveradableClassName("org.ejbca.extra.caservice.ExtRACAProcess","processExtRARevocationRequest"),
        new ApprovalOveradableClassName("se.primeKey.cardPersonalization.ra.connection.ejbca.EjbcaConnection",null)
      };   
    ar = new ChangeStatusEndEntityApprovalRequest("foo", UserDataConstants.STATUS_GENERATED, UserDataConstants.STATUS_NEW, admin, null, numOfApprovalsRequired, 1, 1);
    approvalRequired = ApprovalExecutorUtil.requireApproval(ar, NONAPPROVABLECLASSNAMES_SETUSERSTATUS3);  
    assertFalse(approvalRequired);

  }
View Full Code Here

  }
 
  public void testAllowedTransitions() {
    int numOfApprovalsRequired = 1;
    ChangeStatusEndEntityApprovalRequest ar = new ChangeStatusEndEntityApprovalRequest("foo", UserDataConstants.STATUS_NEW, UserDataConstants.STATUS_INPROCESS, admin, null, numOfApprovalsRequired, 1, 1);
    boolean approvalRequired = ApprovalExecutorUtil.requireApproval(ar, null);  
    assertFalse(approvalRequired);
    ar = new ChangeStatusEndEntityApprovalRequest("foo", UserDataConstants.STATUS_GENERATED, UserDataConstants.STATUS_NEW, admin, null, numOfApprovalsRequired, 1, 1);
    approvalRequired = ApprovalExecutorUtil.requireApproval(ar, null);  
    assertTrue(approvalRequired);
    ar = new ChangeStatusEndEntityApprovalRequest("foo", UserDataConstants.STATUS_INPROCESS, UserDataConstants.STATUS_GENERATED, admin, null, numOfApprovalsRequired, 1, 1);
    approvalRequired = ApprovalExecutorUtil.requireApproval(ar, null);  
    assertFalse(approvalRequired);
    ar = new ChangeStatusEndEntityApprovalRequest("foo", UserDataConstants.STATUS_INPROCESS, UserDataConstants.STATUS_FAILED, admin, null, numOfApprovalsRequired, 1, 1);
    approvalRequired = ApprovalExecutorUtil.requireApproval(ar, null);  
    assertFalse(approvalRequired);
    ar = new ChangeStatusEndEntityApprovalRequest("foo", UserDataConstants.STATUS_REVOKED, UserDataConstants.STATUS_NEW, admin, null, numOfApprovalsRequired, 1, 1);
    approvalRequired = ApprovalExecutorUtil.requireApproval(ar, null);  
    assertTrue(approvalRequired);
   
  }
View Full Code Here

        final String username = data1.getUsername();
        final int endEntityProfileId = data1.getEndEntityProfileId();
        // Check if approvals is required.
        final int numOfApprovalsRequired = getNumOfApprovalRequired(admin, CAInfo.REQ_APPROVAL_ADDEDITENDENTITY, caid, data1.getCertificateProfileId());
        if (numOfApprovalsRequired > 0) {
            final ChangeStatusEndEntityApprovalRequest ar = new ChangeStatusEndEntityApprovalRequest(username, data1.getStatus(), status, admin, null,
                    numOfApprovalsRequired, data1.getCaId(), endEntityProfileId);
            if (ApprovalExecutorUtil.requireApproval(ar, NONAPPROVABLECLASSNAMES_SETUSERSTATUS)) {
                approvalSession.addApprovalRequest(admin, ar, getGlobalConfiguration(admin));
                String msg = intres.getLocalizedMessage("ra.approvaledit");
                throw new WaitingForApprovalException(msg);
View Full Code Here

TOP

Related Classes of org.ejbca.core.model.approval.approvalrequests.ChangeStatusEndEntityApprovalRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.