When I use io.mock.every like this:
every { mockObj.methodXYZ() } returns "..."
IntelliJ IDEA occasionally puts red lines underneath
every
and on hovering it says "Cannot access class 'io.mockk.MockKStubScope'. Check your module classpath for missing or conflicting dependencies". And it shows "unresolved reference: returns" obviously because that's a method of MockKStubScope which it isn't accessing.
This is only a problem in the editor. If I do a "Build" or "Rebuild", it builds successfully (but the red line under
every
still remains). Sometimes, when I invalidate caches and restart, the problem goes away, but not always.
My dependency is:
<dependency>
<groupId>io.mockk</groupId>
<artifactId>mockk</artifactId>
<version>1.12.0</version>
<scope>test</scope>
</dependency>
The class MockKStubScope is defined in mockk-dsl-jvm-1.12.0.jar, which is a transitive dependency. Is this a known issue, or am I using mockk incorrectly?