Guice modules configured twice
aldenquimby opened this issue · comments
When using @UseModules
and @RunWith(JukitoRunner.class)
, the method JukitoRunner#ensureInjector
configures all guice modules twice.
It looks like a second test module is created and configured to "collect bindings," and it appears to be intentional based on this comment.
Is this necessary? Is there any way to reuse the existing test module? It's pretty confusing to have every registered module configured twice.
Closing this. It looks like it's possible to collect the bindings from the injector (instead of using Elements.getElements
, but then there's no way to set up additional bindings without making a child injector, and child injectors have a slew of other possible issues