📄 passwordhintcontrollertest.java
字号:
package com.cib.webapp.controller;import org.springframework.mock.web.MockHttpServletRequest;import org.springframework.mock.web.MockHttpServletResponse;import org.subethamail.wiser.Wiser;public class PasswordHintControllerTest extends BaseControllerTestCase { private PasswordHintController c = null; public void setPasswordHintController(PasswordHintController password) { this.c = password; } public void testExecute() throws Exception { MockHttpServletRequest request = newGet("/passwordHint.html"); request.addParameter("username", "user"); // start SMTP Server Wiser wiser = new Wiser(); wiser.setPort(getSmtpPort()); wiser.start(); c.handleRequest(request, new MockHttpServletResponse()); // verify an account information e-mail was sent wiser.stop(); assertTrue(wiser.getMessages().size() == 1); // verify that success messages are in the session assertNotNull(request.getSession().getAttribute(BaseFormController.MESSAGES_KEY)); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -