### Question:
EmailManager { public void sendVerifyEmail(Account account, IoSession session) { if ( StringUtil.checkNotEmpty(account.getEmail()) ) { if ( StringUtil.checkValidEmail(account.getEmail()) ) { try { String emailSmtp = GameDataManager.getInstance().getGameDataAsString(GameDataKey.EMAIL_SMTP, "mail.xinqihd.com"); HtmlEmail email = new HtmlEmail(); email.setHostName(emailSmtp); email.setAuthenticator(new DefaultAuthenticator(EMAIL_FROM, "xinqi@2012")); email.setFrom(EMAIL_FROM); String subject = Text.text("email.subject"); String http = StringUtil.concat(GlobalConfig.getInstance().getStringProperty("runtime.httpserverid"), Constant.PATH_SEP, "verifyemail", Constant.QUESTION, account.get_id().toString()); String content = Text.text("email.content", account.getUserName(), http); email.setSubject(subject); email.setHtmlMsg(content); email.setCharset("GBK"); email.addTo(account.getEmail()); email.send(); SysMessageManager.getInstance().sendClientInfoRawMessage(session, Text.text("email.sent"), Action.NOOP, Type.NORMAL); } catch (EmailException e) { logger.debug("Failed to send verify email to user {}'s address:{}", account.getUserName(), account.getEmail()); } } else { SysMessageManager.getInstance().sendClientInfoRawMessage(session, "email.invalid", Action.NOOP, Type.NORMAL); } } else { SysMessageManager.getInstance().sendClientInfoRawMessage(session, "email.no", Action.NOOP, Type.NORMAL); } } EmailManager(); static EmailManager getInstance(); void reload(); void sendVerifyEmail(Account account, IoSession session); void sendNormalEmail(String subject, String content, String[] addresses ); boolean verifyEmail(String accountId); boolean forgetPassword(String roleName, IoSession session);  }### Answer:
@Test public void testSendVerifyEmail() { Account user = prepareAccount("test001"); user.setEmail("wangqi@xinqihd.com"); EmailManager.getInstance().sendVerifyEmail(user, null); assertEquals(false, user.isEmailVerified()); String idStr = user.get_id().toString(); EmailManager.getInstance().verifyEmail(idStr); Account actual = AccountManager.getInstance().queryAccountByName("test001"); assertEquals(true, actual.isEmailVerified()); }