JdbcAccountRepository implements AccountRepository { @Override public int getNumberOfAccounts() { String sqlTxt = "select count(*) from account"; return template.queryForObject(sqlTxt, Integer.class); } @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 testGetNumberOfAccounts() throws Exception { assertThat(repository.getNumberOfAccounts(), is(3)); }