Add a wait for Availability tests

Signed-off-by: Taylor Smock <taylor.smock@kaart.com>
pull/1/head
Taylor Smock 2019-10-16 07:23:56 -06:00
rodzic 8641bfc357
commit 95614e2e80
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 625F6A74A3E4311A
4 zmienionych plików z 18 dodań i 5 usunięć

Wyświetl plik

@ -83,6 +83,13 @@ build:
dependencies:
- assemble
test:
stage: test
script:
- ./gradlew test --stacktrace
dependencies:
- assemble
compile against min JOSM:
stage: test
script:

Wyświetl plik

@ -40,7 +40,8 @@ public class MapWithAIAction extends JosmAction {
public void actionPerformed(ActionEvent event) {
if (isEnabled()) {
MapWithAIDataUtils.getMapWithAIData(MapWithAIDataUtils.getLayer(true));
createMessageDialog();
MapWithAIAvailability.getInstance();
// createMessageDialog();
}
}
@ -56,8 +57,8 @@ public class MapWithAIAction extends JosmAction {
final List<Bounds> bounds = new ArrayList<>(layer.getDataSet().getDataSourceBounds());
if (bounds.isEmpty()) {
MainApplication.getLayerManager().getLayersOfType(OsmDataLayer.class).stream()
.map(OsmDataLayer::getDataSet).filter(Objects::nonNull).map(DataSet::getDataSourceBounds)
.forEach(bounds::addAll);
.map(OsmDataLayer::getDataSet).filter(Objects::nonNull).map(DataSet::getDataSourceBounds)
.forEach(bounds::addAll);
}
final StringBuilder message = new StringBuilder();
message.append(MapWithAIPlugin.NAME);

Wyświetl plik

@ -15,7 +15,7 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
public class MapWithAIActionTest {
@Rule
@SuppressFBWarnings("URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
public JOSMTestRules test = new JOSMTestRules().preferences().main().projection();
public JOSMTestRules test = new JOSMTestRules().main().projection();
private MapWithAIAction action;

Wyświetl plik

@ -2,6 +2,9 @@
package org.openstreetmap.josm.plugins.mapwithai.backend;
import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;
import static org.awaitility.Awaitility.await;
import java.util.concurrent.TimeUnit;
import org.junit.Assert;
import org.junit.Before;
@ -21,7 +24,7 @@ public class MapWithAIAvailabilityTest {
@Rule
@SuppressFBWarnings("URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
public JOSMTestRules test = new JOSMTestRules().preferences().main().projection();
public JOSMTestRules test = new JOSMTestRules();
@Rule
public WireMockRule wireMockRule = new WireMockRule(options().usingFilesUnderDirectory("test/resources/wiremock"));
@ -32,6 +35,8 @@ public class MapWithAIAvailabilityTest {
+ "/facebookmicrosites/Open-Mapping-At-Facebook/master/data/rapid_realeases.geojson");
Territories.initialize();
instance = MapWithAIAvailability.getInstance();
LatLon temp = new LatLon(40, -100);
await().atMost(10, TimeUnit.SECONDS).until(() -> Territories.isIso3166Code("US", temp));
}
@Test