mockspresso-extend / com.episode6.hackit.mockspresso.extend / AbstractMockspressoExtension / Rule

Rule

abstract class Rule<BLDR : MockspressoExtension.Builder<MockspressoExtension<*>!, MockspressoExtension.Rule<*>!, MockspressoExtension.Builder<*, *, *>!>!> : MockspressoExtension.Rule<BLDR>

Extend this abstract class for a custom implementation of the Mockspresso.Rule interface. In the subclass of AbstractMockspressoExtension.Rule, you should only need to override the constructor, providing a lambda that wraps Mockspresso.Builder with your custom subclass of AbstractMockspressoExtension.Builder

Constructors

<init>

Rule(delegate: Rule, builderWrapper: AbstractMockspressoExtension.Wrapper<Builder!, BLDR>)

Functions

apply

open fun apply(base: Statement!, method: FrameworkMethod!, target: Any!): Statement!

buildUpon

open fun buildUpon(): BLDR

create

open fun <T : Any!> create(clazz: Class<T>): T
open fun <T : Any!> create(typeToken: TypeToken<T>): T

getDependency

open fun <T : Any!> getDependency(key: DependencyKey<T>): T

inject

open fun inject(instance: Any): Unit
open fun <T : Any!> inject(instance: T, typeToken: TypeToken<T>): Unit