interface Mockspresso
Main mockspresso interface
interface Builder
Class used to build Mockspresso and Mockspresso.Rule instances. |
|
interface Rule : Mockspresso, MethodRule
An implementation of Mockspresso that also implements JUnit's |
abstract fun buildUpon(): Mockspresso.Builder
Build upon this mockspresso instance's configuration and dependencies. |
|
abstract fun <T : Any!> create(clazz: Class<T>): T abstract fun <T : Any!> create(typeToken: TypeToken<T>): T
Create a real object injected with mockspresso dependencies. |
|
abstract fun <T : Any!> getDependency(key: DependencyKey<T>): T
Get a dependency (creating a new mock, if needed) from mockspresso. We purposefully don't annotate the return-type here NotNull because nulls are theoretically allowed dependencies (they just must be mapped explicitly). So kotlin users must assume nullability via platform-type. |
|
abstract fun inject(instance: Any): Unit
Inject an existing object with mockspresso dependencies. Field and method injection will be performed (assuming the injector of this mockspresso instance supports it) abstract fun <T : Any!> inject(instance: T, typeToken: TypeToken<T>): Unit
An alternative signature to |
fun <T : Any> Mockspresso.createNew(): T
Create a real object of type T injected with mockspresso dependencies. |
|
fun <T : Any> Mockspresso.getDependencyOf(qualifier: Annotation? = null): T?
Get a dependency (creating a new mock, if needed) from mockspresso. |
|
fun <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. |
interface Rule : Mockspresso, MethodRule
An implementation of Mockspresso that also implements JUnit's |