CustomRouterRule

interface CustomRouterRule : TestRule

The rule setups a local web server which can serve requests from Navigation SDK. Set baseUrl as RouteOptions.baseUrl to make Nav SDK using local web server. Use createNavigationRouterRule to create an instance of the rule.

The local web server forwards requests from Navigation SDK to MapboxNavigationTestRouter and MapboxNavigationTestRouteRefresher provided by the SDK's user. When a user provided components returns a route or an error, the rule converts it to a response for Nav SDK.

The way Nav SDK communicates with local web server is an implementation detail and could be changed in new releases. The local http server is supposed to be used only by Nav SDK and doesn't provide Directions API features which Nav SDK doesn't use.

Functions

Link copied to clipboard
abstract fun apply(p0: Statement, p1: Description): Statement
Link copied to clipboard
abstract fun setRouter(router: MapboxNavigationTestRouter)

Use this method to set handler of route requests sent by the Nav SDK.

Link copied to clipboard
abstract fun setRouteRefresher(refresher: MapboxNavigationTestRouteRefresher)

Use this method to set handler of route refresh requests sent by the Nav SDK.

Properties

Link copied to clipboard
abstract val baseUrl: String

Set value of this property to RouteOptions.baseUrl to make Nav SDK use local web server.