Ejemplo n.º 1
0
 private CheckingAccount createCheckingAccountWithRandomTransactions(
     String accountNumber, String accountName, AccountManager manager, Integer target) {
   CheckingAccount account = createCheckingAccount(accountNumber, accountName, manager, true);
   Random random = new Random();
   while (account.getBalance() > target) {
     manager.withdraw(account, 1 + random.nextInt(50));
   }
   return account;
 }
Ejemplo n.º 2
0
 public Account createAccount(String accountName) {
   CheckingAccount account = new CheckingAccount(UUID.randomUUID().toString(), accountName, false);
   accounts.put(account.getAccountNumber(), account);
   return account;
 }