This library is no longer being actively maintained. Development has moved to mockspresso2
Included Plugins
Mockspresso maintains and ships the following plugins.
Injectors
Mockspresso offers two injectors built in to the core module
injectBySimpleConfig()
[JavaSupport]- Choose shortest constructor.
injectByJavaxConfig()
[JavaSupport]- Prefer constructor annotated with
@Inject
, fallback to shortest. - Perform field and method injection
- Automatically maps
Provider<T>
toT
- Prefer constructor annotated with
We also offer a dagger-specific injector in the mockspresso-dagger
library.
injectByDaggerConfig()
- [JavaSupport]- Does everything that
injectByJavaxConfig()
does annotated - Automatically maps
dagger.Lazy<T>
toT
- Does everything that
Mockers
Mockspresso does not offer any mocker plugins in the core module as it attempts to remain agnostic to the chose mocking framework. Instead we provide support modules for Mockito, EasyMock and PowerMock.
mockspresso-mockito
mockspresso-mockito-powermock
mockspresso-easymock
mockspresso-easymock-powermock
Other Plugins
mockspresso-basic-plugins
automaticProviders()
[JavaSupport]: Automatically maps dependencies of typejavax.inject.Provider<T>
to mocks/dependencies of typeT
mockspresso-dagger
automaticLazies()
[JavaSupport]: Automatically maps dependencies of typedagger.Lazy<T>
to mocks/dependencies of typeT
mockspresso-guava
automaticListenableFutures()
[JavaSupport]: Automatically maps dependencies of typeListenableFuture<T>
to mocks/dependencies of typeT
automaticSuppliers()
[JavaSupport]: Automatically maps dependencies of typeSupplier<T>
to mocks/dependencies of typeT
mockspresso-mockito
automaticFactories(KClass)
[JavaSupport]: Mocks any dependencies of the provided Class types as factories, where every method with a return value will be mapped to a mockspresso dependency.