ResettingStubberImpl


class ResettingStubberImpl : ResettingStubber


Implementation of ResettingStubber

Summary

Public constructors

Public functions

Instrumentation.ActivityResult!

Returns the first matching stubbed result for the given activity if stubbed result was set by test author.

Unit

Marks this spy as initialized.

Unit

Clears state (initialization, expected responses).

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.

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.

Public properties

Boolean

Public constructors

ResettingStubberImpl

ResettingStubberImpl()

Public functions

getActivityResultForIntent

fun getActivityResultForIntent(intent: Intent!): Instrumentation.ActivityResult!

Returns the first matching stubbed result for the given activity if stubbed result was set by test author. The method searches the list of existing matcher/response pairs in reverse order of which they were entered; i.e. the last stubbing has the highest priority. If no stubbed result matching the given intent is found, null is returned.

Must be called on main thread.

initialize

fun initialize(): Unit

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

reset

fun reset(): Unit

Clears state (initialization, expected responses).

Must be called on main thread.

setActivityResultForIntent

fun setActivityResultForIntent(
    matcher: Matcher<Intent!>!,
    result: Instrumentation.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.

Public properties

isInitialized

val isInitializedBoolean