<How do I set a default Answer strategy with Mockk...
# stackoverflow
u
How do I set a default Answer strategy with Mockk In Mockito, I can create a mock of a class, and specify the default answer for any function calls to that mock, like this: whenever(this.strings).thenReturn(mock(StringProvider::class.java, StringProviderAnswer())) Where the answer might be class StringProviderAnswer : Answer { private val delegate = Mockito.RETURNS_DEFAULTS!! override fun answer(invocation: InvocationOnMock?): Any? { val invocationMethodReturn = invocation?.method?.returnType val stringType =...