SessionController
public class SessionController
SessionController provides API that allows testing of a Session.
This controller allows:
- Injecting a
TestCarContextinto theSessioninstance, which provides access to the test managers and other testing functionalities.
Summary
Public constructors |
|---|
SessionController(Creates a |
Public methods |
|
|---|---|
@NonNull Session |
Returns the |
@NonNull SessionController |
moveToState(@NonNull Lifecycle.State state)Moves the |
Public constructors
SessionController
public SessionController(
@NonNull Session session,
@NonNull TestCarContext context,
@NonNull Intent intent
)
Creates a SessionController to control the provided Session.
| Parameters | |
|---|---|
@NonNull Session session |
the |
@NonNull TestCarContext context |
the |
@NonNull Intent intent |
the |
| Throws | |
|---|---|
java.lang.NullPointerException |
if |
Public methods
getSession
public @NonNull Session getSession()
Returns the Session that is being controlled.
moveToState
public @NonNull SessionController moveToState(@NonNull Lifecycle.State state)
Moves the Session being controlled to the input state.
Note that DESTROYED is a terminal state, and you cannot move to any other state after the Session reaches that state.
| See also | |
|---|---|
getLifecycle |