Mock KExtension
MockK JUnit5 extension.
Parameters can use MockK and RelaxedMockK. Class properties can use MockK, RelaxedMockK and SpyK.
unmockkAll will be called after each test function execution if the test lifecycle is set to TestInstance.Lifecycle.PER_METHOD (JUnit 5 default), or after all test functions in the test class have been executed if the test lifecycle is set to TestInstance.Lifecycle.PER_CLASS. unmockkAll will not be called if the KeepMocks annotation is present or if the mockk.junit.extension.keepmocks Gradle property is set to true.
Usage: declare @ExtendWith(MockKExtension::class) on a test class.
Alternatively –Djunit.extensions.autodetection.enabled=true may be placed on a command line.
Types
Prevent calling unmockkAll after each test execution
Require parallel testing by disabling the clearAllMocks call after each test execution; it is not thread-safe.