Skip to content
Permalink
Browse files
fixed listing of teller transactions
fixed broken test
  • Loading branch information
mgeiss committed Jul 25, 2017
1 parent 8f0a1fa commit 5cf910bd234aec913184ede353a787f1fa2c1977
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
@@ -403,7 +403,7 @@ public void shouldNotUnlockTellerClosed() throws Exception {
super.testSubject.unlockDrawer(teller.getCode(), unlockDrawerCommand);
}

@Test(expected = TellerTransactionValidationException.class)
@Test(expected = TransactionProcessingException.class)
public void shouldNotReopenAccountClosed() throws Exception {
final Teller teller = this.prepareTeller();

@@ -424,9 +424,9 @@ public void shouldNotReopenAccountClosed() throws Exception {
openAccountTransaction.setClerk(AbstractTellerTest.TEST_USER);
openAccountTransaction.setAmount(1234.56D);

final Account accountA = new Account();
accountA.setState(Account.State.OPEN.name());
Mockito.doAnswer(invocation -> Optional.of(accountA))
final Account account = new Account();
account.setState(Account.State.OPEN.name());
Mockito.doAnswer(invocation -> Optional.of(account))
.when(super.accountingServiceSpy).findAccount(openAccountTransaction.getCustomerAccountIdentifier());
Mockito.doAnswer(invocation -> Collections.emptyList())
.when(super.depositAccountManagementServiceSpy).getCharges(Matchers.eq(openAccountTransaction));
@@ -446,17 +446,14 @@ public void shouldNotReopenAccountClosed() throws Exception {
closeAccountTransaction.setClerk(AbstractTellerTest.TEST_USER);
closeAccountTransaction.setAmount(1234.56D);

final Account account = new Account();
account.setBalance(1234.56D);
account.setState(Account.State.CLOSED.name());

Mockito.doAnswer(invocation -> Optional.of(account))
.when(super.accountingServiceSpy).findAccount(openAccountTransaction.getCustomerAccountIdentifier());

final TellerTransactionCosts closingCosts = super.testSubject.post(teller.getCode(), closeAccountTransaction);
super.testSubject.confirm(teller.getCode(), closingCosts.getTellerTransactionIdentifier(), "CONFIRM", "excluded");
super.eventRecorder.wait(EventConstants.CONFIRM_TRANSACTION, closingCosts.getTellerTransactionIdentifier());

account.setState(Account.State.CLOSED.name());

final TellerTransaction reopenAccountTransaction = new TellerTransaction();
reopenAccountTransaction.setTransactionType(ServiceConstants.TX_OPEN_ACCOUNT);
reopenAccountTransaction.setTransactionDate(DateConverter.toIsoString(LocalDateTime.now(Clock.systemUTC())));
@@ -55,8 +55,8 @@ public Optional<Account> findAccount(final String accountIdentifier) {

public AccountEntryPage fetchAccountEntries(final String accountIdentifier, final String dateRange, final Integer pageIndex,
final Integer pageSize) {
return this.ledgerManager.fetchAccountEntries(accountIdentifier, dateRange, null, pageIndex, pageSize, "identifier",
Sort.Direction.DESC.name());
return this.ledgerManager.fetchAccountEntries(accountIdentifier, dateRange, null, pageIndex, pageSize, null,
Sort.Direction.ASC.name());
}

public void postJournalEntry(final JournalEntry journalEntry) {

0 comments on commit 5cf910b

Please sign in to comment.