Adam Hurwitz
1 min readJun 15, 2020

--

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.

--

--

Adam Hurwitz

An account about nothing | Researcher and product consultant