@Before public void setUp() throws Exception { client = new Client(); client.setName("test"); client.setAuditFlag("C"); client.setCreatedBy(0); client.setCreatedTimeStamp(Calendar.getInstance().getTime()); }
@Test public void testFindByIdWithClientServiceShouldPass() throws Exception { client.setName("test findById"); clientService.create(client); Integer insertedId = client.getId(); Client result = clientService.findById(insertedId); assertThat(result.getName(), is("test findById")); }
@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); }