@Test public void findsFirstPageOfMatthews() throws Exception { Page<Customer> customers = repository.findByLastname("Matthews", new PageRequest(0, 2)); assertThat(customers.getContent().size(), is(2)); assertFalse(customers.hasPreviousPage()); }
@Test public void findsCustomerById() throws Exception { Customer customer = repository.findById(2L); assertThat(customer.getFirstname(), is("Carter")); assertThat(customer.getLastname(), is("Beauford")); }
@Test public void findsAllCustomers() throws Exception { List<Customer> result = repository.findAll(); assertThat(result, is(notNullValue())); assertFalse(result.isEmpty()); }