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

ResettingStubberImpl

public final class ResettingStubberImpl implements ResettingStubber


Implementation of ResettingStubber

Summary

Public constructors

Public methods

ActivityResult
void

Marks this spy as initialized.

boolean
void

Clears state (initialization, expected responses).

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.

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 constructors

ResettingStubberImpl

public ResettingStubberImpl()

Public methods

getActivityResultForIntent

public ActivityResult getActivityResultForIntent(Intent intent)

initialize

public void initialize()

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

isInitialized

public boolean isInitialized()
Returns
boolean

true if this spy is initialized

reset

public void reset()

Clears state (initialization, expected responses).

Must be called on main thread.

setActivityResultForIntent

public 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

public 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.