Registry / testing / mockk-jvm

mockk-jvm

JSON →
library1.14.9javamavenunverified

A mocking library for Kotlin, providing DSL for creating mocks and stubs.

<dependency> <groupId>io.mockk</groupId> <artifactId>mockk-jvm</artifactId> <version>1.14.9</version> </dependency>
INSTALL
IMPORT
SIG · MOCKK-JVM
M
mockk-jvm
testingjavav1.14.9
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

mockk
io.mockk.mockk

Create a mock and stub a method.

import io.mockk.mockk import io.mockk.every class Example { fun test() { val mock = mockk<MyClass>() every { mock.doSomething() } returns "mocked" println(mock.doSomething()) } }
Debug
Known issues
breakingMockK 1.14.x requires Kotlin 1.9+.
fix
Update Kotlin version to 1.9 or later.
affects: >=1.14.0
Upgrade
Version history
1.14.9latest on Maven
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
mockk-jvm — mvn dependency:get mockk-jvm · libregistry