users@jersey.java.net

[Jersey] Unit Test Resources individually?

From: Mark Engel <mark.c.engel_at_gmail.com>
Date: Thu, 7 Apr 2011 16:29:06 +0200

How is it possible to unit test just one resource at a time?

For example I have this resource

class Res {
  private final String injected;
  public Res(String injected) { this.injected = injected; }
  @GET public String get() { return injected; }
}

and want to unit test this resource with a custom stub (configured via
setUp()) against real http calls from Client.
I would expect that if I only test one resource it would be in the
root of the server.

Is this possible with Jersey? I only found options to configure a
whole package of resource.