* current request is "http" and the port for the "https" scheme is 443.
*/
public void testSwitchToHttpsScheme() {
String expectedString = "https://www.mydomain.com/mywebapp/MyAction.action?foo=bar&hello=earth&hello=mars";
Mock mockHttpServletRequest = new Mock(HttpServletRequest.class);
mockHttpServletRequest.expectAndReturn("getServerName", "www.mydomain.com");
mockHttpServletRequest.expectAndReturn("getScheme", "http");
mockHttpServletRequest.expectAndReturn("getServerPort", 80);
mockHttpServletRequest.expectAndReturn("getContextPath", "/mywebapp");
Mock mockHttpServletResponse = new Mock(HttpServletResponse.class);
mockHttpServletResponse.expectAndReturn("encodeURL", expectedString, expectedString);
String actionName = "/MyAction.action";
TreeMap params = new TreeMap();
params.put("hello", new String[]{"earth", "mars"});
params.put("foo", "bar");
String urlString = urlHelper.buildUrl(actionName, (HttpServletRequest) mockHttpServletRequest.proxy(), (HttpServletResponse) mockHttpServletResponse.proxy(), params, "https", true, true);
assertEquals(expectedString, urlString);
}