This is a good clear sample! Have you worked with tests querying for PagedLists?

There is an edge case for testing queries returning a PagedList. A workaround can be applied to explicitly run this type of query on Dispatchers.IO.

See: Run Room @Insert and @Query on Dispatchers.IO

Also, if looking to run a Room database test locally on the JVM, Context can be built with Robolectric as outlined here, Create Context with Robolectric in a local unit test. Once the Context is built, Room’s database can be created as shown in the sample in this Medium post.

--

--

Open Sourcer

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Adam Hurwitz

Adam Hurwitz

Open Sourcer

More from Medium

Link C/C++ library dependencies to your own C/C++ code in an Android application using CMake

Since November 19, 2019 at 7 pm German local time I was busy with the development for the…

Solve Problem: Duplicate attribute ‘{http://schemas.android.com/apk/res/android}textColor'.

From learning Java to publishing my first app on Play Store (with Resources)