AccountService { public List<Account> findAccountsByType(String id, AccountType type) { logger.debug("AccountService.findAccount: id=" + id + " and type: " + type.toString()); List<Account> account = accounts.findByUseridAndType(id,type); logger.debug("Found " + account.size() + " account(s)."); logger.info(String.format("AccountService.findAccount - retrieved account with id: %s. Payload is: %s", id, account)); return account; }  Account findAccount(Integer id); List<Account> findAccounts(String user); List<Account> findAccountsByType(String id, AccountType type); Integer saveAccount(Account accountRequest);  }
@Test public void doFindAccountsByType() { when(repo.findByUseridAndType(ServiceTestConfiguration.USER_ID,AccountType.CURRENT)).thenReturn(ServiceTestConfiguration.accountList()); List<Account> accounts = service.findAccountsByType(ServiceTestConfiguration.USER_ID,AccountType.CURRENT); assertEquals(accounts.size(),1); assertEquals(accounts.get(0),ServiceTestConfiguration.account()); }