diff --git a/libdirections-hybrid/src/test/java/com/mapbox/navigation/route/hybrid/MapboxHybridRouterTest.kt b/libdirections-hybrid/src/test/java/com/mapbox/navigation/route/hybrid/MapboxHybridRouterTest.kt index 6cf9c87c017..ebf836bc27e 100644 --- a/libdirections-hybrid/src/test/java/com/mapbox/navigation/route/hybrid/MapboxHybridRouterTest.kt +++ b/libdirections-hybrid/src/test/java/com/mapbox/navigation/route/hybrid/MapboxHybridRouterTest.kt @@ -190,8 +190,6 @@ class MapboxHybridRouterTest { } catch (ex: Exception) { } - every { context.unregisterReceiver(any()) } answers {} - verify { context.unregisterReceiver(any()) } } diff --git a/libnavigation-util/src/test/java/com/mapbox/navigation/utils/internal/ThreadControllerTest.kt b/libnavigation-util/src/test/java/com/mapbox/navigation/utils/internal/ThreadControllerTest.kt index cbbc95df681..39b574a6ab9 100644 --- a/libnavigation-util/src/test/java/com/mapbox/navigation/utils/internal/ThreadControllerTest.kt +++ b/libnavigation-util/src/test/java/com/mapbox/navigation/utils/internal/ThreadControllerTest.kt @@ -1,6 +1,5 @@ package com.mapbox.navigation.utils.internal -import com.mapbox.navigation.testing.MainCoroutineRule import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.channels.ClosedReceiveChannelException import kotlinx.coroutines.delay @@ -10,16 +9,12 @@ import org.hamcrest.CoreMatchers.`is` import org.junit.Assert.assertFalse import org.junit.Assert.assertThat import org.junit.Assert.assertTrue -import org.junit.Rule import org.junit.Test class ThreadControllerTest { - @get:Rule - val coroutineRule = MainCoroutineRule() - @Test - fun jobCountValidationNonUIScope() = coroutineRule.runBlockingTest { + fun jobCountValidationNonUIScope() { val maxCoroutines = 10 val maxDelay = 100L val jobControl = ThreadController.getIOScopeAndRootJob() diff --git a/libnavigator/src/main/java/com/mapbox/navigation/navigator/internal/MapboxNativeNavigator.kt b/libnavigator/src/main/java/com/mapbox/navigation/navigator/internal/MapboxNativeNavigator.kt index bdc591e8bc3..adf0b97c698 100644 --- a/libnavigator/src/main/java/com/mapbox/navigation/navigator/internal/MapboxNativeNavigator.kt +++ b/libnavigator/src/main/java/com/mapbox/navigation/navigator/internal/MapboxNativeNavigator.kt @@ -19,7 +19,6 @@ import java.util.Date interface MapboxNativeNavigator { companion object { - private const val INDEX_FIRST_ROUTE = 0 private const val INDEX_FIRST_LEG = 0 private const val GRID_SIZE = 0.0025f private const val BUFFER_DILATION: Short = 1 @@ -69,7 +68,6 @@ interface MapboxNativeNavigator { * Otherwise, it returns a invalid route state. * * @param route [DirectionsRoute] to follow. - * @param routeIndex Which route to follow * @param legIndex Which leg to follow * * @return a [NavigationStatus] route state if no errors occurred. @@ -77,7 +75,6 @@ interface MapboxNativeNavigator { */ suspend fun setRoute( route: DirectionsRoute?, - routeIndex: Int = INDEX_FIRST_ROUTE, legIndex: Int = INDEX_FIRST_LEG ): NavigationStatus diff --git a/libnavigator/src/main/java/com/mapbox/navigation/navigator/internal/MapboxNativeNavigatorImpl.kt b/libnavigator/src/main/java/com/mapbox/navigation/navigator/internal/MapboxNativeNavigatorImpl.kt index f29c546d87e..01e899b55c2 100644 --- a/libnavigator/src/main/java/com/mapbox/navigation/navigator/internal/MapboxNativeNavigatorImpl.kt +++ b/libnavigator/src/main/java/com/mapbox/navigation/navigator/internal/MapboxNativeNavigatorImpl.kt @@ -117,7 +117,6 @@ object MapboxNativeNavigatorImpl : MapboxNativeNavigator { * Otherwise, it returns a invalid route state. * * @param route [DirectionsRoute] to follow. - * @param routeIndex Which route to follow * @param legIndex Which leg to follow * * @return a [NavigationStatus] route state if no errors occurred. @@ -125,12 +124,11 @@ object MapboxNativeNavigatorImpl : MapboxNativeNavigator { */ override suspend fun setRoute( route: DirectionsRoute?, - routeIndex: Int, legIndex: Int ): NavigationStatus { mutex.withLock { MapboxNativeNavigatorImpl.route = route - val result = navigator.setRoute(route?.toJson() ?: "{}", routeIndex, legIndex) + val result = navigator.setRoute(route?.toJson() ?: "{}", PRIMARY_ROUTE_INDEX, legIndex) navigator.getRouteBufferGeoJson(GRID_SIZE, BUFFER_DILATION)?.also { routeBufferGeoJson = GeometryGeoJson.fromJson(it) }