From 60b99acef9777b21802a4c68cc529d0723a1c11e Mon Sep 17 00:00:00 2001 From: Taylor Smock Date: Wed, 3 Jun 2020 15:02:04 -0600 Subject: [PATCH] Extract ESRI server reader to separate file * Also add source provider information * Update pjson -> json (the latter is slightly more efficient) Signed-off-by: Taylor Smock --- .../data/mapwithai/MapWithAILayerInfo.java | 131 +----------- .../mapwithai/MapWithAIProvidersPanel.java | 10 +- .../io/mapwithai/ESRISourceReader.java | 197 ++++++++++++++++++ .../io/mapwithai/MapWithAISourceReader.java | 2 - ...-ffce8d3a-c21a-410b-9303-2b59875b76aa.json | 4 +- ...-ee34e070-0bf4-4a36-bfe5-4833a8f25ae5.json | 4 +- ...-f5b30af0-0177-459b-ac7a-b4fc0be7d99a.json | 4 +- ...-d0e9831e-6eff-4f7e-83ee-f09bad38c40d.json | 4 +- ...-4a594e6d-4b81-42ad-b547-39005f2a5f62.json | 4 +- ...-8cd10b04-891d-4d27-9282-82e7349f5bd3.json | 4 +- ...-757edf0f-0dc4-4b42-869e-1bc2cf3ecf31.json | 4 +- ...-e759c7d0-92ff-4db5-9bd8-25c500797126.json | 4 +- ...-1b8f292c-d3b0-4281-ad07-680b02579e6b.json | 4 +- ...-50f13bcb-6c47-4133-acd6-2def98086289.json | 4 +- ...-9bba8228-60ea-4b25-b140-ea7b4aeb79ab.json | 4 +- ...-7950efe2-fcb1-4457-9b3a-fd281eb49684.json | 4 +- ...-89bb3fed-c485-401c-a9b9-9c5b367f81a0.json | 4 +- ...-1ab90e03-6781-4f0b-97c0-9e66b728c81c.json | 4 +- ...-1edea050-3368-40f5-80ae-099dba138e0d.json | 4 +- ...-fba7d31c-8e1c-42d7-ac61-99a0be815a3f.json | 4 +- ...-66d2a4b2-09ce-46d3-b9c9-a0c7489fefab.json | 4 +- ...-d64a22d3-e6e0-4dc6-ae5c-f9a2ba8f8485.json | 4 +- ...-ee758a6b-79d6-48a2-8af6-df2afe4ba8d8.json | 2 +- .../mapwithai/ESRISourceReaderTest.java} | 18 +- 24 files changed, 259 insertions(+), 173 deletions(-) create mode 100644 src/main/java/org/openstreetmap/josm/plugins/mapwithai/io/mapwithai/ESRISourceReader.java rename test/unit/org/openstreetmap/josm/plugins/mapwithai/{data/mapwithai/MapWithAILayerInfoTest.java => io/mapwithai/ESRISourceReaderTest.java} (57%) diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/data/mapwithai/MapWithAILayerInfo.java b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/data/mapwithai/MapWithAILayerInfo.java index 597b57a..84f4b0c 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/data/mapwithai/MapWithAILayerInfo.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/data/mapwithai/MapWithAILayerInfo.java @@ -3,13 +3,11 @@ package org.openstreetmap.josm.plugins.mapwithai.data.mapwithai; import static org.openstreetmap.josm.tools.I18n.tr; -import java.io.BufferedReader; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; -import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -18,28 +16,16 @@ import java.util.Objects; import java.util.Set; import java.util.TreeSet; import java.util.concurrent.ExecutorService; -import java.util.regex.Pattern; -import java.util.stream.Collectors; - -import javax.json.Json; -import javax.json.JsonArray; -import javax.json.JsonNumber; -import javax.json.JsonObject; -import javax.json.JsonReader; -import javax.json.JsonString; -import javax.json.JsonStructure; -import javax.json.JsonValue; import org.openstreetmap.josm.data.StructUtils; import org.openstreetmap.josm.data.imagery.ImageryInfo; -import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryBounds; import org.openstreetmap.josm.gui.PleaseWaitRunnable; import org.openstreetmap.josm.gui.util.GuiHelper; import org.openstreetmap.josm.io.CachedFile; import org.openstreetmap.josm.io.NetworkManager; import org.openstreetmap.josm.io.imagery.ImageryReader; -import org.openstreetmap.josm.plugins.mapwithai.data.mapwithai.MapWithAIInfo.MapWithAICategory; import org.openstreetmap.josm.plugins.mapwithai.data.mapwithai.MapWithAIInfo.MapWithAIPreferenceEntry; +import org.openstreetmap.josm.plugins.mapwithai.io.mapwithai.ESRISourceReader; import org.openstreetmap.josm.plugins.mapwithai.io.mapwithai.MapWithAISourceReader; import org.openstreetmap.josm.spi.preferences.Config; import org.openstreetmap.josm.tools.Logging; @@ -213,7 +199,11 @@ public class MapWithAILayerInfo { defaultLayers.addAll(newLayers); for (MapWithAIInfo layer : newLayers) { if (MapWithAIInfo.MapWithAIType.ESRI.equals(layer.getSourceType())) { - allDefaultLayers.addAll(addEsriLayer(layer)); + try (ESRISourceReader reader = new ESRISourceReader(layer)) { + allDefaultLayers.addAll(reader.parse()); + } catch (IOException e) { + Logging.error(e); + } } else { allDefaultLayers.add(layer); } @@ -234,115 +224,6 @@ public class MapWithAILayerInfo { } } - /** - * Take a {@link MapWithAIInfo.MapWithAIType#ESRI} layer and convert it to a - * list of "true" layers. - * - * @param layer The ESRI layer (no checks performed here) - * @return The layers to be added instead of the ESRI layer. - */ - public static Collection addEsriLayer(MapWithAIInfo layer) { - Pattern startReplace = Pattern.compile("\\{start\\}"); - String search = "/search?sortField=added&sortOrder=desc&num=12&start={start}&f=json"; - String url = layer.getUrl(); - String group = layer.getId(); - if (!url.endsWith("/")) { - url = url.concat("/"); - } - - Collection information = new HashSet<>(); - - String next = "1"; - String searchUrl = startReplace.matcher(search).replaceAll(next); - while (!next.equals("-1")) { - try (CachedFile layers = new CachedFile(url + "content/groups/" + group + searchUrl); - BufferedReader i = layers.getContentReader(); - JsonReader reader = Json.createReader(i)) { - JsonStructure parser = reader.read(); - if (parser.getValueType().equals(JsonValue.ValueType.OBJECT)) { - JsonObject obj = parser.asJsonObject(); - next = obj.getString("nextStart", "-1"); - searchUrl = startReplace.matcher(search).replaceAll(next); - JsonArray features = obj.getJsonArray("results"); - for (JsonObject feature : features.getValuesAs(JsonObject.class)) { - // Use the initial esri server information to keep conflation info - MapWithAIInfo newInfo = new MapWithAIInfo(layer); - newInfo.setId(feature.getString("id")); - if (feature.getString("type", "").equals("Feature Service")) { - newInfo.setUrl(featureService(newInfo, feature.getString("url"))); - } else { - newInfo.setUrl(feature.getString("url")); - } - newInfo.setName(feature.getString("title", feature.getString("name"))); - String[] extent = feature.getJsonArray("extent").getValuesAs(JsonArray.class).stream() - .flatMap(array -> array.getValuesAs(JsonNumber.class).stream()) - .map(JsonNumber::doubleValue).map(Object::toString).toArray(String[]::new); - ImageryBounds imageryBounds = new ImageryBounds( - String.join(",", extent[1], extent[0], extent[3], extent[2]), ","); - newInfo.setBounds(imageryBounds); - newInfo.setSourceType(MapWithAIInfo.MapWithAIType.ESRI_FEATURE_SERVER); - newInfo.setTermsOfUseText(feature.getString("licenseInfo", null)); - if (feature.containsKey("thumbnail")) { - newInfo.setAttributionImageURL(url + "content/items/" + newInfo.getId() + "/info/" - + feature.getString("thumbnail")); - } - if (feature.containsKey("groupCategories")) { - MapWithAICategory category = feature.getJsonArray("groupCategories") - .getValuesAs(JsonString.class).stream().map(JsonString::getString) - .map(s -> s.replace("/Categories/", "")).map(MapWithAICategory::fromString) - .filter(Objects::nonNull).findFirst().orElse(MapWithAICategory.OTHER); - newInfo.setCategory(category); - } - newInfo.setDescription(feature.getString("snippet")); - information.add(newInfo); - } - } - } catch (ClassCastException | IOException e) { - Logging.error(e); - next = "-1"; - } - } - Comparator comparator = (o1, o2) -> o1.getCategory().getDescription() - .compareTo(o2.getCategory().getDescription()); - if (information != null) { - information = information.stream().sorted(comparator).collect(Collectors.toSet()); - } - return information; - } - - private static String featureService(MapWithAIInfo mapwithaiInfo, String url) { - String toGet = url.endsWith("pjson") ? url : url.concat("?f=pjson"); - try (CachedFile featureServer = new CachedFile(toGet); - BufferedReader br = featureServer.getContentReader(); - JsonReader reader = Json.createReader(br)) { - JsonObject info = reader.readObject(); - JsonArray layers = info.getJsonArray("layers"); - // TODO use all the layers? - JsonObject layer = layers.get(0).asJsonObject(); - String partialUrl = (url.endsWith("/") ? url : url + "/") + layer.getInt("id"); - mapwithaiInfo.setReplacementTags(getReplacementTags(partialUrl)); - - return partialUrl; - } catch (IOException e) { - Logging.error(e); - return null; - } - } - - private static Map getReplacementTags(String layerUrl) { - String toGet = layerUrl.endsWith("?f=pjson") ? layerUrl : layerUrl.concat("?f=pjson"); - try (CachedFile featureServer = new CachedFile(toGet); - BufferedReader br = featureServer.getContentReader(); - JsonReader reader = Json.createReader(br)) { - - return reader.readObject().getJsonArray("fields").getValuesAs(JsonObject.class).stream() - .collect(Collectors.toMap(o -> o.getString("name"), o -> o.getString("alias", null))); - } catch (IOException e) { - Logging.error(e); - } - return Collections.emptyMap(); - } - /** * Build the mapping of unique ids to {@link ImageryInfo}s. * diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/gui/preferences/mapwithai/MapWithAIProvidersPanel.java b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/gui/preferences/mapwithai/MapWithAIProvidersPanel.java index dbd0a2a..7c2a6c9 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/gui/preferences/mapwithai/MapWithAIProvidersPanel.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/gui/preferences/mapwithai/MapWithAIProvidersPanel.java @@ -13,6 +13,7 @@ import java.awt.event.ActionEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.geom.Rectangle2D; +import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -63,6 +64,7 @@ import org.openstreetmap.josm.gui.widgets.HtmlPanel; import org.openstreetmap.josm.plugins.mapwithai.data.mapwithai.MapWithAIInfo; import org.openstreetmap.josm.plugins.mapwithai.data.mapwithai.MapWithAIInfo.MapWithAICategory; import org.openstreetmap.josm.plugins.mapwithai.data.mapwithai.MapWithAILayerInfo; +import org.openstreetmap.josm.plugins.mapwithai.io.mapwithai.ESRISourceReader; import org.openstreetmap.josm.tools.GBC; import org.openstreetmap.josm.tools.ImageProvider; import org.openstreetmap.josm.tools.ImageProvider.ImageSizes; @@ -577,8 +579,12 @@ public class MapWithAIProvidersPanel extends JPanel { try { MapWithAIInfo info = p.getSourceInfo(); if (MapWithAIInfo.MapWithAIType.ESRI.equals(info.getSourceType())) { - for (MapWithAIInfo i : MapWithAILayerInfo.addEsriLayer(info)) { - activeModel.addRow(i); + try (ESRISourceReader reader = new ESRISourceReader(info)) { + for (MapWithAIInfo i : reader.parse()) { + activeModel.addRow(i); + } + } catch (IOException e) { + Logging.error(e); } } else { activeModel.addRow(info); diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/io/mapwithai/ESRISourceReader.java b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/io/mapwithai/ESRISourceReader.java new file mode 100644 index 0000000..9bd69a6 --- /dev/null +++ b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/io/mapwithai/ESRISourceReader.java @@ -0,0 +1,197 @@ +// License: GPL. For details, see LICENSE file. +package org.openstreetmap.josm.plugins.mapwithai.io.mapwithai; + +import java.io.BufferedReader; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +import javax.json.Json; +import javax.json.JsonArray; +import javax.json.JsonNumber; +import javax.json.JsonObject; +import javax.json.JsonReader; +import javax.json.JsonString; +import javax.json.JsonStructure; +import javax.json.JsonValue; + +import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryBounds; +import org.openstreetmap.josm.io.CachedFile; +import org.openstreetmap.josm.plugins.mapwithai.data.mapwithai.MapWithAIInfo; +import org.openstreetmap.josm.plugins.mapwithai.data.mapwithai.MapWithAIInfo.MapWithAICategory; +import org.openstreetmap.josm.tools.HttpClient; +import org.openstreetmap.josm.tools.Logging; +import org.openstreetmap.josm.tools.Utils; + +/** + * Take a {@link MapWithAIInfo.MapWithAIType#ESRI} layer and convert it to a + * list of "true" layers. + */ +public class ESRISourceReader implements Closeable { + private final MapWithAIInfo source; + private CachedFile cachedFile; + private boolean fastFail; + private static final String JSON_QUERY_PARAM = "?f=json"; + + /** + * Constructs a {@code ImageryReader} from a given filename, URL or internal + * resource. + * + * @param source can be: + *
    + *
  • relative or absolute file name
  • + *
  • {@code file:///SOME/FILE} the same as above
  • + *
  • {@code http://...} a URL. It will be cached on disk.
  • + *
  • {@code resource://SOME/FILE} file from the classpath + * (usually in the current *.jar)
  • + *
  • {@code josmdir://SOME/FILE} file inside josm user data + * directory (since r7058)
  • + *
  • {@code josmplugindir://SOME/FILE} file inside josm plugin + * directory (since r7834)
  • + *
+ */ + public ESRISourceReader(MapWithAIInfo source) { + this.source = source; + } + + /** + * Parses MapWithAI source. + * + * @return list of source info + * @throws IOException if any I/O error occurs + */ + public List parse() throws IOException { + Pattern startReplace = Pattern.compile("\\{start\\}"); + String search = "/search" + JSON_QUERY_PARAM + "&sortField=added&sortOrder=desc&num=12&start={start}"; + String url = source.getUrl(); + String group = source.getId(); + if (!url.endsWith("/")) { + url = url.concat("/"); + } + + List information = new ArrayList<>(); + + String next = "1"; + String searchUrl = startReplace.matcher(search).replaceAll(next); + while (!next.equals("-1")) { + try (CachedFile layers = new CachedFile(url + "content/groups/" + group + searchUrl); + BufferedReader i = layers.getContentReader(); + JsonReader reader = Json.createReader(i)) { + layers.setFastFail(fastFail); + JsonStructure parser = reader.read(); + if (parser.getValueType().equals(JsonValue.ValueType.OBJECT)) { + JsonObject obj = parser.asJsonObject(); + next = obj.getString("nextStart", "-1"); + searchUrl = startReplace.matcher(search).replaceAll(next); + JsonArray features = obj.getJsonArray("results"); + for (JsonObject feature : features.getValuesAs(JsonObject.class)) { + information.add(parse(feature)); + } + } + } catch (ClassCastException | IOException e) { + Logging.error(e); + next = "-1"; + } + } + Comparator comparator = (o1, o2) -> o1.getCategory().getDescription() + .compareTo(o2.getCategory().getDescription()); + if (information != null) { + information = information.stream().sorted(comparator).collect(Collectors.toList()); + } + return information; + } + + private MapWithAIInfo parse(JsonObject feature) { + // Use the initial esri server information to keep conflation info + MapWithAIInfo newInfo = new MapWithAIInfo(source); + newInfo.setId(feature.getString("id")); + if (feature.getString("type", "").equals("Feature Service")) { + newInfo.setUrl(featureService(newInfo, feature.getString("url"))); + } else { + newInfo.setUrl(feature.getString("url")); + } + newInfo.setName(feature.getString("title", feature.getString("name"))); + String[] extent = feature.getJsonArray("extent").getValuesAs(JsonArray.class).stream() + .flatMap(array -> array.getValuesAs(JsonNumber.class).stream()).map(JsonNumber::doubleValue) + .map(Object::toString).toArray(String[]::new); + ImageryBounds imageryBounds = new ImageryBounds(String.join(",", extent[1], extent[0], extent[3], extent[2]), + ","); + newInfo.setBounds(imageryBounds); + newInfo.setSourceType(MapWithAIInfo.MapWithAIType.ESRI_FEATURE_SERVER); + newInfo.setTermsOfUseText(feature.getString("licenseInfo", null)); + if (feature.containsKey("thumbnail")) { + newInfo.setAttributionImageURL( + source.getUrl() + "content/items/" + newInfo.getId() + "/info/" + feature.getString("thumbnail")); + } + if (feature.containsKey("groupCategories")) { + MapWithAICategory category = feature.getJsonArray("groupCategories").getValuesAs(JsonString.class).stream() + .map(JsonString::getString).map(s -> s.replace("/Categories/", "")) + .map(MapWithAICategory::fromString).filter(Objects::nonNull).findFirst() + .orElse(MapWithAICategory.OTHER); + newInfo.setCategory(category); + } + + if (feature.containsKey("accessInformation")) { + newInfo.setAttributionText(feature.getString("accessInformation")); + } + newInfo.setDescription(feature.getString("snippet")); + return (newInfo); + } + + private static String featureService(MapWithAIInfo mapwithaiInfo, String url) { + String toGet = url.endsWith(JSON_QUERY_PARAM) ? url : url.concat(JSON_QUERY_PARAM); + try (CachedFile featureServer = new CachedFile(toGet); + BufferedReader br = featureServer.getContentReader(); + JsonReader reader = Json.createReader(br)) { + JsonObject info = reader.readObject(); + JsonArray layers = info.getJsonArray("layers"); + // TODO use all the layers? + JsonObject layer = layers.get(0).asJsonObject(); + String partialUrl = (url.endsWith("/") ? url : url + "/") + layer.getInt("id"); + mapwithaiInfo.setReplacementTags(getReplacementTags(partialUrl)); + + return partialUrl; + } catch (IOException e) { + Logging.error(e); + return null; + } + } + + private static Map getReplacementTags(String layerUrl) { + String toGet = layerUrl.endsWith(JSON_QUERY_PARAM) ? layerUrl : layerUrl.concat(JSON_QUERY_PARAM); + try (CachedFile featureServer = new CachedFile(toGet); + BufferedReader br = featureServer.getContentReader(); + JsonReader reader = Json.createReader(br)) { + + return reader.readObject().getJsonArray("fields").getValuesAs(JsonObject.class).stream() + .collect(Collectors.toMap(o -> o.getString("name"), o -> o.getString("alias", null))); + } catch (IOException e) { + Logging.error(e); + } + return Collections.emptyMap(); + } + + /** + * Sets whether opening HTTP connections should fail fast, i.e., whether a + * {@link HttpClient#setConnectTimeout(int) low connect timeout} should be used. + * + * @param fastFail whether opening HTTP connections should fail fast + * @see CachedFile#setFastFail(boolean) + */ + public void setFastFail(boolean fastFail) { + this.fastFail = fastFail; + } + + @Override + public void close() throws IOException { + Utils.close(cachedFile); + } + +} diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/io/mapwithai/MapWithAISourceReader.java b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/io/mapwithai/MapWithAISourceReader.java index 95aa401..f3640b3 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/io/mapwithai/MapWithAISourceReader.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/io/mapwithai/MapWithAISourceReader.java @@ -23,7 +23,6 @@ import javax.json.JsonStructure; import javax.json.JsonValue; import org.openstreetmap.josm.data.coor.LatLon; -import org.openstreetmap.josm.data.imagery.ImageryInfo; import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryBounds; import org.openstreetmap.josm.data.imagery.Shape; import org.openstreetmap.josm.data.osm.BBox; @@ -90,7 +89,6 @@ public class MapWithAISourceReader implements Closeable { public List parse() throws IOException { List entries = Collections.emptyList(); cachedFile = new CachedFile(source); - cachedFile.setParam(String.join(",", ImageryInfo.getActiveIds())); cachedFile.setFastFail(fastFail); try (JsonReader reader = Json.createReader(cachedFile.setMaxAge(CachedFile.DAYS) .setCachingStrategy(CachedFile.CachingStrategy.IfModifiedSince).getContentReader())) { diff --git a/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_alexandria_va_addresses_featureserver-ffce8d3a-c21a-410b-9303-2b59875b76aa.json b/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_alexandria_va_addresses_featureserver-ffce8d3a-c21a-410b-9303-2b59875b76aa.json index 8351dce..c2da30b 100644 --- a/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_alexandria_va_addresses_featureserver-ffce8d3a-c21a-410b-9303-2b59875b76aa.json +++ b/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_alexandria_va_addresses_featureserver-ffce8d3a-c21a-410b-9303-2b59875b76aa.json @@ -2,7 +2,7 @@ "id" : "ffce8d3a-c21a-410b-9303-2b59875b76aa", "name" : "do88dok2xjtucxd1_arcgis_rest_services_alexandria_va_addresses_featureserver", "request" : { - "url" : "/Do88DoK2xjTUCXd1/arcgis/rest/services/Alexandria_VA_Addresses/FeatureServer?f=pjson", + "url" : "/Do88DoK2xjTUCXd1/arcgis/rest/services/Alexandria_VA_Addresses/FeatureServer?f=json", "method" : "GET" }, "response" : { @@ -27,4 +27,4 @@ "uuid" : "ffce8d3a-c21a-410b-9303-2b59875b76aa", "persistent" : true, "insertionIndex" : 33 -} \ No newline at end of file +} diff --git a/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_alexandria_va_addresses_featureserver_0-ee34e070-0bf4-4a36-bfe5-4833a8f25ae5.json b/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_alexandria_va_addresses_featureserver_0-ee34e070-0bf4-4a36-bfe5-4833a8f25ae5.json index 801ea06..fe0e9ac 100644 --- a/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_alexandria_va_addresses_featureserver_0-ee34e070-0bf4-4a36-bfe5-4833a8f25ae5.json +++ b/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_alexandria_va_addresses_featureserver_0-ee34e070-0bf4-4a36-bfe5-4833a8f25ae5.json @@ -2,7 +2,7 @@ "id" : "ee34e070-0bf4-4a36-bfe5-4833a8f25ae5", "name" : "do88dok2xjtucxd1_arcgis_rest_services_alexandria_va_addresses_featureserver_0", "request" : { - "url" : "/Do88DoK2xjTUCXd1/arcgis/rest/services/Alexandria_VA_Addresses/FeatureServer/0?f=pjson", + "url" : "/Do88DoK2xjTUCXd1/arcgis/rest/services/Alexandria_VA_Addresses/FeatureServer/0?f=json", "method" : "GET" }, "response" : { @@ -27,4 +27,4 @@ "uuid" : "ee34e070-0bf4-4a36-bfe5-4833a8f25ae5", "persistent" : true, "insertionIndex" : 35 -} \ No newline at end of file +} diff --git a/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_flagstaff_az_addresses_featureserver-f5b30af0-0177-459b-ac7a-b4fc0be7d99a.json b/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_flagstaff_az_addresses_featureserver-f5b30af0-0177-459b-ac7a-b4fc0be7d99a.json index a028bec..8914561 100644 --- a/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_flagstaff_az_addresses_featureserver-f5b30af0-0177-459b-ac7a-b4fc0be7d99a.json +++ b/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_flagstaff_az_addresses_featureserver-f5b30af0-0177-459b-ac7a-b4fc0be7d99a.json @@ -2,7 +2,7 @@ "id" : "f5b30af0-0177-459b-ac7a-b4fc0be7d99a", "name" : "do88dok2xjtucxd1_arcgis_rest_services_flagstaff_az_addresses_featureserver", "request" : { - "url" : "/Do88DoK2xjTUCXd1/arcgis/rest/services/Flagstaff_AZ_Addresses/FeatureServer?f=pjson", + "url" : "/Do88DoK2xjTUCXd1/arcgis/rest/services/Flagstaff_AZ_Addresses/FeatureServer?f=json", "method" : "GET" }, "response" : { @@ -27,4 +27,4 @@ "uuid" : "f5b30af0-0177-459b-ac7a-b4fc0be7d99a", "persistent" : true, "insertionIndex" : 23 -} \ No newline at end of file +} diff --git a/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_flagstaff_az_addresses_featureserver_0-d0e9831e-6eff-4f7e-83ee-f09bad38c40d.json b/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_flagstaff_az_addresses_featureserver_0-d0e9831e-6eff-4f7e-83ee-f09bad38c40d.json index d325530..dfa69a4 100644 --- a/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_flagstaff_az_addresses_featureserver_0-d0e9831e-6eff-4f7e-83ee-f09bad38c40d.json +++ b/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_flagstaff_az_addresses_featureserver_0-d0e9831e-6eff-4f7e-83ee-f09bad38c40d.json @@ -2,7 +2,7 @@ "id" : "d0e9831e-6eff-4f7e-83ee-f09bad38c40d", "name" : "do88dok2xjtucxd1_arcgis_rest_services_flagstaff_az_addresses_featureserver_0", "request" : { - "url" : "/Do88DoK2xjTUCXd1/arcgis/rest/services/Flagstaff_AZ_Addresses/FeatureServer/0?f=pjson", + "url" : "/Do88DoK2xjTUCXd1/arcgis/rest/services/Flagstaff_AZ_Addresses/FeatureServer/0?f=json", "method" : "GET" }, "response" : { @@ -27,4 +27,4 @@ "uuid" : "d0e9831e-6eff-4f7e-83ee-f09bad38c40d", "persistent" : true, "insertionIndex" : 40 -} \ No newline at end of file +} diff --git a/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_franklincounty_buildings_featureserver-4a594e6d-4b81-42ad-b547-39005f2a5f62.json b/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_franklincounty_buildings_featureserver-4a594e6d-4b81-42ad-b547-39005f2a5f62.json index 6e18d2a..a28da60 100644 --- a/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_franklincounty_buildings_featureserver-4a594e6d-4b81-42ad-b547-39005f2a5f62.json +++ b/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_franklincounty_buildings_featureserver-4a594e6d-4b81-42ad-b547-39005f2a5f62.json @@ -2,7 +2,7 @@ "id" : "4a594e6d-4b81-42ad-b547-39005f2a5f62", "name" : "do88dok2xjtucxd1_arcgis_rest_services_franklincounty_buildings_featureserver", "request" : { - "url" : "/Do88DoK2xjTUCXd1/arcgis/rest/services/FranklinCounty_buildings/FeatureServer?f=pjson", + "url" : "/Do88DoK2xjTUCXd1/arcgis/rest/services/FranklinCounty_buildings/FeatureServer?f=json", "method" : "GET" }, "response" : { @@ -27,4 +27,4 @@ "uuid" : "4a594e6d-4b81-42ad-b547-39005f2a5f62", "persistent" : true, "insertionIndex" : 31 -} \ No newline at end of file +} diff --git a/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_franklincounty_buildings_featureserver_0-8cd10b04-891d-4d27-9282-82e7349f5bd3.json b/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_franklincounty_buildings_featureserver_0-8cd10b04-891d-4d27-9282-82e7349f5bd3.json index 964cc6e..cf61e9f 100644 --- a/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_franklincounty_buildings_featureserver_0-8cd10b04-891d-4d27-9282-82e7349f5bd3.json +++ b/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_franklincounty_buildings_featureserver_0-8cd10b04-891d-4d27-9282-82e7349f5bd3.json @@ -2,7 +2,7 @@ "id" : "8cd10b04-891d-4d27-9282-82e7349f5bd3", "name" : "do88dok2xjtucxd1_arcgis_rest_services_franklincounty_buildings_featureserver_0", "request" : { - "url" : "/Do88DoK2xjTUCXd1/arcgis/rest/services/FranklinCounty_buildings/FeatureServer/0?f=pjson", + "url" : "/Do88DoK2xjTUCXd1/arcgis/rest/services/FranklinCounty_buildings/FeatureServer/0?f=json", "method" : "GET" }, "response" : { @@ -27,4 +27,4 @@ "uuid" : "8cd10b04-891d-4d27-9282-82e7349f5bd3", "persistent" : true, "insertionIndex" : 36 -} \ No newline at end of file +} diff --git a/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_orange_county_ca_buildings_featureserver-757edf0f-0dc4-4b42-869e-1bc2cf3ecf31.json b/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_orange_county_ca_buildings_featureserver-757edf0f-0dc4-4b42-869e-1bc2cf3ecf31.json index dd0734a..0d33b30 100644 --- a/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_orange_county_ca_buildings_featureserver-757edf0f-0dc4-4b42-869e-1bc2cf3ecf31.json +++ b/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_orange_county_ca_buildings_featureserver-757edf0f-0dc4-4b42-869e-1bc2cf3ecf31.json @@ -2,7 +2,7 @@ "id" : "757edf0f-0dc4-4b42-869e-1bc2cf3ecf31", "name" : "do88dok2xjtucxd1_arcgis_rest_services_orange_county_ca_buildings_featureserver", "request" : { - "url" : "/Do88DoK2xjTUCXd1/arcgis/rest/services/Orange_County_CA_Buildings/FeatureServer?f=pjson", + "url" : "/Do88DoK2xjTUCXd1/arcgis/rest/services/Orange_County_CA_Buildings/FeatureServer?f=json", "method" : "GET" }, "response" : { @@ -27,4 +27,4 @@ "uuid" : "757edf0f-0dc4-4b42-869e-1bc2cf3ecf31", "persistent" : true, "insertionIndex" : 37 -} \ No newline at end of file +} diff --git a/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_orange_county_ca_buildings_featureserver_0-e759c7d0-92ff-4db5-9bd8-25c500797126.json b/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_orange_county_ca_buildings_featureserver_0-e759c7d0-92ff-4db5-9bd8-25c500797126.json index e50b5c5..a330ac9 100644 --- a/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_orange_county_ca_buildings_featureserver_0-e759c7d0-92ff-4db5-9bd8-25c500797126.json +++ b/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_orange_county_ca_buildings_featureserver_0-e759c7d0-92ff-4db5-9bd8-25c500797126.json @@ -2,7 +2,7 @@ "id" : "e759c7d0-92ff-4db5-9bd8-25c500797126", "name" : "do88dok2xjtucxd1_arcgis_rest_services_orange_county_ca_buildings_featureserver_0", "request" : { - "url" : "/Do88DoK2xjTUCXd1/arcgis/rest/services/Orange_County_CA_Buildings/FeatureServer/0?f=pjson", + "url" : "/Do88DoK2xjTUCXd1/arcgis/rest/services/Orange_County_CA_Buildings/FeatureServer/0?f=json", "method" : "GET" }, "response" : { @@ -27,4 +27,4 @@ "uuid" : "e759c7d0-92ff-4db5-9bd8-25c500797126", "persistent" : true, "insertionIndex" : 33 -} \ No newline at end of file +} diff --git a/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_riverside_ca_buildings_featureserver-1b8f292c-d3b0-4281-ad07-680b02579e6b.json b/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_riverside_ca_buildings_featureserver-1b8f292c-d3b0-4281-ad07-680b02579e6b.json index 45e2cfb..8cd7e0c 100644 --- a/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_riverside_ca_buildings_featureserver-1b8f292c-d3b0-4281-ad07-680b02579e6b.json +++ b/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_riverside_ca_buildings_featureserver-1b8f292c-d3b0-4281-ad07-680b02579e6b.json @@ -2,7 +2,7 @@ "id" : "1b8f292c-d3b0-4281-ad07-680b02579e6b", "name" : "do88dok2xjtucxd1_arcgis_rest_services_riverside_ca_buildings_featureserver", "request" : { - "url" : "/Do88DoK2xjTUCXd1/arcgis/rest/services/Riverside_CA_Buildings/FeatureServer?f=pjson", + "url" : "/Do88DoK2xjTUCXd1/arcgis/rest/services/Riverside_CA_Buildings/FeatureServer?f=json", "method" : "GET" }, "response" : { @@ -27,4 +27,4 @@ "uuid" : "1b8f292c-d3b0-4281-ad07-680b02579e6b", "persistent" : true, "insertionIndex" : 25 -} \ No newline at end of file +} diff --git a/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_riverside_ca_buildings_featureserver_0-50f13bcb-6c47-4133-acd6-2def98086289.json b/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_riverside_ca_buildings_featureserver_0-50f13bcb-6c47-4133-acd6-2def98086289.json index e65fab1..850e201 100644 --- a/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_riverside_ca_buildings_featureserver_0-50f13bcb-6c47-4133-acd6-2def98086289.json +++ b/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_riverside_ca_buildings_featureserver_0-50f13bcb-6c47-4133-acd6-2def98086289.json @@ -2,7 +2,7 @@ "id" : "50f13bcb-6c47-4133-acd6-2def98086289", "name" : "do88dok2xjtucxd1_arcgis_rest_services_riverside_ca_buildings_featureserver_0", "request" : { - "url" : "/Do88DoK2xjTUCXd1/arcgis/rest/services/Riverside_CA_Buildings/FeatureServer/0?f=pjson", + "url" : "/Do88DoK2xjTUCXd1/arcgis/rest/services/Riverside_CA_Buildings/FeatureServer/0?f=json", "method" : "GET" }, "response" : { @@ -29,4 +29,4 @@ "scenarioName" : "scenario-2-Do88DoK2xjTUCXd1-arcgis-rest-services-Riverside_CA_Buildings-FeatureServer-0", "requiredScenarioState" : "scenario-2-Do88DoK2xjTUCXd1-arcgis-rest-services-Riverside_CA_Buildings-FeatureServer-0-2", "insertionIndex" : 42 -} \ No newline at end of file +} diff --git a/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_riverside_ca_buildings_featureserver_0-9bba8228-60ea-4b25-b140-ea7b4aeb79ab.json b/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_riverside_ca_buildings_featureserver_0-9bba8228-60ea-4b25-b140-ea7b4aeb79ab.json index d3bc6f9..f800d72 100644 --- a/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_riverside_ca_buildings_featureserver_0-9bba8228-60ea-4b25-b140-ea7b4aeb79ab.json +++ b/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_riverside_ca_buildings_featureserver_0-9bba8228-60ea-4b25-b140-ea7b4aeb79ab.json @@ -2,7 +2,7 @@ "id" : "9bba8228-60ea-4b25-b140-ea7b4aeb79ab", "name" : "do88dok2xjtucxd1_arcgis_rest_services_riverside_ca_buildings_featureserver_0", "request" : { - "url" : "/Do88DoK2xjTUCXd1/arcgis/rest/services/Riverside_CA_Buildings/FeatureServer/0?f=pjson", + "url" : "/Do88DoK2xjTUCXd1/arcgis/rest/services/Riverside_CA_Buildings/FeatureServer/0?f=json", "method" : "GET" }, "response" : { @@ -30,4 +30,4 @@ "requiredScenarioState" : "Started", "newScenarioState" : "scenario-2-Do88DoK2xjTUCXd1-arcgis-rest-services-Riverside_CA_Buildings-FeatureServer-0-2", "insertionIndex" : 39 -} \ No newline at end of file +} diff --git a/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_sarpy_county_ne_addresses_featureserver-7950efe2-fcb1-4457-9b3a-fd281eb49684.json b/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_sarpy_county_ne_addresses_featureserver-7950efe2-fcb1-4457-9b3a-fd281eb49684.json index dbad0f3..b96684d 100644 --- a/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_sarpy_county_ne_addresses_featureserver-7950efe2-fcb1-4457-9b3a-fd281eb49684.json +++ b/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_sarpy_county_ne_addresses_featureserver-7950efe2-fcb1-4457-9b3a-fd281eb49684.json @@ -2,7 +2,7 @@ "id" : "7950efe2-fcb1-4457-9b3a-fd281eb49684", "name" : "do88dok2xjtucxd1_arcgis_rest_services_sarpy_county_ne_addresses_featureserver", "request" : { - "url" : "/Do88DoK2xjTUCXd1/arcgis/rest/services/Sarpy_County_NE_Addresses/FeatureServer?f=pjson", + "url" : "/Do88DoK2xjTUCXd1/arcgis/rest/services/Sarpy_County_NE_Addresses/FeatureServer?f=json", "method" : "GET" }, "response" : { @@ -27,4 +27,4 @@ "uuid" : "7950efe2-fcb1-4457-9b3a-fd281eb49684", "persistent" : true, "insertionIndex" : 29 -} \ No newline at end of file +} diff --git a/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_sarpy_county_ne_addresses_featureserver_1-89bb3fed-c485-401c-a9b9-9c5b367f81a0.json b/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_sarpy_county_ne_addresses_featureserver_1-89bb3fed-c485-401c-a9b9-9c5b367f81a0.json index 870f18b..a528cbd 100644 --- a/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_sarpy_county_ne_addresses_featureserver_1-89bb3fed-c485-401c-a9b9-9c5b367f81a0.json +++ b/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_sarpy_county_ne_addresses_featureserver_1-89bb3fed-c485-401c-a9b9-9c5b367f81a0.json @@ -2,7 +2,7 @@ "id" : "89bb3fed-c485-401c-a9b9-9c5b367f81a0", "name" : "do88dok2xjtucxd1_arcgis_rest_services_sarpy_county_ne_addresses_featureserver_1", "request" : { - "url" : "/Do88DoK2xjTUCXd1/arcgis/rest/services/Sarpy_County_NE_Addresses/FeatureServer/1?f=pjson", + "url" : "/Do88DoK2xjTUCXd1/arcgis/rest/services/Sarpy_County_NE_Addresses/FeatureServer/1?f=json", "method" : "GET" }, "response" : { @@ -27,4 +27,4 @@ "uuid" : "89bb3fed-c485-401c-a9b9-9c5b367f81a0", "persistent" : true, "insertionIndex" : 37 -} \ No newline at end of file +} diff --git a/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_sarpy_county_ne_buildings_featureserver-1ab90e03-6781-4f0b-97c0-9e66b728c81c.json b/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_sarpy_county_ne_buildings_featureserver-1ab90e03-6781-4f0b-97c0-9e66b728c81c.json index f25ec12..de5015c 100644 --- a/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_sarpy_county_ne_buildings_featureserver-1ab90e03-6781-4f0b-97c0-9e66b728c81c.json +++ b/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_sarpy_county_ne_buildings_featureserver-1ab90e03-6781-4f0b-97c0-9e66b728c81c.json @@ -2,7 +2,7 @@ "id" : "1ab90e03-6781-4f0b-97c0-9e66b728c81c", "name" : "do88dok2xjtucxd1_arcgis_rest_services_sarpy_county_ne_buildings_featureserver", "request" : { - "url" : "/Do88DoK2xjTUCXd1/arcgis/rest/services/Sarpy_County_NE_Buildings/FeatureServer?f=pjson", + "url" : "/Do88DoK2xjTUCXd1/arcgis/rest/services/Sarpy_County_NE_Buildings/FeatureServer?f=json", "method" : "GET" }, "response" : { @@ -27,4 +27,4 @@ "uuid" : "1ab90e03-6781-4f0b-97c0-9e66b728c81c", "persistent" : true, "insertionIndex" : 27 -} \ No newline at end of file +} diff --git a/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_sarpy_county_ne_buildings_featureserver_1-1edea050-3368-40f5-80ae-099dba138e0d.json b/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_sarpy_county_ne_buildings_featureserver_1-1edea050-3368-40f5-80ae-099dba138e0d.json index 867a75c..2a589b2 100644 --- a/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_sarpy_county_ne_buildings_featureserver_1-1edea050-3368-40f5-80ae-099dba138e0d.json +++ b/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_sarpy_county_ne_buildings_featureserver_1-1edea050-3368-40f5-80ae-099dba138e0d.json @@ -2,7 +2,7 @@ "id" : "1edea050-3368-40f5-80ae-099dba138e0d", "name" : "do88dok2xjtucxd1_arcgis_rest_services_sarpy_county_ne_buildings_featureserver_1", "request" : { - "url" : "/Do88DoK2xjTUCXd1/arcgis/rest/services/Sarpy_County_NE_Buildings/FeatureServer/1?f=pjson", + "url" : "/Do88DoK2xjTUCXd1/arcgis/rest/services/Sarpy_County_NE_Buildings/FeatureServer/1?f=json", "method" : "GET" }, "response" : { @@ -30,4 +30,4 @@ "requiredScenarioState" : "Started", "newScenarioState" : "scenario-1-Do88DoK2xjTUCXd1-arcgis-rest-services-Sarpy_County_NE_Buildings-FeatureServer-1-2", "insertionIndex" : 38 -} \ No newline at end of file +} diff --git a/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_sarpy_county_ne_buildings_featureserver_1-fba7d31c-8e1c-42d7-ac61-99a0be815a3f.json b/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_sarpy_county_ne_buildings_featureserver_1-fba7d31c-8e1c-42d7-ac61-99a0be815a3f.json index f4afbd6..fd24ad9 100644 --- a/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_sarpy_county_ne_buildings_featureserver_1-fba7d31c-8e1c-42d7-ac61-99a0be815a3f.json +++ b/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_sarpy_county_ne_buildings_featureserver_1-fba7d31c-8e1c-42d7-ac61-99a0be815a3f.json @@ -2,7 +2,7 @@ "id" : "fba7d31c-8e1c-42d7-ac61-99a0be815a3f", "name" : "do88dok2xjtucxd1_arcgis_rest_services_sarpy_county_ne_buildings_featureserver_1", "request" : { - "url" : "/Do88DoK2xjTUCXd1/arcgis/rest/services/Sarpy_County_NE_Buildings/FeatureServer/1?f=pjson", + "url" : "/Do88DoK2xjTUCXd1/arcgis/rest/services/Sarpy_County_NE_Buildings/FeatureServer/1?f=json", "method" : "GET" }, "response" : { @@ -29,4 +29,4 @@ "scenarioName" : "scenario-1-Do88DoK2xjTUCXd1-arcgis-rest-services-Sarpy_County_NE_Buildings-FeatureServer-1", "requiredScenarioState" : "scenario-1-Do88DoK2xjTUCXd1-arcgis-rest-services-Sarpy_County_NE_Buildings-FeatureServer-1-2", "insertionIndex" : 41 -} \ No newline at end of file +} diff --git a/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_wb_zanzibar_buildings_featureserver-66d2a4b2-09ce-46d3-b9c9-a0c7489fefab.json b/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_wb_zanzibar_buildings_featureserver-66d2a4b2-09ce-46d3-b9c9-a0c7489fefab.json index c0268f0..ce7beb2 100644 --- a/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_wb_zanzibar_buildings_featureserver-66d2a4b2-09ce-46d3-b9c9-a0c7489fefab.json +++ b/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_wb_zanzibar_buildings_featureserver-66d2a4b2-09ce-46d3-b9c9-a0c7489fefab.json @@ -2,7 +2,7 @@ "id" : "66d2a4b2-09ce-46d3-b9c9-a0c7489fefab", "name" : "do88dok2xjtucxd1_arcgis_rest_services_wb_zanzibar_buildings_featureserver", "request" : { - "url" : "/Do88DoK2xjTUCXd1/arcgis/rest/services/WB_Zanzibar_Buildings/FeatureServer?f=pjson", + "url" : "/Do88DoK2xjTUCXd1/arcgis/rest/services/WB_Zanzibar_Buildings/FeatureServer?f=json", "method" : "GET" }, "response" : { @@ -27,4 +27,4 @@ "uuid" : "66d2a4b2-09ce-46d3-b9c9-a0c7489fefab", "persistent" : true, "insertionIndex" : 35 -} \ No newline at end of file +} diff --git a/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_wb_zanzibar_buildings_featureserver_0-d64a22d3-e6e0-4dc6-ae5c-f9a2ba8f8485.json b/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_wb_zanzibar_buildings_featureserver_0-d64a22d3-e6e0-4dc6-ae5c-f9a2ba8f8485.json index 0575ea2..4306323 100644 --- a/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_wb_zanzibar_buildings_featureserver_0-d64a22d3-e6e0-4dc6-ae5c-f9a2ba8f8485.json +++ b/test/resources/wiremock/mappings/do88dok2xjtucxd1_arcgis_rest_services_wb_zanzibar_buildings_featureserver_0-d64a22d3-e6e0-4dc6-ae5c-f9a2ba8f8485.json @@ -2,7 +2,7 @@ "id" : "d64a22d3-e6e0-4dc6-ae5c-f9a2ba8f8485", "name" : "do88dok2xjtucxd1_arcgis_rest_services_wb_zanzibar_buildings_featureserver_0", "request" : { - "url" : "/Do88DoK2xjTUCXd1/arcgis/rest/services/WB_Zanzibar_Buildings/FeatureServer/0?f=pjson", + "url" : "/Do88DoK2xjTUCXd1/arcgis/rest/services/WB_Zanzibar_Buildings/FeatureServer/0?f=json", "method" : "GET" }, "response" : { @@ -27,4 +27,4 @@ "uuid" : "d64a22d3-e6e0-4dc6-ae5c-f9a2ba8f8485", "persistent" : true, "insertionIndex" : 34 -} \ No newline at end of file +} diff --git a/test/resources/wiremock/mappings/sharing_rest_content_groups_bdf6c800b3ae453b9db239e03d7c1727_search-ee758a6b-79d6-48a2-8af6-df2afe4ba8d8.json b/test/resources/wiremock/mappings/sharing_rest_content_groups_bdf6c800b3ae453b9db239e03d7c1727_search-ee758a6b-79d6-48a2-8af6-df2afe4ba8d8.json index 3885eb6..fbbf573 100644 --- a/test/resources/wiremock/mappings/sharing_rest_content_groups_bdf6c800b3ae453b9db239e03d7c1727_search-ee758a6b-79d6-48a2-8af6-df2afe4ba8d8.json +++ b/test/resources/wiremock/mappings/sharing_rest_content_groups_bdf6c800b3ae453b9db239e03d7c1727_search-ee758a6b-79d6-48a2-8af6-df2afe4ba8d8.json @@ -2,7 +2,7 @@ "id" : "ee758a6b-79d6-48a2-8af6-df2afe4ba8d8", "name" : "sharing_rest_content_groups_bdf6c800b3ae453b9db239e03d7c1727_search", "request" : { - "url" : "/sharing/rest/content/groups/bdf6c800b3ae453b9db239e03d7c1727/search?sortField=added&sortOrder=desc&num=12&start=1&f=json", + "url" : "/sharing/rest/content/groups/bdf6c800b3ae453b9db239e03d7c1727/search?f=json&sortField=added&sortOrder=desc&num=12&start=1", "method" : "GET" }, "response" : { diff --git a/test/unit/org/openstreetmap/josm/plugins/mapwithai/data/mapwithai/MapWithAILayerInfoTest.java b/test/unit/org/openstreetmap/josm/plugins/mapwithai/io/mapwithai/ESRISourceReaderTest.java similarity index 57% rename from test/unit/org/openstreetmap/josm/plugins/mapwithai/data/mapwithai/MapWithAILayerInfoTest.java rename to test/unit/org/openstreetmap/josm/plugins/mapwithai/io/mapwithai/ESRISourceReaderTest.java index d58fa41..8e09c3e 100644 --- a/test/unit/org/openstreetmap/josm/plugins/mapwithai/data/mapwithai/MapWithAILayerInfoTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/mapwithai/io/mapwithai/ESRISourceReaderTest.java @@ -1,33 +1,37 @@ // License: GPL. For details, see LICENSE file. -package org.openstreetmap.josm.plugins.mapwithai.data.mapwithai; +package org.openstreetmap.josm.plugins.mapwithai.io.mapwithai; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; +import java.io.IOException; import java.util.Arrays; import java.util.Collection; import org.junit.Rule; import org.junit.Test; +import org.openstreetmap.josm.plugins.mapwithai.data.mapwithai.MapWithAIInfo; import org.openstreetmap.josm.plugins.mapwithai.data.mapwithai.MapWithAIInfo.MapWithAIType; import org.openstreetmap.josm.plugins.mapwithai.testutils.MapWithAITestRules; -public class MapWithAILayerInfoTest { +public class ESRISourceReaderTest { @Rule public MapWithAITestRules rule = (MapWithAITestRules) new MapWithAITestRules().wiremock().projection(); @Test - public void testAddEsriLayer() { + public void testAddEsriLayer() throws IOException { // TODO wiremock MapWithAIInfo info = new MapWithAIInfo("TEST", "test_url", "bdf6c800b3ae453b9db239e03d7c1727"); info.setSourceType(MapWithAIType.ESRI); String tUrl = rule.getWireMock().baseUrl() + "/sharing/rest"; for (String url : Arrays.asList(tUrl, tUrl + "/")) { info.setUrl(url); - Collection layers = MapWithAILayerInfo.addEsriLayer(info); - assertFalse(layers.isEmpty()); - assertTrue(layers.stream().noneMatch(i -> info.getUrl().equals(i.getUrl()))); - assertTrue(layers.stream().allMatch(i -> MapWithAIType.ESRI_FEATURE_SERVER.equals(i.getSourceType()))); + try (ESRISourceReader reader = new ESRISourceReader(info)) { + Collection layers = reader.parse(); + assertFalse(layers.isEmpty()); + assertTrue(layers.stream().noneMatch(i -> info.getUrl().equals(i.getUrl()))); + assertTrue(layers.stream().allMatch(i -> MapWithAIType.ESRI_FEATURE_SERVER.equals(i.getSourceType()))); + } } } }