mockHttpServletRequest.expectAndReturn("getContextPath", "/mywebapp");
mockHttpServletRequest.expectAndReturn("getAttribute", "javax.servlet.forward.request_uri", "/mywebapp/product/widget/");
mockHttpServletRequest.expectAndReturn("getRequestURI", "/mywebapp/");
Mock mockHttpServletResponse = new Mock(HttpServletResponse.class);
mockHttpServletResponse.expectAndReturn("encodeURL", expectedString, expectedString);
String actionName = "promo.html";
Map params = new TreeMap();
String urlString = urlHelper.buildUrl(actionName, (HttpServletRequest) mockHttpServletRequest.proxy(), (HttpServletResponse) mockHttpServletResponse.proxy(), params, "https", true, true);