Skip to content

Commit 7eab1b6

Browse files
committed
NAVAND-713: update waypoints
1 parent 0309809 commit 7eab1b6

File tree

29 files changed

+143159
-159
lines changed

29 files changed

+143159
-159
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Mapbox welcomes participation and contributions from everyone.
44

55
## Unreleased
66
#### Features
7+
- Supported EV route refresh. TODO
78
#### Bug fixes and improvements
89

910
## Mapbox Navigation SDK 2.9.0-beta.3 - 21 October, 2022

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

Lines changed: 342 additions & 46 deletions
Large diffs are not rendered by default.

instrumentation-tests/src/androidTest/java/com/mapbox/navigation/instrumentation_tests/utils/http/MockDirectionsRefreshHandler.kt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.mapbox.navigation.instrumentation_tests.utils.http
22

3-
import com.mapbox.navigation.testing.ui.http.MockRequestHandler
3+
import com.mapbox.navigation.testing.ui.http.BaseMockRequestHandler
44
import okhttp3.mockwebserver.MockResponse
55
import okhttp3.mockwebserver.RecordedRequest
66

@@ -15,21 +15,18 @@ data class MockDirectionsRefreshHandler(
1515
val jsonResponse: String,
1616
val acceptedGeometryIndex: Int? = null,
1717
val routeIndex: Int? = null,
18-
) : MockRequestHandler {
18+
) : BaseMockRequestHandler() {
1919

20-
private val _handledRequests = mutableListOf<RecordedRequest>()
21-
val handledRequests: List<RecordedRequest> = _handledRequests
2220
var jsonResponseModifier: ((String) -> String) = { it }
2321

24-
override fun handle(request: RecordedRequest): MockResponse? {
22+
override fun handleInternal(request: RecordedRequest): MockResponse? {
2523
val prefix = """/directions-refresh/v1/mapbox/driving-traffic/$testUuid""" +
2624
if (routeIndex != null) { "/$routeIndex/" } else ""
2725
if (request.path!!.startsWith(prefix)) {
2826
val currentGeometryIndex = request.requestUrl
2927
?.queryParameter("current_route_geometry_index")
3028
?.toInt()
3129
if (acceptedGeometryIndex == null || acceptedGeometryIndex == currentGeometryIndex) {
32-
_handledRequests.add(request)
3330
return MockResponse().setBody(jsonResponseModifier(jsonResponse))
3431
}
3532
}

instrumentation-tests/src/androidTest/java/com/mapbox/navigation/instrumentation_tests/utils/http/MockDirectionsRequestHandler.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.mapbox.navigation.instrumentation_tests.utils.http
22

33
import com.mapbox.geojson.Point
4-
import com.mapbox.navigation.testing.ui.http.MockRequestHandler
4+
import com.mapbox.navigation.testing.ui.http.BaseMockRequestHandler
55
import okhttp3.mockwebserver.MockResponse
66
import okhttp3.mockwebserver.RecordedRequest
77

@@ -18,8 +18,8 @@ data class MockDirectionsRequestHandler(
1818
val jsonResponse: String,
1919
val expectedCoordinates: List<Point>?,
2020
val relaxedExpectedCoordinates: Boolean = false,
21-
) : MockRequestHandler {
22-
override fun handle(request: RecordedRequest): MockResponse? {
21+
) : BaseMockRequestHandler() {
22+
override fun handleInternal(request: RecordedRequest): MockResponse? {
2323
val prefix = if (relaxedExpectedCoordinates) {
2424
"""/directions/v5/mapbox/$profile"""
2525
} else {

0 commit comments

Comments
 (0)