Long Rangeron Stack Overflow • Recommends
On “How to test livedata with coroutine in unit test”
…function for you to use the testCoroutine dispatcher in Java UnitTest . InstantExecutor Rule provide the function for you to monitor the livedata emit value in Java UnitTest . And be careful coroutine.dispatcher is the most important part for testing coroutine in Java UnitTest . It is suggested to watch the video about Coroutine testing in Kotlin link to this video
Need to set the CoroutineDispatcher to be injected i……