From: Craig.McClanahan_at_Sun.COM [Craig.McClanahan_at_Sun.COM]
>> Why is this so much more complicated with Jersey?
> Because Jersey does not pretend to play in the IoC framework space. It would much rather integrate with IoC
> frameworks, so you don't have to choose one approach for your REST resource classes and some other
> approach for your back end services.
This explanation would make more sense if your example (of how to get a
Database Connection object inserted) was not an example of how Jersey
"integrates with IoC frameworks" but instead an example for how to manually
do the integration.
Which is something completely different, of course.
Me myself is struggling with writing JUnit tests of Jersey components over
HTTP, but I can't find a single example out there. There are lots of examples
for how to autowire Jersey code into execution environments like GlassFish,
but none for JUnit. Am I the only TDD enthusiast using Jersey?
It seems like I have to write my own subclass of PackagesResourceConfig,
since my Resource class needs injection of other objects. Right?
Mats