Class TestComponentDataGenerator
java.lang.Object
dagger.hilt.processor.internal.root.TestComponentDataGenerator
Generates an implementation of
dagger.hilt.android.internal.TestComponentData.-
Constructor Summary
ConstructorsConstructorDescriptionTestComponentDataGenerator(androidx.room.compiler.processing.XProcessingEnv processingEnv, androidx.room.compiler.processing.XTypeElement originatingElement, RootMetadata rootMetadata, ComponentNames componentNames) -
Method Summary
Modifier and TypeMethodDescriptionvoidgenerate()public final class FooTest_TestComponentDataSupplier extends TestComponentDataSupplier { @Override protected TestComponentData get() { return new TestComponentData( false, // waitForBindValue testInstance -> injectInternal(($1T) testInstance), Arrays.asList(FooTest.TestModule.class, ...), modules -> DaggerFooTest_ApplicationComponent.builder() .applicationContextModule( new ApplicationContextModule( Contexts.getApplication(ApplicationProvider.getApplicationContext()))) .testModule((FooTest.TestModule) modules.get(FooTest.TestModule.class)) .testModule(modules.containsKey(FooTest.TestModule.class) ? (FooTest.TestModule) modules.get(FooTest.TestModule.class) : ((TestInstance) testInstance).new TestModule()) .build()); } }
-
Constructor Details
-
TestComponentDataGenerator
public TestComponentDataGenerator(androidx.room.compiler.processing.XProcessingEnv processingEnv, androidx.room.compiler.processing.XTypeElement originatingElement, RootMetadata rootMetadata, ComponentNames componentNames)
-
-
Method Details
-
generate
public final class FooTest_TestComponentDataSupplier extends TestComponentDataSupplier { @Override protected TestComponentData get() { return new TestComponentData( false, // waitForBindValue testInstance -> injectInternal(($1T) testInstance), Arrays.asList(FooTest.TestModule.class, ...), modules -> DaggerFooTest_ApplicationComponent.builder() .applicationContextModule( new ApplicationContextModule( Contexts.getApplication(ApplicationProvider.getApplicationContext()))) .testModule((FooTest.TestModule) modules.get(FooTest.TestModule.class)) .testModule(modules.containsKey(FooTest.TestModule.class) ? (FooTest.TestModule) modules.get(FooTest.TestModule.class) : ((TestInstance) testInstance).new TestModule()) .build()); } }- Throws:
IOException
-