mock

fun <T : Any> mock(mode: MockMode? = null, block: MokkeryMockConfigurer.Block<T> = { }): T(source)

Provides mock implementation of given type T.

T must be provided directly and cannot be a generic parameter.

Currently supported types:

  • interfaces (not sealed)

  • function types

  • Abstract/open classes.

Parameters

mode

determines the default behavior when no answer is provided. If not provided, default mode is used.

block

configures the mock right after its creation


fun <T : Any> MokkerySuiteScope.mock(mode: MockMode? = null, block: MokkeryMockConfigurer.Block<T> = { }): T(source)

Provides mock implementation of given type T. It is a child of given MokkerySuiteScope.

T must be provided directly and cannot be a generic parameter.

Currently supported types:

  • interfaces (not sealed)

  • function types

  • Abstract/open classes.

Parameters

mode

determines the default behavior when no answer is provided. If not provided, default mode is used.

block

configures the mock right after its creation