Package org.geoserver.ows

Source Code of org.geoserver.ows.URLManglersTest

package org.geoserver.ows;

import static org.geoserver.ows.util.ResponseUtils.buildURL;

import java.util.Collections;

import org.geoserver.config.GeoServerInfo;
import org.geoserver.ows.URLMangler.URLType;
import org.geoserver.test.GeoServerTestSupport;

public class URLManglersTest extends GeoServerTestSupport {
   
    private static final String BASEURL = "http://localhost:8080/geoserver";
   
    public void testBasic() {
        String url =  buildURL(BASEURL, "test", null, URLType.SERVICE);
        assertEquals("http://localhost:8080/geoserver/test", url);
    }
   
    public void testKVP() {
        String url =  buildURL(BASEURL, "test", Collections.singletonMap("param", "value()"), URLType.SERVICE);
        assertEquals("http://localhost:8080/geoserver/test?param=value%28%29", url);
    }
   
    public void testProxyBase() {
        GeoServerInfo gi = getGeoServer().getGlobal();
        gi.setProxyBaseUrl("http://geoserver.org/");
        getGeoServer().save(gi);
       
        String url =  buildURL(BASEURL, "test", null, URLType.SERVICE);
        assertEquals("http://geoserver.org/test", url);
    }
   
   
   
   
}
TOP

Related Classes of org.geoserver.ows.URLManglersTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.