### Question:
HttpServletRequestUtils { public static String constructRequestUrlWithParameters(HttpServletRequest request) { StringBuilder path = new StringBuilder(); String url = constructRequestUrl(request); String queryString = request.getQueryString(); path.append(url); if (queryString != null) { path.append("?").append(queryString); } return path.toString(); } private  HttpServletRequestUtils(); static String extractClientIp(HttpServletRequest request); static String extractScheme(HttpServletRequest request); static String extractHost(HttpServletRequest request); static int extractServerPort(HttpServletRequest request); static String constructRequestBaseUrl(HttpServletRequest request); static String constructRequestUrl(HttpServletRequest request); static String constructRequestUrlWithParameters(HttpServletRequest request); static boolean isDefaultPort(String scheme, int port);  }### Answer:
@Test public void constructRequestUrlWithParameters_NON_STANDARD_PORT() { when(request.getHeader("X-FORWARDED-PROTO")).thenReturn("https"); when(request.getHeader("X-FORWARDED-HOST")).thenReturn("saos.org.pl"); when(request.getIntHeader("X-FORWARDED-PORT")).thenReturn(773); when(request.getRequestURI()).thenReturn("/search"); when(request.getQueryString()).thenReturn("searchPhrase=orzeczenie&signatur=ii12"); assertEquals("https: }
@Test public void constructRequestUrlWithParameters_STANDARD_PORT() { when(request.getHeader("X-FORWARDED-PROTO")).thenReturn("https"); when(request.getHeader("X-FORWARDED-HOST")).thenReturn("saos.org.pl"); when(request.getIntHeader("X-FORWARDED-PORT")).thenReturn(443); when(request.getRequestURI()).thenReturn("/search"); when(request.getQueryString()).thenReturn("searchPhrase=orzeczenie&signatur=ii12"); assertEquals("https: }
@Test public void constructRequestUrlWithParameters_NO_QUERY() { when(request.getHeader("X-FORWARDED-PROTO")).thenReturn("https"); when(request.getHeader("X-FORWARDED-HOST")).thenReturn("saos.org.pl"); when(request.getIntHeader("X-FORWARDED-PORT")).thenReturn(443); when(request.getRequestURI()).thenReturn("/search"); when(request.getQueryString()).thenReturn(null); assertEquals("https: }