Add test to check authenticateByUserName