testLogout : deleteUser() [Solved]

Hi,

I’ve been stuck on this test, and I realised, should deleteUser() be deleteUserSessions() instead?

public void testLogout() {
assertTrue(
“Should have deleted user from sessions collection - check your logout method”,
dao.deleteUser(email));
Session session = dao.getUserSession(email);
assertNull(“All sessions for user should have been deleted after logout”, session);
}

Hi @Joo_Hiang_15468

The sequence should be when a user logs out of the system that their session is deleted, not their user account. A user should only be deleted for the test “testDeleteUser”.

Hope this helps!
Eoin

Thanks @brazileoin for confirming it! I assume this is a typo for this test function then. I changed it to deleteUserSessions instead since it’s a test case for logout and managed to run all the tests and pass the ticket.

1 Like

Hi Joe et al,
There is not need to modify the test case due to the fact that deleteuser() needs to implement the deleteusersessions() inside. So, for testing purposes this is ok. If you modify the test cases then tintellij will try to compile the whole test solution and more changes may be needed.