Closed rafaelrodriguez342 closed 5 years ago
Moving this issue to the couchbase-lite-android-ce repository. Please follow it there.
The error you are seeing is caused by the Virtual Machine's inability to load a native library appropriate for the machine on which you are doing your testing. This is a fairly typical problem that arises when trying to mock Objects that have native components. You may be able to work around it in one of two ways:
1) Be sure that you can run your tests without mocking the native objects. That is, make sure that, e.g., you can create and use a Database
object on your test platform. If the objects can be created, then their mocks can probably be created, too.
2) Better: Do not use Couchbase objects directly. Hide them behind interfaces and then mock those interfaces. This is the only way to guarantee testability.
Unit tests not working anymore when upgrading to 2.5 couchbase, Document and Database class cannot be mocked see relate
This is an example in which the issue can be reproduced easily using com.couchbase.lite:couchbase-lite-android:2.5.0