While running unit test I am getting following error which is using room DB.
@Test
fun validateReceptionRequested_nothingChanged() {
every { receptionRepository.hasConnectivity } returns false
every { userViewModel.currentUser } returns UserModel(
fullName= "Doe John",
userId = "user",
firstName = "John",
lastName = "Doe",
role = Role.OPERATOR
)
// When
vm.validateReceptionRequested(comment)
// Then
vm.sendVehicleStatus(vm.comments, VehicleStatus.RECEPTION_OK)
}
getting following error :
Illegal connection pointer 6342. Current pointers for thread Thread[SDK 28 Main Thread,5,SDK 28] []
java.lang.IllegalStateException: Illegal connection pointer 6342. Current pointers for thread Thread[SDK 28 Main Thread,5,SDK 28] []
at org.robolectric.shadows.ShadowSQLiteConnection$Connections.getConnection(ShadowSQLiteConnection.java:369)