@Test public void testDeleteWithClientServiceShouldPass() throws Exception { clientService.create(client); Integer insertedId = client.getId(); Client delete = clientService.findById(insertedId); clientService.delete(delete); Client result = clientService.findById(delete.getId()); assertNull(result); }
@Test public void testUpdateWithClientServiceShouldPass() throws Exception { clientService.create(client); Integer insertedId = client.getId(); Client update = clientService.findById(insertedId); update.setName("test update"); clientService.update(update); Client result = clientService.findById(update.getId()); assertThat(result.getName(), is("test update")); }