这是我的代码片段: @Test
fun `request should return anon id if query param present`(@MockK(relaxed = true) req我得到的例外是: io.mockk.MockKException: no answer found for: ServerRequest(#1).cookies() 这很奇怪,因为如果我正确理解了relaxed
我正在尝试使用Kotlin和MockK框架编写单元测试。如果测试是使用junit 5框架编写的,那么可以使用MockKExtension来运行它们。@ExtendWith(MockKExtension::class) 但是对于junit 4测试,有MockK runner吗?像这样: @RunWith(....)private val a: A = mockK() 是否可以使用junit 4的注解来初始化kotlin mock @MockK
private lateinit var a: A
我不能运行任何使用MockK的测试,因为它们最终会在初始化期间抛出一个StackOverflowError。::class) private lateinit var service: DBSequencesService
Exception in thread "Test worker" java/lang/StackOverflowError
at io/
<List<Character>>> = mockk(relaxed = true)错误信息 at io.mockk.impl.recording.CommonCallRecorder.done(CommonCallRecorder.kt:47)
at io.mockk.impl.eval.RecordedBlockEvaluator.r
我正在尝试使用MockK将Configuration实例的orientation值存根到Resources上,这样我就可以在我的应用程序中测试一些横向和纵向行为。at io.mockk.impl.recording.states.StubbingState.checkMissingCalls(StubbingState.kt:14)
at io.mockk.impl.recording.states.StubbingState.recordingDoneat io.mockk.impl.eval.RecordedB
当我尝试在UI测试中使用MockK时,我遇到了一个错误,这个测试在Unittest中非常有效。MockK could not self-attach a jvmti agent to the current VMCaused by: io.mockk.proxy.MockKAgentException: MockK could not self-attach a jvmti agent to the current VM.val presenter = mockk<LoginPrese
Could not resolve io.mockk:mockk:1.13.2 for :shared:iosArm64Test Could not resolve io.mockk:mockk:1.13.2for :shared:iosSimulatorArm64Test Could not resolve io.mockk:mockk:1.13.2 for :shared:iosX64Test
发现MockK