private void prepareAccountEntryMocks()

in component-test/src/main/java/org/apache/fineract/cn/teller/TestTellerBalance.java [144:182]


  private void prepareAccountEntryMocks(final String accountIdentifier) {

    final AccountEntry firstDeposit = new AccountEntry();
    firstDeposit.setType(AccountEntry.Type.DEBIT.name());
    firstDeposit.setMessage(ServiceConstants.TX_CASH_DEPOSIT);
    firstDeposit.setAmount(200.00D);

    final AccountEntry secondDeposit = new AccountEntry();
    secondDeposit.setType(AccountEntry.Type.DEBIT.name());
    secondDeposit.setMessage(ServiceConstants.TX_CASH_DEPOSIT);
    secondDeposit.setAmount(150.00D);

    final AccountEntry firstWithdrawal = new AccountEntry();
    firstWithdrawal.setType(AccountEntry.Type.CREDIT.name());
    firstWithdrawal.setMessage(ServiceConstants.TX_CASH_WITHDRAWAL);
    firstWithdrawal.setAmount(50.00D);

    final AccountEntry secondWithdrawal = new AccountEntry();
    secondWithdrawal.setType(AccountEntry.Type.CREDIT.name());
    secondWithdrawal.setMessage(ServiceConstants.TX_CASH_WITHDRAWAL);
    secondWithdrawal.setAmount(100.00D);

    final AccountEntry loanRepayment = new AccountEntry();
    loanRepayment.setType(AccountEntry.Type.DEBIT.name());
    loanRepayment.setMessage(ServiceConstants.TX_REPAYMENT);
    loanRepayment.setAmount(254.00D);

    final AccountEntryPage accountEntryPage = new AccountEntryPage();
    accountEntryPage.setAccountEntries(
        Lists.newArrayList(firstDeposit, secondDeposit, firstWithdrawal, secondWithdrawal, loanRepayment)
    );
    accountEntryPage.setTotalPages(1);
    accountEntryPage.setTotalElements(Integer.valueOf(accountEntryPage.getAccountEntries().size()).longValue());

    Mockito
        .doAnswer(invocation -> accountEntryPage)
        .when(super.accountingServiceSpy)
        .fetchAccountEntries(Matchers.eq(accountIdentifier), Matchers.anyString(), Matchers.eq(0), Matchers.anyInt());
  }