public void testGetProxiedHostPortAndProtoBaseAddress() throws URISyntaxException {
when(this.request.getHeader(ProxyHttpServletRequestWrapper.FORWARDED_PROTO_HEADER)).thenReturn(
FORWARDED_HTTPS_PROTO);
when(this.request.getHeader(ProxyHttpServletRequestWrapper.FORWARDED_HOST_HEADER)).thenReturn(FORWARDED_HOST);
ProxyHttpServletRequestWrapper proxyRequest = new ProxyHttpServletRequestWrapper(request, null);
assertEquals(FORWARDED_HTTPS_PROTO, proxyRequest.getScheme());
assertTrue(FORWARDED_HOST.startsWith(proxyRequest.getServerName()));
URI baseUri = new URI(AtomPubUtils.compileBaseUrl(proxyRequest, REPOSITORY_ID).toString());
assertEquals(FORWARDED_HTTPS_PROTO, baseUri.getScheme());
assertEquals(FORWARDED_SERVER_NAME, baseUri.getHost());