Catalog catalog = getCatalog();
assertNull(catalog.getLayerByName("gs:point"));
Importer importer =
GeoServerExtensions.bean(Importer.class, applicationContext);
ImportController ctrl = new ImportController(getGeoServer(), importer);
MockHttpServletRequest request = new MockHttpServletRequest();
request.setContextPath("/geoserver");
request.setRequestURI("/geoserver/hello");
request.setMethod("post");
createMultiPartFormContent(request, "form-data; name=\"upload\"; filename=\"point.zip\"", "application/zip",
IOUtils.toByteArray(getClass().getResourceAsStream("point.shp.zip")));
JSONObj result = ctrl.importFile("gs", request);
assertEquals(1, result.array("imported").size());
JSONObj obj = result.array("imported").object(0);
assertEquals("gs", obj.object("layer").str("workspace"));