diff --git a/OsmAnd-java/test/java/net/osmand/router/RouteResultPreparationTest.java b/OsmAnd-java/test/java/net/osmand/router/RouteResultPreparationTest.java index 608685449d..a5f3a5b9ad 100644 --- a/OsmAnd-java/test/java/net/osmand/router/RouteResultPreparationTest.java +++ b/OsmAnd-java/test/java/net/osmand/router/RouteResultPreparationTest.java @@ -3,7 +3,6 @@ package net.osmand.router; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import net.osmand.PlatformUtil; -import net.osmand.router.TestEntry; import net.osmand.binary.BinaryMapIndexReader; import net.osmand.data.LatLon; import org.apache.commons.logging.Log; @@ -89,6 +88,7 @@ public class RouteResultPreparationTest { public void testLanes() throws Exception { List routeSegments = fe.searchRoute(ctx, startPoint, endPoint, null); + Set reachedSegments = new TreeSet(); int prevSegment = -1; for (int i = 0; i <= routeSegments.size(); i++) { @@ -110,6 +110,15 @@ public class RouteResultPreparationTest { } prevSegment = i; } + + if (i < routeSegments.size()) { + reachedSegments.add(routeSegments.get(i).getObject().getId()); + } + } + + Set expectedSegments = expectedResults.keySet(); + for (Long expSegId : expectedSegments){ + Assert.assertTrue("Expected segment " + expSegId + " weren't reached in route segments " + reachedSegments.toString(), reachedSegments.contains(expSegId)); } }