@@ -64,18 +64,21 @@ class ArtificialDriverTest {
6464 }
6565 val notTrackingStates = states.filter { it.routeState != RouteState .TRACKING }
6666 assertTrue(
67- " not all states are tracking, see history file $historyFile : $notTrackingStates " ,
67+ " not all states are tracking, " +
68+ " see history file $historyFile : $notTrackingStates " ,
6869 notTrackingStates.isEmpty()
6970 )
7071 }
7172 }
73+ }
7274
73- private fun createArtificialLocationUpdates (testRoute : NavigationRoute ): List <ReplayEventUpdateLocation > {
74- val replayRouteMapper = ReplayRouteMapper ()
75- return replayRouteMapper
76- .mapDirectionsRouteGeometry(testRoute.directionsRoute)
77- .filterIsInstance<ReplayEventUpdateLocation >()
78- }
75+ private fun createArtificialLocationUpdates (
76+ testRoute : NavigationRoute
77+ ): List <ReplayEventUpdateLocation > {
78+ val replayRouteMapper = ReplayRouteMapper ()
79+ return replayRouteMapper
80+ .mapDirectionsRouteGeometry(testRoute.directionsRoute)
81+ .filterIsInstance<ReplayEventUpdateLocation >()
7982}
8083
8184private suspend fun MapboxNativeNavigator.collectStatuses (
@@ -107,7 +110,9 @@ fun MapboxNativeNavigator.statusUpdates(): Flow<OnStatusUpdateParameters> {
107110 }
108111}
109112
110- private suspend fun withNavigators (block : suspend (MapboxNavigation , MapboxNativeNavigator ) -> Unit ) {
113+ private suspend fun withNavigators (
114+ block : suspend (MapboxNavigation , MapboxNativeNavigator ) -> Unit
115+ ) {
111116 val context = InstrumentationRegistry .getInstrumentation().targetContext
112117 val mapboxNavigation = MapboxNavigationProvider .create(
113118 NavigationOptions .Builder (context)
@@ -123,7 +128,14 @@ private fun getTestRoute(): NavigationRoute {
123128 return NavigationRoute .create(
124129 directionsResponseJson = context.resources.openRawResource(R .raw.test_long_route)
125130 .readBytes().decodeToString(),
126- routeRequestUrl = " https://api.mapbox.com/directions/v5/mapbox/driving/11.566744%2C48.143769%3B8.675521%2C50.119087?alternatives=false&geometries=polyline6&language=en&overview=full&steps=true&access_token=YOUR_MAPBOX_ACCESS_TOKEN" ,
131+ routeRequestUrl = " https://api.mapbox.com/directions/v5/mapbox/driving/" +
132+ " 11.566744%2C48.143769%3B8.675521%2C50.119087" +
133+ " ?alternatives=false" +
134+ " &geometries=polyline6" +
135+ " &language=en" +
136+ " &overview=full" +
137+ " &steps=true" +
138+ " &access_token=YOUR_MAPBOX_ACCESS_TOKEN" ,
127139 routerOrigin = RouterOrigin .Custom ()
128140 ).first()
129141}
0 commit comments