Mock KExtension
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
Types
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Prevent calling unmockkAll after each test execution
Link copied to clipboard
Require parallel testing by disabling the clearAllMocks call after each test execution; it is not thread-safe.
Functions
Link copied to clipboard
Link copied to clipboard
open override fun resolveParameter(parameterContext: ParameterContext, extensionContext: ExtensionContext): Any?
Link copied to clipboard
open override fun supportsParameter(parameterContext: ParameterContext, extensionContext: ExtensionContext): Boolean