@Test public void idsAreUniqueAndAscending(){ final Client jack = new Client("jack", LocalDate.parse("1966-12-31")); final Client chloe = new Client("chloe", LocalDate.parse("1977-01-01")); assertNull(jack.getId()); assertNull(chloe.getId()); testee.save(jack); final Long jackId = jack.getId(); assertNotNull(jackId); testee.save(chloe); final Long chloeId = chloe.getId(); assertNotNull(chloeId); assertThat(chloeId, greaterThan(jackId)); testee.save(chloe); assertEquals(chloeId, chloe.getId()); }
public Client save(final Client client){ return impl.save(client); }
ClientJpaRepository implements ClientRepository { public Client save(final Client client){ return impl.save(client); } }
ClientJpaRepository implements ClientRepository { public Client save(final Client client){ return impl.save(client); } @Autowired  ClientJpaRepository(final ImportedClientJpaRepository impl); }
ClientJpaRepository implements ClientRepository { public Client save(final Client client){ return impl.save(client); } @Autowired  ClientJpaRepository(final ImportedClientJpaRepository impl); void deleteAll(); Client save(final Client client); void delete(Client client); @Override Optional<Client> find(Long id); @Override Optional<Client> find(String username); List<Client> findAll(); List<Client> findAllBornFrom(final LocalDate minDate); }
ClientJpaRepository implements ClientRepository { public Client save(final Client client){ return impl.save(client); } @Autowired  ClientJpaRepository(final ImportedClientJpaRepository impl); void deleteAll(); Client save(final Client client); void delete(Client client); @Override Optional<Client> find(Long id); @Override Optional<Client> find(String username); List<Client> findAll(); List<Client> findAllBornFrom(final LocalDate minDate);  }