Android 12 Developer Preview is here! Try it out, and give us your feedback!

TestWorkerBuilder

open class TestWorkerBuilder<W : Worker!> : TestListenableWorkerBuilder<W>
kotlin.Any
   ↳ androidx.work.testing.TestListenableWorkerBuilder<W>
   ↳ androidx.work.testing.TestWorkerBuilder

Builds instances of Worker which can be used for testing.

Summary

Public methods
open static TestWorkerBuilder<out Worker!>
from(@NonNull context: Context, @NonNull workRequest: WorkRequest, @NonNull executor: Executor)

Creates a new instance of a TestWorkerBuilder from a WorkRequest that runs on the given Executor.

open static TestWorkerBuilder<W>
from(@NonNull context: Context, @NonNull workerClass: Class<W>, @NonNull executor: Executor)

Creates a new instance of a TestWorkerBuilder with the worker Class that runs on the given Executor.

Inherited functions