users@jersey.java.net

Unit testing resources

From: Martin Probst <mail_at_martin-probst.com>
Date: Mon, 23 Jun 2008 11:20:17 +0200

Hi all,
I have a question about unit testing of resource classes. I have trouble
setting up injection so that I can actually use the classes. E.g.:

@Path("...")
class FooResource {
  @Context UriInfo info;
}

Now I want to unit test this method - but how do I get the fields injected
in my test harness?

Best regards,
Martin