Package dagger.hilt.android.testing
Class OnComponentReadyRunner
java.lang.Object
dagger.hilt.android.testing.OnComponentReadyRunner
Provides access to the Singleton component in tests, so that Rules can access it after custom
test modules have been added.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Rules should register an implementation of this to get access to the singleton componentstatic interface
Public for use by generated code andinvalid @link
TestApplicationComponentManager
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> void
addListener
(android.content.Context context, 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.
-
Constructor Details
-
OnComponentReadyRunner
public OnComponentReadyRunner()
-
-
Method Details
-
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, Class<T> entryPoint, OnComponentReadyRunner.OnComponentReadyListener<T> listener) Must be called on the test thread, before the Statement is evaluated. -
isEmpty
public boolean isEmpty()
-