koin-test / org.koin.test / KoinTest

KoinTest

interface KoinTest : KoinComponent

Koin Test Component

Extension Functions

declare

fun KoinTest.declare(moduleDeclaration: ModuleDeclaration): Unit

Declare component on the fly

declareMock

fun <T : Any> KoinTest.declareMock(qualifier: Qualifier? = null, stubbing: T.() -> Unit = null): T

Declare & Create a mock in Koin container for given type

get

fun <T> KoinTest.get(qualifier: Qualifier? = null, parameters: ParametersDefinition? = null): T

Get an instance from Koin

inject

fun <T> KoinTest.inject(qualifier: Qualifier? = null, parameters: ParametersDefinition? = null): Lazy<T>

Lazy inject an instance from Koin

Inheritors

AutoCloseKoinTest

abstract class AutoCloseKoinTest : KoinTest

Extended Koin Test - embed autoclose @after method to close Koin after every test