@Retention(value=CLASS)
@Target(value=TYPE)
public @interface TestInstallIn
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();
}
}
Modifier and Type | Required Element and Description |
---|---|
java.lang.Class<?>[] |
components
Returns the component(s) into which the annotated module will be installed.
|
java.lang.Class<?>[] |
replaces
Returns the
InstallIn module(s) that the annotated class will replace in tests. |