passwordhintcontrollertest.java
来自「基于Maven的质量保证自动化环境配置和演示程序」· Java 代码 · 共 33 行
JAVA
33 行
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 + =
减小字号Ctrl + -
显示快捷键?