diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/backend/MapWithAILayer.java b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/backend/MapWithAILayer.java
index 87a6f52e..324801e9 100644
--- a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/backend/MapWithAILayer.java
+++ b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/backend/MapWithAILayer.java
@@ -34,6 +34,7 @@
import org.openstreetmap.josm.actions.ExpertToggleAction;
import org.openstreetmap.josm.data.Bounds;
+import org.openstreetmap.josm.data.DataSource;
import org.openstreetmap.josm.data.osm.DataSet;
import org.openstreetmap.josm.data.osm.DownloadPolicy;
import org.openstreetmap.josm.data.osm.Node;
@@ -255,6 +256,9 @@ public Icon getIcon() {
public void onPostDownloadFromServer(Bounds bounds) {
super.onPostDownloadFromServer();
GetDataRunnable.cleanup(getDataSet(), bounds, null);
+ if (!this.data.getDataSourceBounds().contains(bounds)) {
+ this.data.addDataSource(new DataSource(bounds, null));
+ }
}
@Override
diff --git a/src/test/resources/wiremock/mappings/maps_ml_roads-146193dd-3082-495b-b350-8164e2858f8d.json b/src/test/resources/wiremock/mappings/maps_ml_roads-146193dd-3082-495b-b350-8164e2858f8d.json
index ba31b951..c45c2bb1 100644
--- a/src/test/resources/wiremock/mappings/maps_ml_roads-146193dd-3082-495b-b350-8164e2858f8d.json
+++ b/src/test/resources/wiremock/mappings/maps_ml_roads-146193dd-3082-495b-b350-8164e2858f8d.json
@@ -16,7 +16,7 @@
},
"response" : {
"status" : 200,
- "body" : "\n\n \n\n",
+ "body" : "\n\n \n\n",
"headers" : {
"Content-Type" : "text/xml; charset=UTF-8",
"Strict-Transport-Security" : "max-age=15552000; preload",
diff --git a/src/test/resources/wiremock/mappings/maps_ml_roads-3098faf3-c028-43c6-9263-42f1cab7c161.json b/src/test/resources/wiremock/mappings/maps_ml_roads-3098faf3-c028-43c6-9263-42f1cab7c161.json
index 98266703..08f1703d 100644
--- a/src/test/resources/wiremock/mappings/maps_ml_roads-3098faf3-c028-43c6-9263-42f1cab7c161.json
+++ b/src/test/resources/wiremock/mappings/maps_ml_roads-3098faf3-c028-43c6-9263-42f1cab7c161.json
@@ -17,7 +17,7 @@
},
"response" : {
"status" : 200,
- "body" : "\n\n",
+ "body" : "\n\n",
"headers" : {
"Content-Type" : "text/xml; charset=UTF-8",
"X-XSS-Protection" : "0",
diff --git a/src/test/resources/wiremock/mappings/maps_ml_roads-e543fb8b-a680-4a1d-9f90-a793b7a7a6a6.json b/src/test/resources/wiremock/mappings/maps_ml_roads-e543fb8b-a680-4a1d-9f90-a793b7a7a6a6.json
index 61349a44..0a25734d 100644
--- a/src/test/resources/wiremock/mappings/maps_ml_roads-e543fb8b-a680-4a1d-9f90-a793b7a7a6a6.json
+++ b/src/test/resources/wiremock/mappings/maps_ml_roads-e543fb8b-a680-4a1d-9f90-a793b7a7a6a6.json
@@ -16,7 +16,7 @@
},
"response" : {
"status" : 200,
- "body" : "\n\n \n\n",
+ "body" : "\n\n \n\n",
"headers" : {
"Content-Type" : "text/xml; charset=UTF-8",
"Strict-Transport-Security" : "max-age=15552000; preload",
diff --git a/src/test/unit/org/openstreetmap/josm/plugins/mapwithai/backend/MapWithAILayerTest.java b/src/test/unit/org/openstreetmap/josm/plugins/mapwithai/backend/MapWithAILayerTest.java
index cfc5327f..519811e5 100644
--- a/src/test/unit/org/openstreetmap/josm/plugins/mapwithai/backend/MapWithAILayerTest.java
+++ b/src/test/unit/org/openstreetmap/josm/plugins/mapwithai/backend/MapWithAILayerTest.java
@@ -27,7 +27,6 @@
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
import org.openstreetmap.josm.TestUtils;
import org.openstreetmap.josm.data.Bounds;
import org.openstreetmap.josm.data.DataSource;
@@ -46,19 +45,16 @@
import org.openstreetmap.josm.plugins.mapwithai.commands.MapWithAIAddCommand;
import org.openstreetmap.josm.plugins.mapwithai.data.mapwithai.MapWithAIInfo;
import org.openstreetmap.josm.plugins.mapwithai.testutils.MapWithAIPluginMock;
-import org.openstreetmap.josm.plugins.mapwithai.testutils.MapWithAITestRules;
import org.openstreetmap.josm.plugins.mapwithai.testutils.annotations.MapWithAISources;
import org.openstreetmap.josm.plugins.mapwithai.testutils.annotations.Wiremock;
import org.openstreetmap.josm.plugins.mapwithai.tools.MapPaintUtils;
import org.openstreetmap.josm.spi.preferences.Config;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.OsmApi;
import org.openstreetmap.josm.testutils.annotations.Projection;
import org.openstreetmap.josm.testutils.annotations.Territories;
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
/**
* Test class for {@link MapWithAILayer}
*
@@ -67,14 +63,11 @@
@BasicPreferences
@Main
@MapWithAISources
+@OsmApi(OsmApi.APIType.FAKE)
@Projection
@Territories(Territories.Initialize.ALL)
@Wiremock
class MapWithAILayerTest {
- @RegisterExtension
- @SuppressFBWarnings("URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
- static JOSMTestRules test = new MapWithAITestRules().main().fakeAPI();
-
MapWithAILayer layer;
@BeforeAll