[Jersey] Jersey 2.0 Test Question

From: Jason Lee <>
Date: Thu, 23 Feb 2012 17:16:02 -0600

I'm trying to migrate a very simple test to Jersey 2.0 and having a bit
of a problem, namely, the test container is not seeing my resource.
Here's the resource source, more or less:

    public class MyResource {

         public String argh() {
             return "argh!";
         // ...

And here's my test:

    public class ServiceTest extends JerseyTest {
         protected static final String MIME_TYPE =
         protected Application configure() {
             ResourceConfig resourceConfig =

             return Application.builder(resourceConfig).build();
         public void simpleTest() {
             Response response =
             assertEquals(200, response.getStatus());

The request always returns a 404. I'm looking at
examples/helloworld/.../, and as far as I can tell,
I'm doing exactly what it's doing (that test runs just fine), but my
resource is never found.

Any ideas what I might be doing wrong?

Jason Lee
Senior Member of Technical Staff
GlassFish Team
Oracle Corporation
Phone +1 405-216-3193