users@jersey.java.net

Re: [Jersey] How to test a REST client Jersey ?

From: Frédéric Bouquet <bouquet.frederic_at_gmail.com>
Date: Thu, 17 Jun 2010 12:22:23 +0200

Hi Anthony,

I understand your problem and I don't think something is already in
the test framework to automate what you need. I think you may create
some kind of "virtual server" with grizzly for example and check at a
lower level (with JUnit not Jersey test framework) what is sent by
your client.

I think you could create and lauch a grizzly server (or in memory but
I have not used it yet) in your setup methods. Then is your test
cases, you call your client methods to get some informations, but a
maybe best way should be to use "test made" filters to your grizzly
test server to intercept sent and received request from server view.
But, I don't realy know if the jerser-server's packages are "linked"
to the jersey test framework (to use resources) so you may need to
write your test server in your code and call it from the test cases.

Hope my "ramblings" could help :)

-- 
Frédéric Bouquet
http://www.espacedefouille.org/