Package dagger.hilt.testing
Annotation Interface TestInstallIn
An annotation that replaces one or more
InstallIn
modules 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: