-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Description
Instead of
public static Module extends TestModule {
protected void configureTest() {
bindMany(SomeInterface.class, Impl1.class, Impl2.class);
}
}
...
@Test
someTest(@All SomeInterface interface) {
...
}
I would like to be able to do:
public static Module extends TestModule {
protected void configureTest() {
install(new SharedModule());
}
@Provides
@Instance
SomeInterface provideImpl1() {
return new Impl1();
}
@Provides
@Instance
SomeInterface provideImpl2(final SomeTypeFromSharedModule info) {
return new Impl2(info.get());
}
}
...
@Test
someTest(@All SomeInterface interface) {
...
}
As you can see, the latter approach allows me to construct test instances using info from other injected types, whereas the current approach doesn't allow me access to other types that may have been installed.
Also, it would be great to specify the test name for the junit runner, perhaps on the @Instance annotation.
Metadata
Metadata
Assignees
Labels
No labels