Apply a workaround for JOSM-19132

Signed-off-by: Taylor Smock <taylor.smock@kaart.com>
pull/1/head
Taylor Smock 2020-04-22 07:10:35 -06:00
rodzic 0f18d8c9d7
commit e3197bb6da
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 625F6A74A3E4311A
2 zmienionych plików z 4 dodań i 2 usunięć

Wyświetl plik

@ -47,6 +47,7 @@ import org.openstreetmap.josm.plugins.mapwithai.data.mapwithai.MapWithAIInfo;
import org.openstreetmap.josm.plugins.mapwithai.testutils.MapWithAITestRules;
import org.openstreetmap.josm.spi.preferences.Config;
import org.openstreetmap.josm.testutils.JOSMTestRules;
import org.openstreetmap.josm.tools.Territories;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
@ -65,6 +66,7 @@ public class MapWithAILayerTest {
@Before
public void setUp() {
layer = new MapWithAILayer(new DataSet(), "test", null);
Territories.initialize(); // Required to avoid an NPE (see JOSM-19132)
}
@Test

Wyświetl plik

@ -74,8 +74,8 @@ public class MapWithAITestRules extends JOSMTestRules {
private static void setupMapWithAILayerInfo(WireMockServer wireMockServer) {
synchronized (MapWithAITestRules.class) {
resetMapWithAILayerInfo();
MapWithAILayerInfo.instance.getLayers().stream()
.forEach(i -> i.setUrl(GetDataRunnableTest.getDefaultMapWithAIAPIForTest(wireMockServer, i.getUrl())));
MapWithAILayerInfo.instance.getLayers().stream().forEach(
i -> i.setUrl(GetDataRunnableTest.getDefaultMapWithAIAPIForTest(wireMockServer, i.getUrl())));
MapWithAILayerInfo.instance.save();
}
}