Skip to content

Commit 05ef975

Browse files
dzinadgithub-actions[bot]
authored andcommitted
fix test_router_callback_is_not_called
GitOrigin-RevId: 1a6515e59b838087e2f92dc8496945dbe2c93b31
1 parent a15f574 commit 05ef975

File tree

1 file changed

+5
-4
lines changed
  • instrumentation-tests/src/androidTest/java/com/mapbox/navigation/instrumentation_tests/core

1 file changed

+5
-4
lines changed

instrumentation-tests/src/androidTest/java/com/mapbox/navigation/instrumentation_tests/core/CustomRouterTest.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ import kotlinx.coroutines.flow.first
5656
import okhttp3.mockwebserver.MockResponse
5757
import org.junit.Assert.assertEquals
5858
import org.junit.Assert.assertTrue
59-
import org.junit.Assert.fail
6059
import org.junit.Rule
6160
import org.junit.Test
6261

@@ -169,14 +168,15 @@ class CustomRouterTest : BaseCoreNoCleanUpTest() {
169168
withMapboxNavigation(
170169
historyRecorderRule = historyRecorderRule,
171170
) { navigation ->
171+
val clientCallbackInvocationErrors = mutableListOf<String>()
172172
navigation.requestRoutes(
173173
testRouteOptions,
174174
object : NavigationRouterCallback {
175175
override fun onRoutesReady(
176176
routes: List<NavigationRoute>,
177177
@RouterOrigin routerOrigin: String,
178178
) {
179-
fail(
179+
clientCallbackInvocationErrors.add(
180180
"request shouldn't be completed successfully " +
181181
"if user doesn't call test router callback",
182182
)
@@ -186,7 +186,7 @@ class CustomRouterTest : BaseCoreNoCleanUpTest() {
186186
reasons: List<RouterFailure>,
187187
routeOptions: RouteOptions,
188188
) {
189-
fail(
189+
clientCallbackInvocationErrors.add(
190190
"request shouldn't fail" +
191191
"if user doesn't call test router callback",
192192
)
@@ -196,14 +196,15 @@ class CustomRouterTest : BaseCoreNoCleanUpTest() {
196196
routeOptions: RouteOptions,
197197
@RouterOrigin routerOrigin: String,
198198
) {
199-
fail(
199+
clientCallbackInvocationErrors.add(
200200
"request shouldn't be cancelled" +
201201
"if user doesn't call test router callback",
202202
)
203203
}
204204
},
205205
)
206206
testRouteRequested.await()
207+
assertEquals(emptyList<String>(), clientCallbackInvocationErrors)
207208
}
208209
}
209210
}

0 commit comments

Comments
 (0)