@Test(expected = RuntimeException.class) public void testRemoveNotExists() throws Exception { Role role = new Role(); role.setId(4); role.setName("role5"); roleDao.remove(role); }
@Test @ExpectedDatabase( table = "Role", value = "/dataset/role/afterUpdate.xml", assertionMode = DatabaseAssertionMode.NON_STRICT) public void testUpdate() throws Exception { Role role = roles[2]; role.setName("role55"); roleDao.update(role); }
@Before public void setUp() throws Exception { // Configure Roles roles = new Role[3]; Role role1 = new Role(); role1.setId(1); role1.setName("role1"); Role role2 = new Role(); role2.setId(2); role2.setName("role2"); Role role3 = new Role(); role3.setId(3); role3.setName("role3"); roles[0] = role1; roles[1] = role2; roles[2] = role3; }