ResettingStubber

public interface ResettingStubber

Known direct subclasses

A sneaky singleton object used to respond to intents with fake responses. This interface is not meant for public consumption. Test authors should use Intents instead.

Summary

Public methods

abstract void

Marks this spy as initialized.

abstract boolean
abstract void

Clears state (initialization, expected responses).

abstract void
setActivityResultForIntent(
    Matcher<Intent> matcher,
    ActivityResult result
)

Sets the result that will be returned to the intent sender (if the sender expects the result), next time an intent matched by the given matcher is launched.

abstract void
setActivityResultFunctionForIntent(
    Matcher<Intent> matcher,
    ActivityResultFunction result
)

Sets a result function that will be called by the intent sender (if the sender expects the result), next time an intent matched by the given matcher is launched.

Public methods

initialize

abstract void initialize()

Marks this spy as initialized. Once initialized, ResettingStubber begins recording intents and provides intent stubbing.

isInitialized

abstract boolean isInitialized()
Returns
boolean

true if this spy is initialized

reset

abstract void reset()

Clears state (initialization, expected responses).

Must be called on main thread.

setActivityResultForIntent

abstract void setActivityResultForIntent(
    Matcher<Intent> matcher,
    ActivityResult result
)

Sets the result that will be returned to the intent sender (if the sender expects the result), next time an intent matched by the given matcher is launched.

setActivityResultFunctionForIntent

abstract void setActivityResultFunctionForIntent(
    Matcher<Intent> matcher,
    ActivityResultFunction result
)

Sets a result function that will be called by the intent sender (if the sender expects the result), next time an intent matched by the given matcher is launched.