We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tested with:
mockmp 1.6.0, 1.8.1 kotlin 1.6.20, 1.7.10
For interfaces, where suspending functions have default implementations, @Mock generates invalid mock implementation.
@Mock
interface Sample { suspend fun sampleSuspending(): String = throw NotImplementedError() }
Generated code (formatted for readability):
import org.kodein.mock.Mocker internal class MockSample( private val mocker: Mocker, ) : Sample { public override suspend fun sampleSuspending(): String { return this.mocker.registerSuspend( receiver = this, method = "sampleSuspending()", default = { super.sampleSuspending() } // <=== Suspension functions can be called only within coroutine body ) } public override fun toString(): String { return this.mocker.register( receiver = this, method = "toString()", default = { super.toString() } ) } }
The text was updated successfully, but these errors were encountered:
9b58673
Version 1.9.0 published with the fix.
1.9.0
Sorry, something went wrong.
No branches or pull requests
Tested with:
mockmp 1.6.0, 1.8.1
kotlin 1.6.20, 1.7.10
For interfaces, where suspending functions have default implementations,
@Mock
generates invalid mock implementation.Generated code (formatted for readability):
The text was updated successfully, but these errors were encountered: