@Test public void getRequestURL() { when(request.getRequestURL()).thenReturn(new StringBuffer("http: when(request.getContextPath()).thenReturn("/documentr"); FacadeHostRequestWrapper requestWrapper = new FacadeHostRequestWrapper( request, "https: assertEquals("https: }
@Override public StringBuffer getRequestURL() { StringBuffer urlBuf = super.getRequestURL(); String url = urlBuf.toString(); String contextPath = getContextPath(); String facadeUrl = buildFacadeUrl(url, contextPath, documentrHost); if (!facadeUrl.equals(url)) { return new StringBuffer(facadeUrl); } else { return urlBuf; } }
FacadeHostRequestWrapper extends HttpServletRequestWrapper { @Override public StringBuffer getRequestURL() { StringBuffer urlBuf = super.getRequestURL(); String url = urlBuf.toString(); String contextPath = getContextPath(); String facadeUrl = buildFacadeUrl(url, contextPath, documentrHost); if (!facadeUrl.equals(url)) { return new StringBuffer(facadeUrl); } else { return urlBuf; } } }
FacadeHostRequestWrapper extends HttpServletRequestWrapper { @Override public StringBuffer getRequestURL() { StringBuffer urlBuf = super.getRequestURL(); String url = urlBuf.toString(); String contextPath = getContextPath(); String facadeUrl = buildFacadeUrl(url, contextPath, documentrHost); if (!facadeUrl.equals(url)) { return new StringBuffer(facadeUrl); } else { return urlBuf; } } FacadeHostRequestWrapper(HttpServletRequest request, String documentrHost); }
FacadeHostRequestWrapper extends HttpServletRequestWrapper { @Override public StringBuffer getRequestURL() { StringBuffer urlBuf = super.getRequestURL(); String url = urlBuf.toString(); String contextPath = getContextPath(); String facadeUrl = buildFacadeUrl(url, contextPath, documentrHost); if (!facadeUrl.equals(url)) { return new StringBuffer(facadeUrl); } else { return urlBuf; } } FacadeHostRequestWrapper(HttpServletRequest request, String documentrHost); @Override StringBuffer getRequestURL(); static String buildFacadeUrl(String url, String contextPath, String documentrHost); }
FacadeHostRequestWrapper extends HttpServletRequestWrapper { @Override public StringBuffer getRequestURL() { StringBuffer urlBuf = super.getRequestURL(); String url = urlBuf.toString(); String contextPath = getContextPath(); String facadeUrl = buildFacadeUrl(url, contextPath, documentrHost); if (!facadeUrl.equals(url)) { return new StringBuffer(facadeUrl); } else { return urlBuf; } } FacadeHostRequestWrapper(HttpServletRequest request, String documentrHost); @Override StringBuffer getRequestURL(); static String buildFacadeUrl(String url, String contextPath, String documentrHost);  }