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