@Test @SmallTest public void testFromWorkSpec_hasCorrectTags() { OneTimeWorkRequest work = new OneTimeWorkRequest.Builder(TestWorker.class) .addTag("one") .addTag("two") .addTag("three") .build(); Worker worker = WorkerWrapper.workerFromWorkSpec( mContext, getWorkSpec(work), new Extras(Data.EMPTY, Arrays.asList("one", "two", "three"), null, 1)); assertThat(worker, is(notNullValue())); assertThat(worker.getTags(), containsInAnyOrder("one", "two", "three")); }
static Worker workerFromWorkSpec(@NonNull Context context, @NonNull WorkSpec workSpec, @NonNull Extras extras) { String workerClassName = workSpec.workerClassName; UUID workSpecId = UUID.fromString(workSpec.id); return workerFromClassName( context, workerClassName, workSpecId, extras); }
WorkerWrapper implements Runnable { static Worker workerFromWorkSpec(@NonNull Context context, @NonNull WorkSpec workSpec, @NonNull Extras extras) { String workerClassName = workSpec.workerClassName; UUID workSpecId = UUID.fromString(workSpec.id); return workerFromClassName( context, workerClassName, workSpecId, extras); } }
WorkerWrapper implements Runnable { static Worker workerFromWorkSpec(@NonNull Context context, @NonNull WorkSpec workSpec, @NonNull Extras extras) { String workerClassName = workSpec.workerClassName; UUID workSpecId = UUID.fromString(workSpec.id); return workerFromClassName( context, workerClassName, workSpecId, extras); } private  WorkerWrapper(Builder builder); }
WorkerWrapper implements Runnable { static Worker workerFromWorkSpec(@NonNull Context context, @NonNull WorkSpec workSpec, @NonNull Extras extras) { String workerClassName = workSpec.workerClassName; UUID workSpecId = UUID.fromString(workSpec.id); return workerFromClassName( context, workerClassName, workSpecId, extras); } private  WorkerWrapper(Builder builder); @WorkerThread @Override void run(); @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) void interrupt(boolean cancelled); @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) @SuppressWarnings("ClassNewInstance") static Worker workerFromClassName(
            @NonNull Context context,
            @NonNull String workerClassName,
            @NonNull UUID workSpecId,
            @NonNull Extras extras); }
WorkerWrapper implements Runnable { static Worker workerFromWorkSpec(@NonNull Context context, @NonNull WorkSpec workSpec, @NonNull Extras extras) { String workerClassName = workSpec.workerClassName; UUID workSpecId = UUID.fromString(workSpec.id); return workerFromClassName( context, workerClassName, workSpecId, extras); } private  WorkerWrapper(Builder builder); @WorkerThread @Override void run(); @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) void interrupt(boolean cancelled); @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) @SuppressWarnings("ClassNewInstance") static Worker workerFromClassName(
            @NonNull Context context,
            @NonNull String workerClassName,
            @NonNull UUID workSpecId,
            @NonNull Extras extras);  }