mockspresso-api / com.episode6.hackit.mockspresso / injectType

injectType

inline fun <reified T : Any> Mockspresso.injectType(instance: T): Unit

Inject an existing object with mockspresso dependencies. Field and method injection will be performed (assuming the injector of this mockspresso instance supports it). Uses a reified type and includes a TypeToken in the method call, so will work with generics.

Parameters

instance - The object to inject mocks/dependencies into.