/** test insert method */ @Test public void testInsert() { UserDO userDO = new UserDO(); userDO.setUserId("id_4_test"); userDAO.insert(userDO); userDO = userDAO.queryById("id_4_test"); System.out.print(userDO); Assert.assertEquals(userDO != null, true); userDAO.delete(userDO); userDO = userDAO.queryById("id_4_test"); Assert.assertEquals(userDO == null, true); }
/** test qurey method */ @Test public void testQueryById() { UserDO userDO = userDAO.queryById("1"); System.out.print(userDO); Assert.assertEquals(userDO != null, true); }
/** test qurey method */ @Test public void testQueryByGroupId() { List<UserDO> userDOs = userDAO.queryByGroupId("1"); for (UserDO userDO : userDOs) { System.out.print(userDO); } Assert.assertEquals(userDOs != null, true); }
/** test update method */ @Test public void testUpdate() { UserDO userDO = new UserDO(); userDO.setUserId("id_4_test"); userDAO.insert(userDO); userDO = userDAO.queryById("id_4_test"); System.out.print(userDO); Assert.assertEquals(userDO != null, true); userDO.setGroupId("group_4_test"); userDAO.update(userDO); userDO = userDAO.queryById("id_4_test"); Assert.assertEquals(userDO.getGroupId().equals("group_4_test"), true); userDAO.delete(userDO); userDO = userDAO.queryById("id_4_test"); Assert.assertEquals(userDO == null, true); }