@Test public void findYoungClients() { bankService.createClient("kim", LocalDate.parse("1994-05-21")); bankService.createClient("jack", LocalDate.parse("1966-12-31")); bankService.createClient("chloe", LocalDate.parse("1992-12-01")); { final Iterable<Client> noClients = bankService.findYoungClients(LocalDate.parse("1994-05-22")); final String result = stringize(noClients); assertEquals("", result); } { final Iterable<Client> oneClients = bankService.findYoungClients(LocalDate.parse("1994-05-21")); final String result = stringize(oneClients); assertEquals("1994-05-21 kim", result); } { final Iterable<Client> twoClients = bankService.findYoungClients(LocalDate.parse("1992-12-01")); final String result = stringize(twoClients); assertEquals("1994-05-21 kim, 1992-12-01 chloe", result); } { final Iterable<Client> twoClients = bankService.findYoungClients(LocalDate.parse("1967-01-01")); final String result = stringize(twoClients); assertEquals("1994-05-21 kim, 1992-12-01 chloe", result); } { final Iterable<Client> twoClients = bankService.findYoungClients(LocalDate.parse("1966-12-31")); final String result = stringize(twoClients); assertEquals("1994-05-21 kim, 1992-12-01 chloe, 1966-12-31 jack", result); } }
public List<Client> findYoungClients(final LocalDate fromBirth) { return clientRepository.findAllBornFrom(fromBirth); }
BankService { public List<Client> findYoungClients(final LocalDate fromBirth) { return clientRepository.findAllBornFrom(fromBirth); } }
BankService { public List<Client> findYoungClients(final LocalDate fromBirth) { return clientRepository.findAllBornFrom(fromBirth); } @Autowired  BankService(final ClientRepository clientRepository, final AccountAccessRepository accountAccessRepository); }
BankService { public List<Client> findYoungClients(final LocalDate fromBirth) { return clientRepository.findAllBornFrom(fromBirth); } @Autowired  BankService(final ClientRepository clientRepository, final AccountAccessRepository accountAccessRepository); Client createClient(final String username, final LocalDate birthDate); void deleteClient(final Client client); Client findClient(final String username); List<Client> findAllClients(); List<Client> findYoungClients(final LocalDate fromBirth); List<Client> findRichClients(final Amount minBalance); }
BankService { public List<Client> findYoungClients(final LocalDate fromBirth) { return clientRepository.findAllBornFrom(fromBirth); } @Autowired  BankService(final ClientRepository clientRepository, final AccountAccessRepository accountAccessRepository); Client createClient(final String username, final LocalDate birthDate); void deleteClient(final Client client); Client findClient(final String username); List<Client> findAllClients(); List<Client> findYoungClients(final LocalDate fromBirth); List<Client> findRichClients(final Amount minBalance);  }