I have got the source code of spring recipes book by gary mark.
In an application of bank I am trying to alter the Account class, AccountService interface and the AccountServiceImpl class to allow the setting of a credit limit on accounts and for withdrawals to be allowed up to that credit limit.
Plus I have to Alter the JUnittest in AccountServiceTests to test this new functionality.
public void createAccount(String accountNo);
public void removeAccount(String accountNo);
public void deposit(String accountNo, double amount);
public void withdraw(String accountNo, double amount);
public double getBalance(String accountNo);
}
AccountServiceImpl
package com.apress.springrecipes.bank;
public class AccountServiceImpl implements AccountService {
private AccountDao accountDao;
public AccountServiceImpl(AccountDao accountDao) {
this.accountDao = accountDao;
}
public void createAccount(String accountNo) {
accountDao.createAccount(new Account(accountNo, 0));
}
Please UseCodeTags when posting code or configuration. Unformatted code and configuration is unnecessarily difficult to read. You can edit your post by using the button.
I guess I'm not sure what the question is--how to check to see if they can withdraw a certain amount? How to write the tests (which should be written first)?