Mock KExtension
class MockKExtension : TestInstancePostProcessor, ParameterResolver, AfterAllCallback
Content copied to clipboard
JUnit5 extension.
Parameters can use MockK and RelaxedMockK. Class properties can use MockK, RelaxedMockK and SpyK will be called after test class execution (*)
Usage: declare @ExtendWith(MockKExtension.class) on a test class
Alternatively –Djunit.extensions.autodetection.enabled=true
may be placed on a command line.
(*) unmockkAll default behavior can be disabled by adding KeepMocks to your test class or method or –Dmockk.junit.extension.keepmocks=true
on a command line
Constructors
Types
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Prevent calling unmockkAll after each test execution
Functions
Link copied to clipboard
open override fun postProcessTestInstance(testInstance: Any, context: ExtensionContext)
Content copied to clipboard
Link copied to clipboard
open override fun resolveParameter(parameterContext: ParameterContext, extensionContext: ExtensionContext): Any?
Content copied to clipboard
Link copied to clipboard
open override fun supportsParameter(parameterContext: ParameterContext, extensionContext: ExtensionContext): Boolean
Content copied to clipboard