mockspresso-easymock-powermock / com.episode6.hackit.mockspresso.easymock.powermock / EasyPowerMockFieldPreparer

EasyPowerMockFieldPreparer

open class EasyPowerMockFieldPreparer : FieldPreparer

A FieldPreparer for Powermock + EasyMock. 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 PowerMock#createMock(Class) to create mocks.

Constructors

<init>

EasyPowerMockFieldPreparer()

A FieldPreparer for Powermock + EasyMock. 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 PowerMock#createMock(Class) to create mocks.

Functions

prepareFields

open fun prepareFields(objectWithMockFields: Any): Unit