@InjectSpy annotation

This annotation allows you to inject spies in your application.

Spy allows you to mixed real objects and mocks.


For example, @InjectSpy can be used in the following example:

class InjectionMockTest {

    private lateinit var firstService: FirstService

    fun `should respond test`() {

    fun `should respond second`() {
        every { firstService.greet() } returns "mock response"
        assertThat(firstService.greet()).isEqualTo("mock response")
        verify { firstService.greet() }