Mockkator is an Intellij plugin you can use to generate Mockk boilerplate code in your unit tests.
Given a sample class
class ComplexService(
val input: String,
val otherObject: TestObject
) {
// Your logic
}
The generated test code will look like this:
class ComplexServiceTest : ShouldSpec ({
// Generated code begins here
val input = "input"
val otherObject = mockk<TestObject>()
val underTest = ComplexService(
input = input,
otherObject = otherObject,
)
})
This example uses Kotest as the testing framework, but this plugin is agnostic of what test framework you use
You can download the plugin from the Plugin Marketplace and follow the instructions detailed in the documentation of the plugin.
You can contribute to this project by forking it and opening your own PR or by creating issues to propose improvements or report bugs.