Unit testing Jersey Resources with Guice injected fields?

One way to do it is to break the tests to few steps. You need to create the injector you're configuring the service with and test that injector (see Testing Guice Servlet bindings and Testing Guice can init servlets ). Using these tests you make sure you have the right bindings in place.

Once you have the injector, get the ApplicationDescriptor object from it with.

One way to do it is to break the tests to few steps. You need to create the injector you're configuring the service with and test that injector (see Testing Guice Servlet bindings and Testing Guice can init servlets). Using these tests you make sure you have the right bindings in place.

Once you have the injector, get the ApplicationDescriptor object from it with ExampleResource exampleResource = injector. GetInstance(ExampleResource. Class); Assert.

AssertEquals(myList, getExampleList()).

The problem with this approach is that none of the magic that Jersey does is available -- such as @DefaultValue() annotated fields. I actually have gotten this working the way that I want it to, just trying to wrap it up into something post-able on SO. – minichate Oct 14 at 23:11.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions