@@ -56,7 +56,6 @@ import kotlinx.coroutines.flow.first
5656import okhttp3.mockwebserver.MockResponse
5757import org.junit.Assert.assertEquals
5858import org.junit.Assert.assertTrue
59- import org.junit.Assert.fail
6059import org.junit.Rule
6160import 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