JdbcAccountRepository implements AccountRepository { @Override public Account getAccount(Long id) { String sqlTxt = "select * from account where id=?"; return template.queryForObject(sqlTxt, new AccountMapper(), id); } @Autowired  JdbcAccountRepository(DataSource dataSource); @Override List<Account> getAccounts(); @Override Account getAccount(Long id); @Override int getNumberOfAccounts(); @Override Long createAccount(BigDecimal initialBalance); @Override void updateAccount(Account account); @Override int deleteAccount(Long id);  }
@Test public void testGetAccount() throws Exception { Account account = repository.getAccount(1L); assertThat(account.getId(), is(1L)); assertThat(new BigDecimal("100.0"), is(closeTo(account.getBalance(), new BigDecimal("0.01")))); }