users@jersey.java.net

[Jersey] InMemoryTestContainer and injecting dependencies

From: Jim Webber <jim_at_jimwebber.org>
Date: Mon, 7 Feb 2011 22:31:57 +0100

Hi folks,

Up until now I've just been bringing up my Jersey app atop Jetty for functional testing, but those tests are taking a while to run now (minutes). I'd like to transition to the InMemoryTestContainer instead, on the assumption that'll be much faster.

I do have some dependencies injected into my resource classes (via @Context), how would I go about setting those up if I use the InMemoryTestContainer?

Thanks for your ideas,

Jim