Package org.springframework.test.web.servlet.request

Examples of org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder


                   .layer("one")
                      .style().ysld("one.yaml")
            .geoServer().build(geoServer);


        MockHttpServletRequestBuilder req = put("/api/layers/foo/one/style")
            .contentType(YsldMessageConverter.MEDIA_TYPE)
            .content("title: raw");

        MvcResult result = mvc.perform(req)
            .andExpect(status().isOk())
View Full Code Here


                .workspace("foo", "http://scratch.org", true)
                    .layer("one")
                     .style().ysld("one.yaml")
            .geoServer().build(geoServer);

        MockHttpServletRequestBuilder req = put("/api/layers/foo/one/style")
            .contentType(YsldMessageConverter.MEDIA_TYPE)
            .content("title: raw\nbad");

        MvcResult result = mvc.perform(req)
            .andExpect(status().isBadRequest())
View Full Code Here

                .layer("one").info("The layer", "This layer is cool!")
                .featureType().defaults().store("one")
                .geoServer().build(geoServer);

        JSONObj obj = new JSONObj().put("title", "new title");
        MockHttpServletRequestBuilder req = put("/api/layers/foo/one")
            .contentType(MediaType.APPLICATION_JSON)
            .content(obj.toString());

        mvc.perform(req).andExpect(status().isOk()).andReturn();
View Full Code Here

                .layer("layer3", "layer3")
                    .featureType().defaults().store("foo").workspace()
                .geoServer().build(geoServer);

        JSONObj obj;
        MockHttpServletRequestBuilder req;
        obj = new JSONObj().put("title", "new title");
        req = put("/api/layers/foo/layer3")
            .contentType(MediaType.APPLICATION_JSON)
            .content(obj.toString());
        mvc.perform(req).andExpect(status().isOk()).andReturn();
View Full Code Here

        obj.put("name", "foo");
        obj.put("title", "Foo");
        obj.putObject("proj").put("srs", "EPSG:4326");
        obj.putArray("layers").addObject().put("name", "one");

        MockHttpServletRequestBuilder req = post("/api/maps/foo")
            .contentType(MediaType.APPLICATION_JSON)
            .content(obj.toString());

        mvc.perform(req)
            .andExpect(status().isCreated())
View Full Code Here

        obj.put("name", "map1");
        obj.put("title", "Map1");
        obj.putObject("proj").put("srs", "EPSG:4326");
        obj.putArray("layers").addObject().put("name", "one");

        MockHttpServletRequestBuilder reqBuilder = post("/api/maps/foo")
            .contentType(MediaType.APPLICATION_JSON)
            .content(obj.toString());

        MockHttpServletRequest req = reqBuilder.buildRequest(new MockServletContext());
        try {
            new MapController(geoServer, new RecentObjectCache())
                .create("foo", new JSONObj().put("name", "map1"), req);
            fail();
        }
View Full Code Here

        JSONArr arr = new JSONArr();
        arr.addObject().put("name", "two");
        arr.addObject().put("name", "one");

        MockHttpServletRequestBuilder req = put("/api/maps/foo/map/layers")
            .contentType(MediaType.APPLICATION_JSON)
            .content(arr.toString());

        @SuppressWarnings("unused")
        MvcResult result = mvc.perform(req)
View Full Code Here

              .defaults()
              .layer("one").featureType().store("foo").defaults()
            .geoServer().build(geoServer);
       
        JSONObj obj;
        MockHttpServletRequestBuilder req;

        obj = new JSONObj().put("title", "new title");
        req = put("/api/maps/foo/map3")
            .contentType(MediaType.APPLICATION_JSON)
            .content(obj.toString());
View Full Code Here

    public void testPost() throws Exception {
        MockGeoServer.get().build(geoServer);

        JSONObj obj = new JSONObj().put("name", "foo").put("uri", "http://foo.org");

        MockHttpServletRequestBuilder request = post("/api/workspaces")
            .contentType(MediaType.APPLICATION_JSON)
            .content(obj.toString());

        MvcResult result = mvc.perform(request)
            .andExpect(status().isCreated())
View Full Code Here

            .workspace("bar", "http://bar.org", false).catalog()
            .geoServer().build(geoServer);

        JSONObj obj = new JSONObj().put("name", "blah");

        MockHttpServletRequestBuilder request = put("/api/workspaces/foo")
            .contentType(MediaType.APPLICATION_JSON)
            .content(obj.toString());

        mvc.perform(request)
            .andExpect(status().isOk())
View Full Code Here

TOP

Related Classes of org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder

Copyright © 2018 www.massapicom. 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.