Stay organized with collections Save and categorize content based on your preferences.

ResettingStubber

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 functions

Unit

Marks this spy as initialized.

Boolean
Unit

Clears state (initialization, expected responses).

Unit
setActivityResultForIntent(
    matcher: Matcher<Intent>!,
    result: ActivityResult!
)

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.

Unit
setActivityResultFunctionForIntent(
    matcher: Matcher<Intent>!,
    result: ActivityResultFunction!
)

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 functions

initialize

fun initialize(): Unit

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

isInitialized

fun isInitialized(): Boolean
Returns
Boolean

true if this spy is initialized

reset

fun reset(): Unit

Clears state (initialization, expected responses).

Must be called on main thread.

setActivityResultForIntent

fun setActivityResultForIntent(
    matcher: Matcher<Intent>!,
    result: ActivityResult!
): Unit

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

fun setActivityResultFunctionForIntent(
    matcher: Matcher<Intent>!,
    result: ActivityResultFunction!
): Unit

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.