Examples of SavingsAccount


Examples of Banking.SavingsAccount

   
    return account;
  }

  public SavingsAccount createSavingsAccount(String accountNumber, float interestRate) throws BankException {
    SavingsAccount account = null;

    if (internal_findAccount(accountNumber) != null) {
      LOG.warn(MSG_ACCOUNT_ALREADYCREATED + accountNumber);
      throw new BankException(MSG_ACCOUNT_ALREADYCREATED + accountNumber);
    }
View Full Code Here

Examples of Banking.SavingsAccount

    bank.createCurrentAccount(accountNumberOne, loanLimit);
  }

  @Test
  public void createSavingsAccount() throws BankException {
    SavingsAccount account = bank.createSavingsAccount(accountNumberOne, interestRate);
    assertNotNull(account);
    assertEquals(accountNumberOne, account.accountNumber());
    assertEquals(interestRate, account.interestRate());
   
    Account foundAccount = bank.findAccount(accountNumberOne);
    assertEquals(true, CompareAccounts.compareAccounts(account, foundAccount));
  }
View Full Code Here

Examples of Banking.SavingsAccount

    bank.createSavingsAccount(accountNumberOne, interestRate);
  }

  @Test(expected = BankException.class)
  public void closeAccount() throws BankException {
    SavingsAccount account = bank.createSavingsAccount(accountNumberOne, interestRate);
    assertNotNull(account);
   
    bank.closeAccount(accountNumberOne);
    bank.findAccount(accountNumberOne);
  }
View Full Code Here

Examples of Banking.SavingsAccount

    bank.closeAccount(accountNumberTwo);
  }

  @Test
  public void findAccount() throws BankException {
    SavingsAccount account = bank.createSavingsAccount(accountNumberOne, interestRate);
    assertNotNull(account);
   
    Account foundAccount = bank.findAccount(accountNumberOne);
    assertEquals(true, CompareAccounts.compareAccounts(account, foundAccount));
  }
View Full Code Here

Examples of Banking.SavingsAccount

    bank.findAccount(accountNumberOne);
  }
 
  @Test(expected = BankException.class)
  public void findAfterDeleteAccount() throws BankException {
    SavingsAccount account = bank.createSavingsAccount(accountNumberOne, interestRate);
    assertNotNull(account);
   
    bank.closeAccount(accountNumberOne);
    bank.findAccount(accountNumberOne);
  }
View Full Code Here

Examples of Banking.SavingsAccount

    bank.findAccount(accountNumberOne);
  }

  @Test
  public void payInterest() throws BankException {
    SavingsAccount firstAccount = bank.createSavingsAccount(accountNumberOne, interestRate*2);
    firstAccount.deposit(depositAmount);
   
    SavingsAccount secondAccount = bank.createSavingsAccount(accountNumberTwo, interestRate);
    secondAccount.deposit(depositAmount*2);
   
    bank.payInterest();
    assertEquals((int)(depositAmount*(1+(interestRate*2))), firstAccount.balance());
    assertEquals((int)(depositAmount*2*(1+interestRate)), secondAccount.balance());
  }
View Full Code Here

Examples of bigbank.accountdata.SavingsAccount

        // Get the checking, savings and stock accounts from the AccountData
        // service component
        CheckingAccount checking = accountDataService.getCheckingAccount(customerID);
        System.out.println("Checking account: " + checking);

        SavingsAccount savings = accountDataService.getSavingsAccount(customerID);
        System.out.println("Savings account: " + savings);

        StockAccount stock = accountDataService.getStockAccount(customerID);
        System.out.println("Stock account: " + stock);
       
        // Get the stock price in USD
        double price = stockQuoteService.getQuote(stock.getSymbol());
        System.out.println("Stock price for " + stock.getSymbol() + ": " + price);

        // Convert to the configured currency
        if (currency.equals("EURO")) {
           
            // Use our fancy calculator service to convert to the target currency
            price = calculatorService.multiply(price, 0.70);
           
            System.out.println("Converted to " + currency + ": " + price);
        }
       
        // Calculate the value of the stock account
        double stockValue = price * stock.getQuantity();
       
        // Calculate the total balance of all accounts and return it
        double balance = checking.getBalance() + savings.getBalance() + stockValue;
       
        return balance;
    }
View Full Code Here

Examples of bigbank.accountdata.SavingsAccount

        List<String> summaries = new ArrayList<String>();

        CheckingAccount ca = accountDataService.getCheckingAccount(s);
        summaries.add(ca.getSummary());

        SavingsAccount sa = accountDataService.getSavingsAccount(s);
        summaries.add(sa.getSummary());

        StockAccount sk = accountDataService.getStockAccount(s);
        summaries.add(sk.getSummary());

        AccountReport report = new AccountReport(currency, summaries);
View Full Code Here

Examples of bigbank.accountdata.SavingsAccount

        // Get the checking, savings and stock accounts from the AccountData
        // service component
        CheckingAccount checking = accountDataService.getCheckingAccount(customerID);
        System.out.println("Checking account: " + checking);

        SavingsAccount savings = accountDataService.getSavingsAccount(customerID);
        System.out.println("Savings account: " + savings);

        StockAccount stock = accountDataService.getStockAccount(customerID);
        System.out.println("Stock account: " + stock);
       
        // Get the stock price in USD
        double price = stockQuoteService.getQuote(stock.getSymbol());
        System.out.println("Stock price for " + stock.getSymbol() + ": " + price);

        // Convert to the configured currency
        if (currency.equals("EURO")) {
           
            // Use our fancy calculator service to convert to the target currency
            price = calculatorService.multiply(price, 0.70);
           
            System.out.println("Converted to " + currency + ": " + price);
        }
       
        // Calculate the value of the stock account
        double stockValue = price * stock.getQuantity();
       
        // Calculate the total balance of all accounts and return it
        double balance = checking.getBalance() + savings.getBalance() + stockValue;
       
        return balance;
    }
View Full Code Here

Examples of bigbank.accountdata.SavingsAccount

        List<String> summaries = new ArrayList<String>();

        CheckingAccount ca = accountDataService.getCheckingAccount(s);
        summaries.add(ca.getSummary());

        SavingsAccount sa = accountDataService.getSavingsAccount(s);
        summaries.add(sa.getSummary());

        StockAccount sk = accountDataService.getStockAccount(s);
       
        double price = stockQuoteService.getQuote(sk.getSymbol());
        sk.setBalance(sk.getQuantity() * price);
 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.