@Test public void testProxyMetadataURLBackReferenceNoProxyBaseUrl() throws Exception { createAppContext(null); MetadataLinkInfo link = new MetadataLinkInfoImpl(); link.setContent("/metadata.xml?foo=bar"); String url = ResponseUtils.proxifyMetadataLink(link, "http://localhost/geoserver"); assertEquals("http://localhost/geoserver/metadata.xml?foo=bar", url); }
@Test public void testProxyDataURLBackReference() throws Exception { createAppContext("http://foo.org/geoserver"); DataLinkInfo link = new DataLinkInfoImpl(); link.setContent("/metadata.xml?foo=bar"); String url = ResponseUtils.proxifyDataLink(link, "http://localhost/geoserver"); assertEquals("http://foo.org/geoserver/metadata.xml?foo=bar", url); }
@Test public void testProxyMetadataURLBackReference() throws Exception { createAppContext("http://foo.org/geoserver"); MetadataLinkInfo link = new MetadataLinkInfoImpl(); link.setContent("/metadata.xml?foo=bar"); String url = ResponseUtils.proxifyMetadataLink(link, "http://localhost/geoserver"); assertEquals("http://foo.org/geoserver/metadata.xml?foo=bar", url); }
@Test public void testDataURLBackReferenceNoProxyBaseUrl() throws Exception { createAppContext(null); DataLinkInfo link = new DataLinkInfoImpl(); link.setContent("/metadata.xml?foo=bar"); String url = ResponseUtils.proxifyDataLink(link, "http://localhost/geoserver"); assertEquals("http://localhost/geoserver/metadata.xml?foo=bar", url); } }
@Test public void testProxyDataURL() throws Exception { createAppContext("http://foo.org/geoserver"); DataLinkInfo link = new DataLinkInfoImpl(); link.setContent("http://bar.com/geoserver/metadata.xml?foo=bar"); String url = ResponseUtils.proxifyDataLink(link, "http://localhost/geoserver"); assertEquals(link.getContent(), url); }
@Test public void testProxyMetadataURL() throws Exception { createAppContext("http://foo.org/geoserver"); MetadataLinkInfo link = new MetadataLinkInfoImpl(); link.setContent("http://bar.com/geoserver/metadata.xml?foo=bar"); String url = ResponseUtils.proxifyMetadataLink(link, "http://localhost/geoserver"); assertEquals(link.getContent(), url); }