mockspresso-mockito / com.episode6.hackit.mockspresso.mockito / MockitoAutoFactoryMaker

MockitoAutoFactoryMaker

open class MockitoAutoFactoryMaker : SpecialObjectMaker

An implementation of SpecialObjectMaker that creates mock factories which in-turn query the dependencyProvider for a real binding when their methods are called. Mockito is used to mock the factory classes with a default answer. Upon invocation, that default answer will query the dependencyProvider for a key based on the invoked method's return type (and the factory's optional qualifier annotation). This class should support most generic factory types.

Constructors

<init>

MockitoAutoFactoryMaker(classes: MutableList<Class<*>!>!)

Functions

canMakeObject

open fun canMakeObject(key: DependencyKey<*>): Boolean

create

open static fun create(vararg classes: Class<*>!): MockitoAutoFactoryMaker!

makeObject

open fun <T : Any!> makeObject(dependencyProvider: DependencyProvider, key: DependencyKey<T>): T?