@Test public void doFindAccountUserIdNotFound() { when(repo.findByUserid(ServiceTestConfiguration.BAD_USER_ID)).thenReturn(new ArrayList()); List<Account> accounts = service.findAccounts(ServiceTestConfiguration.BAD_USER_ID); assertEquals(accounts.size(),0); }
public List<Account> findAccounts(String user) { logger.debug("AccountService.findAccounts: id=" + user); List<Account> account = accounts.findByUserid(user); logger.debug("Found " + account.size() + " account(s)."); logger.info(String.format("AccountService.findAccount - retrieved account for user id: %s. Payload is: %s", user, account)); return account; }
AccountService { public List<Account> findAccounts(String user) { logger.debug("AccountService.findAccounts: id=" + user); List<Account> account = accounts.findByUserid(user); logger.debug("Found " + account.size() + " account(s)."); logger.info(String.format("AccountService.findAccount - retrieved account for user id: %s. Payload is: %s", user, account)); return account; } }
AccountService { public List<Account> findAccounts(String user) { logger.debug("AccountService.findAccounts: id=" + user); List<Account> account = accounts.findByUserid(user); logger.debug("Found " + account.size() + " account(s)."); logger.info(String.format("AccountService.findAccount - retrieved account for user id: %s. Payload is: %s", user, account)); return account; }  }
AccountService { public List<Account> findAccounts(String user) { logger.debug("AccountService.findAccounts: id=" + user); List<Account> account = accounts.findByUserid(user); logger.debug("Found " + account.size() + " account(s)."); logger.info(String.format("AccountService.findAccount - retrieved account for user id: %s. Payload is: %s", user, account)); return account; }  Account findAccount(Integer id); List<Account> findAccounts(String user); List<Account> findAccountsByType(String id, AccountType type); Integer saveAccount(Account accountRequest); }
AccountService { public List<Account> findAccounts(String user) { logger.debug("AccountService.findAccounts: id=" + user); List<Account> account = accounts.findByUserid(user); logger.debug("Found " + account.size() + " account(s)."); logger.info(String.format("AccountService.findAccount - retrieved account for user id: %s. Payload is: %s", user, account)); return account; }  Account findAccount(Integer id); List<Account> findAccounts(String user); List<Account> findAccountsByType(String id, AccountType type); Integer saveAccount(Account accountRequest);  }