Package dagger.hilt.android.testing
Class OnComponentReadyRunner
- java.lang.Object
-
- dagger.hilt.android.testing.OnComponentReadyRunner
-
public final class OnComponentReadyRunner extends java.lang.Object
Provides access to the Singleton component in tests, so that Rules can access it after custom test modules have been added.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
OnComponentReadyRunner.OnComponentReadyListener<T>
Rules should register an implementation of this to get access to the singleton componentstatic interface
OnComponentReadyRunner.OnComponentReadyRunnerHolder
Public for use by generated code andTestApplicationComponentManager
-
Constructor Summary
Constructors Constructor Description OnComponentReadyRunner()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> void
addListener(android.content.Context context, java.lang.Class<T> entryPoint, OnComponentReadyRunner.OnComponentReadyListener<T> listener)
Must be called on the test thread, before the Statement is evaluated.boolean
isEmpty()
void
setComponentManager(dagger.hilt.internal.GeneratedComponentManager<?> componentManager)
Used by generated code, to notify listeners that the component has been created.
-
-
-
Method Detail
-
setComponentManager
public void setComponentManager(dagger.hilt.internal.GeneratedComponentManager<?> componentManager)
Used by generated code, to notify listeners that the component has been created.
-
addListener
public static <T> void addListener(android.content.Context context, java.lang.Class<T> entryPoint, OnComponentReadyRunner.OnComponentReadyListener<T> listener)
Must be called on the test thread, before the Statement is evaluated.
-
isEmpty
public boolean isEmpty()
-
-