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

Package com.episode6.hackit.mockspresso.mockito.powermock

Types

MockspressoPowerMockitoPluginsJavaSupport
(Kotlin 9999.0)

object MockspressoPowerMockitoPluginsJavaSupport

Expose the extension methods defined here as MockspressoPlugins for consumption by java tests

PowerMockitoConfig

open class PowerMockitoConfig : MockerConfig

A MockerConfig for Powermock + Mockito

PowerMockitoFieldPreparer

open class PowerMockitoFieldPreparer : FieldPreparer

A FieldPreparer for Powermock + Mockito. Powermock doesn't seem to offer a nice way to init mocks on an arbitrary object that isn't the testClass (and the runner/rule deals with those). So to handle testResources, we use this custom FieldPreparer that expects some mocks/spies to already be initialized (and doesn't touch those). We use PowerMockito#mock(Class) to create mocks and Mockito#spy(Object)/Mockito#spy(Class) to create spies.

PowerMockitoMockMaker

open class PowerMockitoMockMaker : MockMaker

Creates generic Powermock mocks

PowerMockitoPlugin

open class PowerMockitoPlugin : MockspressoPlugin

Plugin that applies PowerMockitoConfig to enable mockspresso usage with Powermock + Mockito. This plugin does not apply a PowerMockRule, so the implementer is responsible for either running their test with the PowerMockRunner or applying their own PowerMockRule

PowerMockitoRulePlugin

open class PowerMockitoRulePlugin : MockspressoPlugin

Plugin that applies PowerMockitoConfig AND applies a PowerMockRule as an outer rule to Mockspresso. Use this plugin if you want to use PowerMock without applying the PowerMockRunner

Extensions for External Classes

com.episode6.hackit.mockspresso.Mockspresso.Builder