### Question:
MongoUserManager extends UserManager { @Override public BasicUser queryBasicUser(String userName) { DBObject query = createDBObject(); query.put(LOGIN_USERNAME, userName); DBObject userObj = MongoDBUtil.queryFromMongo(query, databaseName, namespace, USER_COLL_NAME, basicUserFields); BasicUser user = null; if ( userObj != null ) { user = constructBasicUserObject(userObj); } return user; } 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 testQueryBasicUser() throws Exception { User user = manager.createDefaultUser(); user.set_id(new UserId("test001")); user.setUsername("test001"); user.setChannel("testSaveUser"); for ( int i=0; i<1; i++ ) { user.addTool(makeBuffTool(i)); } user.addRelation(makeRelation(user)); user.setBag(makeBag(user, 3)); manager.saveUser(user, true); BasicUser actual = manager.queryBasicUser("test001"); assertBasicUserEqual(user, actual); }