From 7c08991f12b4958135fdffc26f272677c03630ad Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 11 Jun 2022 15:04:51 -0700 Subject: Inject network client --- .../traccar/speedlimit/OverpassSpeedLimitProviderTest.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/test/java/org/traccar/speedlimit') diff --git a/src/test/java/org/traccar/speedlimit/OverpassSpeedLimitProviderTest.java b/src/test/java/org/traccar/speedlimit/OverpassSpeedLimitProviderTest.java index dcac78f80..aa0be23cf 100644 --- a/src/test/java/org/traccar/speedlimit/OverpassSpeedLimitProviderTest.java +++ b/src/test/java/org/traccar/speedlimit/OverpassSpeedLimitProviderTest.java @@ -3,19 +3,24 @@ package org.traccar.speedlimit; import org.junit.Ignore; import org.junit.Test; +import javax.ws.rs.client.Client; +import javax.ws.rs.client.ClientBuilder; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; public class OverpassSpeedLimitProviderTest { + private final Client client = ClientBuilder.newClient(); + @Ignore @Test public void test() throws Exception { - testLocationProvider(); + testOverpass(); } - public void testLocationProvider() throws Exception { - SpeedLimitProvider provider = new OverpassSpeedLimitProvider("http://8.8.8.8/api/interpreter"); + public void testOverpass() throws Exception { + SpeedLimitProvider provider = new OverpassSpeedLimitProvider(client, "http://8.8.8.8/api/interpreter"); provider.getSpeedLimit(34.74767, -82.48098, new SpeedLimitProvider.SpeedLimitProviderCallback() { @Override -- cgit v1.2.3