Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

InstantTaskExecutorRule

open class InstantTaskExecutorRule : TestWatcher
androidx.arch.core.executor.testing.InstantTaskExecutorRule

A JUnit Test Rule that swaps the background executor used by the Architecture Components with a different one which executes each task synchronously.

You can use this rule for your host side tests that use Architecture Components.

Summary

Public constructors

A JUnit Test Rule that swaps the background executor used by the Architecture Components with a different one which executes each task synchronously.

Protected methods

open Unit
finished(description: Description!)

open Unit
starting(description: Description!)

Public constructors

<init>

InstantTaskExecutorRule()

A JUnit Test Rule that swaps the background executor used by the Architecture Components with a different one which executes each task synchronously.

You can use this rule for your host side tests that use Architecture Components.

Protected methods

finished

protected open fun finished(description: Description!): Unit

starting

protected open fun starting(description: Description!): Unit