Package dagger.hilt.android.testing
Annotation Type BindValueIntoSet
-
@Retention(CLASS) @Target(FIELD) public @interface BindValueIntoSet
An annotation that can be used on a test field to contribute the value into theSingletonComponent
as anIntoSet
for the given type. Example usage:
Here the set that contains all the bound elements (in this case "bar" and "baz") will be accessible to the entire application for your test. Also seepublic class FooTest{ ... @BindValueIntoSet String boundBar = "bar"; @BindValueIntoSet String boundBaz = "baz"; ... }
BindElementsIntoSet
, where you can gather individual elements into one set and bind it to the application.