Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sisu-users] InjectedTest access injector

Hello,

I'm extending Sisu's InjectedTest class and adding bindings into the configure(Binder binder) method so that my tests can just inject and be happy.  One of my components is a web service that uses Guiced servlets as described here, which requires that you expose the injector to the servlet context.  I'd like the injector created in my InjectedTest class to flow into my GuiceServletContextListener so that it can access test-specific config that gets injected.

So, to make this work, I had to override InjectedTest.setup() and copy InjectedTest.SetupModule so that I could expose the injector.

It works but I'm wondering if there's a better way to get my hands on the injector.

Thanks,
Dave

Back to the top