lightbulb_outline Help shape the future of the Google Play Console, Android Studio, and Firebase. Start survey

WorkManagerTestInitHelper

public final class WorkManagerTestInitHelper
extends Object

java.lang.Object
   ↳ androidx.work.test.WorkManagerTestInitHelper


Helps initialize WorkManager for testing.

Summary

Public methods

static TestDriver getTestDriver()
static void initializeTestWorkManager(Context context)

Initializes WorkManager with a SynchronousExecutor.

Inherited methods

Public methods

getTestDriver

public static TestDriver getTestDriver ()

Returns
TestDriver An instance of TestDriver. This exposes additional functionality that are useful in the context of testing when using WorkManager.

initializeTestWorkManager

public static void initializeTestWorkManager (Context context)

Initializes WorkManager with a SynchronousExecutor.

Parameters
context Context: The application Context