@Test(expected = IllegalArgumentException.class) public void testInsertNoName() { assertNotNull(clientDao); Client c = new Client(); c.setFirstName("test"); clientDao.createClient(c, null); }
@Test public void testInsert() { assertNotNull(clientDao); Client c = new Client(); c.setFirstName("test"); c.setLastName("third"); c.setType("PROSPECT"); clientDao.createClient(c, null); Client result = clientDao.getClient(3); assertNotNull(result); assertEquals(Integer.valueOf(3), result.getId()); assertEquals("third", result.getLastName()); assertEquals("test", result.getFirstName()); assertEquals("PROSPECT", result.getType()); assertNull(result.getUpdateDt()); }
@Test(expected = IllegalArgumentException.class) public void testInsertNull() { assertNotNull(clientDao); clientDao.createClient(null, null); }