Package com.bank.domain

Examples of com.bank.domain.TransferReceipt


  @Test
  public void testTransfer() throws InsufficientFundsException {
    double transferAmount = 100.00;

    TransferReceipt receipt = transferService.transfer(transferAmount, A123_ID, C456_ID);

    assertThat(receipt.getTransferAmount(), equalTo(transferAmount));
    assertThat(receipt.getFinalSourceAccount().getBalance(), equalTo(A123_INITIAL_BAL-transferAmount));
    assertThat(receipt.getFinalDestinationAccount().getBalance(), equalTo(C456_INITIAL_BAL+transferAmount));

    assertThat(accountRepository.findById(A123_ID).getBalance(), equalTo(A123_INITIAL_BAL-transferAmount));
    assertThat(accountRepository.findById(C456_ID).getBalance(), equalTo(C456_INITIAL_BAL+transferAmount));
  }
View Full Code Here


    TransferService transferService = ctx.getBean(TransferService.class);

    // generate a random amount between 10.00 and 90.00 dollars
    double amount = (new Random().nextInt(8) + 1) * 10;

    TransferReceipt receipt = transferService.transfer(amount, "A123", "C456");

    System.out.println(receipt);

  }
View Full Code Here

TOP

Related Classes of com.bank.domain.TransferReceipt

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.