/**
   * Validates that the validateTaxLotsCostAndTransactionAmountLessOrEqualToSecurityCommitment
   * returns false when the SECURITY_ID has a class code type of A (Alternative Investments), and
   * the total END_HLDG_TAX_LOT_T: HLDG_COST for the SECURITY_ID plus the END_TRAN_LN_T: TRAN_AMT
   * exceeds the value in END_SEC_T: CMTMNT_AMT for the Security
   */
  public void testValidateTaxLotsCostAndTransactionAmountLessOrEqualToSecurityCommitment_False() {
    KEMID kemid = KemIdFixture.OPEN_KEMID_RECORD.createKemidRecord();
    // need to insert into END_HLDG_TAX_LOT_REBAL_T TABLE because of constraints....
    HoldingTaxLotRebalanceFixture.HOLDING_TAX_LOT_REBALANCE_RECORD
        .createHoldingTaxLotRebalanceRecord();
    HoldingTaxLot holdingTaxLot =
        HoldingTaxLotFixture.HOLDING_TAX_LOT_RECORD.createHoldingTaxLotRecord();
    SecurityReportingGroup reportingGroup =
        SecurityReportingGroupFixture.REPORTING_GROUP.createSecurityReportingGroup();
    EndowmentTransactionCode endowmentTransactionCode =
        EndowmentTransactionCodeFixture.INCOME_TRANSACTION_CODE.createEndowmentTransactionCode();
    ClassCode classCode =
        ClassCodeFixture.ALTERNATIVE_INVESTMENT_CLASS_CODE.createClassCodeRecord();
    Security security = SecurityFixture.ALTERNATIVE_INVEST_ACTIVE_SECURITY.createSecurityRecord();
    security.setCommitmentAmount(BigDecimal.ZERO);

    document.getTargetTransactionSecurity().setSecurityID(security.getId());
    document.getTargetTransactionSecurity().setSecurity(security);

    EndowmentTransactionLine endowmentTargetTransactionLine =
        EndowmentTransactionLineFixture.ENDOWMENT_TRANSACTIONAL_LINE_POSITIVE_AMT
            .createEndowmentTransactionLine(false);
    document.addTargetTransactionLine(
        (EndowmentTargetTransactionLine) endowmentTargetTransactionLine);

    assetIncreaseDocumentTaxLotsService.updateTransactionLineTaxLots(
        document, endowmentTargetTransactionLine);

    assertFalse(
        rule.validateTaxLotsCostAndTransactionAmountLessOrEqualToSecurityCommitment(document));
  }
  /**
   * Validates that isActiveKemId returns true when the KEMID is open (closed indicator is false).
   */
  public void testIsActiveKemId_True() {
    KEMID kemid = KemIdFixture.OPEN_KEMID_RECORD.createKemidRecord();
    EndowmentTransactionLine endowmentTransactionLine =
        EndowmentTransactionLineFixture.ENDOWMENT_TRANSACTIONAL_LINE_INCOME
            .createEndowmentTransactionLine(false);

    assertTrue(
        rule.isActiveKemId(
            endowmentTransactionLine, rule.getErrorPrefix(endowmentTransactionLine, -1)));
  }
  /**
   * Validates that validateChartMatch returns false when etran code gl chart does not match the
   * chart for KEMID general ledger account.
   */
  public void testKemidEtranCodeMatch_False() {
    EndowmentTransactionLine endowmentTargetTransactionLine =
        EndowmentTransactionLineFixture.ENDOWMENT_TRANSACTIONAL_LINE_INCOME
            .createEndowmentTransactionLine(false);
    EndowmentTransactionCode endowmentTransactionCode =
        EndowmentTransactionCodeFixture.INCOME_TRANSACTION_CODE.createEndowmentTransactionCode();
    KEMID kemid = KemIdFixture.OPEN_KEMID_RECORD.createKemidRecord();
    GLLink glLink = GLLinkFixture.GL_LINK_UA_CHART.createGLLink();
    KemidGeneralLedgerAccount generalLedgerAccount =
        KemidGeneralLedgerAccountFixture.KEMID_GL_ACCOUNT.createKemidGeneralLedgerAccount();

    kemid.getKemidGeneralLedgerAccounts().add(generalLedgerAccount);
    endowmentTransactionCode.getGlLinks().add(glLink);
    endowmentTargetTransactionLine.setKemid(kemid.getKemid());
    endowmentTargetTransactionLine.setKemidObj(kemid);
    endowmentTargetTransactionLine.setEtranCode(endowmentTransactionCode.getCode());
    endowmentTargetTransactionLine.setEtranCodeObj(endowmentTransactionCode);

    assertFalse(
        rule.validateChartMatch(
            endowmentTargetTransactionLine,
            rule.getErrorPrefix(endowmentTargetTransactionLine, -1)));
  }