Android 12 Developer Preview is here! Try it out, and give us your feedback!

TestNavigationManager

public class TestNavigationManager
extends NavigationManager

java.lang.Object
   ↳ com.google.android.libraries.car.app.navigation.NavigationManager
     ↳ com.google.android.libraries.car.app.testing.navigation.TestNavigationManager


The NavigationManager that is used for testing.

This class will track the following usages of the NavigationManager throughout your test:

Summary

Public methods

int getNavigationEndedCount()

Retrieves the number of times that navigation was ended via NavigationManager.navigationEnded() since the creation or the last call to reset().

List<NavigationManagerListener> getNavigationManagerListenersSet()

Retrieves all the NavigationManagerListeners added via NavigationManager.setListener(NavigationManagerListener).

int getNavigationStartedCount()

Retrieves the number of times that navigation was started via NavigationManager.navigationStarted() since the creation or the last call to reset().

List<TripController> getTripsSent()

Retrieves all the Trips sent via NavigationManager.updateTrip(Trip).

void reset()

Resets the values tracked by this TestNavigationManager.

Inherited methods

Public methods

getNavigationEndedCount

public int getNavigationEndedCount ()

Retrieves the number of times that navigation was ended via NavigationManager.navigationEnded() since the creation or the last call to reset().

Returns
int

getNavigationManagerListenersSet

public List<NavigationManagerListener> getNavigationManagerListenersSet ()

Retrieves all the NavigationManagerListeners added via NavigationManager.setListener(NavigationManagerListener).

The listeners are stored in order of calls.

The listeners will be stored until reset() is called.

Returns
List<NavigationManagerListener>

getNavigationStartedCount

public int getNavigationStartedCount ()

Retrieves the number of times that navigation was started via NavigationManager.navigationStarted() since the creation or the last call to reset().

Returns
int

getTripsSent

public List<TripController> getTripsSent ()

Retrieves all the Trips sent via NavigationManager.updateTrip(Trip).

The trips are stored in order of calls.

The trips will be stored until reset() is called.

Returns
List<TripController>

reset

public void reset ()

Resets the values tracked by this TestNavigationManager.