/**
   * Validates that validateRegistrationCode returns false when a valid registration code is set.
   */
  public void testValidateRegistration_False() {

    EndowmentTargetTransactionSecurity targetTransactionSecurity =
        new EndowmentTargetTransactionSecurity();
    targetTransactionSecurity.setRegistrationCode(EndowTestConstants.INVALID_REGISTRATION_CODE);

    document.setTargetTransactionSecurity(targetTransactionSecurity);

    assertFalse(rule.validateRegistrationCode(document, true));
  }
  /** Validates that validateRegistrationCode returns true when a valid registration code is set. */
  public void testValidateRegistration_True() {

    // add security details
    RegistrationCode registrationCode =
        RegistrationCodeFixture.REGISTRATION_CODE_RECORD.createRegistrationCode();

    EndowmentTargetTransactionSecurity targetTransactionSecurity =
        new EndowmentTargetTransactionSecurity();
    targetTransactionSecurity.setRegistrationCode(registrationCode.getCode());
    targetTransactionSecurity.setRegistrationCodeObj(registrationCode);

    document.setTargetTransactionSecurity(targetTransactionSecurity);

    assertTrue(rule.validateRegistrationCode(document, false));
  }