HttpContainerContext { public String getCurrentContextUrlFromUserRequest() { String httpUrl = StringUtils.trimToEmpty(config.getControllerProperties().getProperty(PROP_CONTROLLER_URL)); if (StringUtils.isNotBlank(httpUrl)) { return httpUrl; } HttpServletRequest request = cast(RequestContextHolder.currentRequestAttributes().resolveReference("request")); int serverPort = request.getServerPort(); String portString = (serverPort == DEFAULT_WEB_PORT) ? StringUtils.EMPTY : ":" + serverPort; return httpUrl + request.getScheme() + ": }  String getCurrentContextUrlFromUserRequest(); boolean isUnixUser();  }
@Test public void testGetCurrentRequestUrlFromUserRequest() { String requestUrl = httpContainerContext.getCurrentContextUrlFromUserRequest(); assertTrue(requestUrl.startsWith("http: String httpUrl = config.getControllerProperties().getProperty(PROP_CONTROLLER_URL, ""); if (StringUtils.isNotBlank(httpUrl)) { config.getControllerProperties().addProperty(PROP_CONTROLLER_URL, ""); } else { config.getControllerProperties().addProperty(PROP_CONTROLLER_URL, "http: } requestUrl = httpContainerContext.getCurrentContextUrlFromUserRequest(); assertTrue(requestUrl.startsWith("http: config.getControllerProperties().addProperty(PROP_CONTROLLER_URL, requestUrl); }