kopia lustrzana https://github.com/JOSM/MapWithAI
Attempt to fix unit tests
Signed-off-by: Taylor Smock <taylor.smock@kaart.com>pull/1/head
rodzic
458c5acc71
commit
b0355f0c5e
|
@ -46,6 +46,7 @@ import org.openstreetmap.josm.testutils.mockers.WindowMocker;
|
|||
import org.openstreetmap.josm.tools.Logging;
|
||||
|
||||
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
||||
import mockit.Mock;
|
||||
|
||||
public class MapWithAIAddComandTest {
|
||||
private final static String HIGHWAY_RESIDENTIAL = "highway=residential";
|
||||
|
@ -57,6 +58,12 @@ public class MapWithAIAddComandTest {
|
|||
@Before
|
||||
public void setUp() {
|
||||
// Required to avoid an NPE with AutoZoomHandler
|
||||
new WindowMocker() {
|
||||
@Mock
|
||||
public void pack() {
|
||||
// Do nothing
|
||||
}
|
||||
};
|
||||
MainApplication.getLayerManager().addLayer(new OsmDataLayer(new DataSet(), "Temp", null));
|
||||
}
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ import java.util.stream.Collectors;
|
|||
|
||||
import org.awaitility.Awaitility;
|
||||
import org.awaitility.Durations;
|
||||
import org.junit.jupiter.api.extension.InvocationInterceptor.Invocation;
|
||||
import org.junit.runners.model.InitializationError;
|
||||
import org.openstreetmap.josm.gui.MainApplication;
|
||||
import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
|
||||
|
@ -91,6 +92,7 @@ public class MapWithAITestRules extends JOSMTestRules {
|
|||
|
||||
public MapWithAITestRules wiremock() {
|
||||
this.wiremock = true;
|
||||
territories();
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -150,8 +152,11 @@ public class MapWithAITestRules extends JOSMTestRules {
|
|||
// happen...
|
||||
new MockUp<MapWithAILayerInfo>() {
|
||||
@Mock
|
||||
public MapWithAILayerInfo getInstance() {
|
||||
return null;
|
||||
public MapWithAILayerInfo getInstance(Invocation<MapWithAILayerInfo> inv) throws Throwable {
|
||||
if (!sources) {
|
||||
return null;
|
||||
}
|
||||
return inv.proceed();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue