*/
@Test
public class CommonUtilsTest {
public void testConstuctServiceUrl() {
CasConfig config = new CasConfig();
config.setCasServer("http://www.mycompany.com/cas");
config.setLocalServer("localhost:8080/demo");
MockHttpServletRequest request = new MockHttpServletRequest();
request.setContextPath("/demo");
request.setServletPath("/home.action");
request.setRequestURI("/demo/home.action");
System.out.println(request.getRequestURI());
HttpServletResponse response = new MockHttpServletResponse();
final String urlEncodedService = CommonUtils.constructServiceUrl(request, response, null,
config.getLocalServer(), "ticket", config.isEncode());
System.out.println(urlEncodedService);
final String urlEncodedService2 = CommonUtils.constructServiceUrl(request, response, null,
"localhost:8080", "ticket", config.isEncode());
System.out.println(urlEncodedService2);
}