### Question:
MongoUserManager extends UserManager { @Override public User queryUser(String userName) { if ( StringUtil.checkNotEmpty(userName) ) { DBObject query = createDBObject(); query.put(LOGIN_USERNAME, userName); DBObject userObj = MongoDBUtil.queryFromMongo(query, databaseName, namespace, USER_COLL_NAME, null); if ( userObj != null ) { User user = constructUserObject(userObj); return user; } } return null; } MongoUserManager();  MongoUserManager(String databaseName, String namespace, boolean isSafeWrite); @Override boolean saveUser(User user, boolean isNewUser); @Override boolean saveUserBag(User user, boolean isNewBag); @Override boolean saveUserRelation(Collection<Relation> relations); @Override Map<RelationType, Collection<People>> saveFriendWinOrLose(User user, User friend, boolean winning); @Override User queryUser(String userName); @Override User queryUserByRoleName(String roleName); @Override User queryUser(UserId userId); @Override String queryUserGuildId(UserId userId); @Override boolean checkUserNameExist(String userName); @Override boolean checkRoleNameExist(String roleName); @Override boolean checkEmailVerified(UserId userId); @Override UserLoginStatus checkUserLoginStatus(UserId userId); @Override BasicUser queryBasicUser(String userName); @Override BasicUser queryBasicUserByRoleName(String roleName); @Override ArrayList<BasicUser> queryBasicUserByRoleNameRegex(String roleName); @Override BasicUser queryBasicUser(UserId userId); @Override Bag queryUserBag(User user); @Override Bag queryUserBag(UserId userId); @Override User queryUserRelation(User user); @Override Collection<Unlock> queryUserUnlock(User user); @Override synchronized boolean addUserNewUnlock(User user, Unlock unlock); @Override void removeUser(UserId userId); @Override void removeUser(String userName); @Override void removeUserByRoleName(String roleName); @Override boolean removeUserGuildId(UserId userId); @Override String convertUserToString(User user); @Override String convertBagToString(Bag bag); @Override User convertStringToUser(String userStr); @Override Bag convertStringToBag(String bagStr); final User constructUserObject(DBObject userObj); static final String LOGIN_USERNAME; static final String LOGIN_ROLENAME; static final String LOGIN_STATUS; static final String EMAIL_VERIFIED; }### Answer:
@Test public void testQueryUserById2() throws Exception { try { User actual = manager.queryUser(new UserId("test001")); assertNull(actual); } catch (Exception e) { fail("Not found user cannot throw exception."); } }
@Test public void testQueryUserByName() throws Exception { try { User actual = manager.queryUser("test001"); assertNull(actual); } catch (Exception e) { fail("Not found user cannot throw exception."); } }