You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to mock external method or variable causes UnsatisifiedLinkError being thrown.
Failure Information (for bugs)
Trying to provide mocked behaviour for any method or variable marked as external results in UnsatisifiedLinkError being thrown. Although there is issue already reported here this one is connected with mocking simple Class mocking not Object.
Steps to Reproduce
Please provide detailed steps for reproducing the issue.
Create a simple class with external method:
class ClassWithExternalMethod {
external fun someExternalCall()
var listener: Any?
external get
external set
}
Create a test method mocking above
class TestClass {
@Test
fun test(){
val mock: ClassWithExternalMethod = mockk {
every { someExternalCall() } just Runs
}
mock.someExternalCall()
}
}
Run the test above.
Context
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
MockK version: 1.13.4
OS: Mac
Kotlin version: 1.7.20
JDK version: 1.8
JUnit version: JUnit 4
Type of test: Unit
Stack trace
'void com.test.android.common.ClassWithExternalMethod.someExternalCall()'
java.lang.UnsatisfiedLinkError: 'void com.test.android.common.ClassWithExternalMethod.someExternalCall()'
at com.test.android.common.ClassWithExternalMethod.someExternalCall(Native Method)
The text was updated successfully, but these errors were encountered:
Expected Behavior
Mocking
external
methods and variables worksCurrent Behavior
Trying to mock
external
method or variable causesUnsatisifiedLinkError
being thrown.Failure Information (for bugs)
Trying to provide mocked behaviour for any method or variable marked as
external
results inUnsatisifiedLinkError
being thrown. Although there is issue already reported here this one is connected with mocking simpleClass
mocking notObject
.Steps to Reproduce
Please provide detailed steps for reproducing the issue.
Context
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
Stack trace
The text was updated successfully, but these errors were encountered: