title: Set Query Parameters on a Jersey Test Call
body: <p>I have a Jersey based Java servlet:</p>
  
  <pre><code>@Path("foo")
  class Foo {
    @GET
    @Path("bar")
    public Response bar(@QueryParam("key") String value) {
      // ...
    }
  }
  </code></pre>
  
  <p>I can call it in Tomcat just fine as:</p>
  
  <pre><code>http://localhost:8080/container/foo/bar?key=blah
  </code></pre>
  
  <p>However, in my JerseyTest, using Grizzly, it's not handling the parameters properly. This test case returns a 404 error:</p>
  
  <pre><code>@Test
  public void testBar() {
    final Response response = target("foo/bar?key=blah").request().get();
  }
  </code></pre>
  
  <p>I suspect the issue is it's looking for a resource named <code>foo/bar?key=blah</code> rather than trying to pass <code>key=blah</code> to the resource at <code>foo/bar</code>. If I pass just <code>"foo/bar"</code> to <code>target()</code>, I get a 500, as the code throws an exception for a null parameter.</p>
  
  <p>I looked through the Jersey Test documentation, and some examples, and I found some cryptic looking stuff that might have been for passing parameters to a GET, but none of it looked like it was assigning values to parameters, so I wasn't positive how I would use it.</p>
  
  <p>How can I pass my value in for that parameter?</p>