Package dagger.hilt.testing
Annotation Type TestInstallIn
-
@Retention(CLASS) @Target(TYPE) public @interface TestInstallInAn annotation that replaces one or moreInstallInmodules with the annotated module in tests.The annotated class must also be annotated with
Module.Example:
// Replaces FooModule with FakeFooModule, and installs it into the same component as FooModule. @Module @TestInstallIn(components = SingletonComponent.class, replaces = FooModule.class) public final class FakeFooModule { @Provides static Foo provideFoo() { return new FakeFoo(); } }- See Also:
- Hilt Modules
-
-
Required Element Summary
Required Elements Modifier and Type Required Element Description java.lang.Class<?>[]componentsReturns the component(s) into which the annotated module will be installed.java.lang.Class<?>[]replacesReturns theInstallInmodule(s) that the annotated class will replace in tests.
-