/**
   * Validates that transactionLineSizeGreaterThanZero returns true if the document has at least one
   * target transaction line.
   */
  public void testDocumentHasAtLeastOneTransactionLine_True() {
    EndowmentTransactionLine endowmentTransactionLine =
        EndowmentTransactionLineFixture.ENDOWMENT_TRANSACTIONAL_LINE_INCOME
            .createEndowmentTransactionLine(false);
    document.addTargetTransactionLine((EndowmentTargetTransactionLine) endowmentTransactionLine);

    assertTrue(rule.transactionLineSizeGreaterThanZero(document, false));
  }
  /**
   * Validates that validateKemId returns false when the kemid on the transaction line does not
   * exist in the db.
   */
  public void testValidateKemId_False() {
    EndowmentTransactionLine endowmentTransactionLine =
        EndowmentTransactionLineFixture.ENDOWMENT_TRANSACTIONAL_LINE_INCOME
            .createEndowmentTransactionLine(false);
    endowmentTransactionLine.setKemid(EndowTestConstants.INVALID_KEMID);

    assertFalse(
        rule.validateKemId(
            endowmentTransactionLine, rule.getErrorPrefix(endowmentTransactionLine, -1)));
  }
  /**
   * Validates that isActiveKemId returns false when the KEMID is closed (closed indicator is true).
   */
  public void testIsActiveKemId_False() {
    KEMID kemid = KemIdFixture.CLOSED_KEMID_RECORD.createKemidRecord();
    EndowmentTransactionLine endowmentTransactionLine =
        EndowmentTransactionLineFixture.ENDOWMENT_TRANSACTIONAL_LINE_INCOME
            .createEndowmentTransactionLine(false);

    assertFalse(
        rule.isActiveKemId(
            endowmentTransactionLine, rule.getErrorPrefix(endowmentTransactionLine, -1)));
  }
  /**
   * Validates that validateKemId returns true when the kemid on the transaction line exists in the
   * db.
   */
  public void testValidateKemId_True() {

    KEMID kemid = KemIdFixture.OPEN_KEMID_RECORD.createKemidRecord();
    EndowmentTransactionLine endowmentTransactionLine =
        EndowmentTransactionLineFixture.ENDOWMENT_TRANSACTIONAL_LINE_INCOME
            .createEndowmentTransactionLine(false);

    assertTrue(
        rule.validateKemId(
            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)));
  }