public void testDeleteById() throws ParseException, UserException, JSONException { UserDAO userDAO = new UserDAO(); User user = new User("VIny", "viny", "*****@*****.**", "123456", "14/02/1995"); if (!userDAO.save(user).contains("Salvo")) assertTrue(false); int id = userDAO.searchUserByUsername("viny").getJSONObject("0").getInt("idUser"); assertTrue(userDAO.delete(id).contains("Salvo")); userDAO.delete("viny"); }
public void testDisableLogin() throws ParseException, UserException, JSONException { UserDAO userDAO = new UserDAO(); User user = new User( 1, "Vinicius Pinheiro", "umteste", "14/02/1995", "*****@*****.**", "*****@*****.**", "123456", "123456"); if (!userDAO.save(user).contains("Salvo")) { assertTrue(false); userDAO.delete("umteste"); } int id = userDAO.searchUserByUsername("umteste").getJSONObject("0").getInt("idUser"); assertTrue(userDAO.disableUser(id).contains("Salvo")); userDAO.delete("umteste"); }