users@jersey.java.net

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

From: <reno.rkcrew_at_free.fr>
Date: Tue, 15 Jun 2010 17:44:03 +0200

hello anthony,

the jersey 1.2 version is great for testing
check out this :
http://blogs.sun.com/naresh/entry/jersey_test_framework_re_visited
we're using it everyday and it great (thanks to the jersey team)

Hope this help

S.


> Hello !
> I'm using Jersey to consume a REST service in JSON.
> I've able to successfully consume the service (using only gor now) . but
> now, as I'm starting to unit test this getService(int resourceId) method, I
> realize that I don't know how to write this test !
> What I would like is to check that my request is correct, meaning, conform
> to what the REST service is expecting.
> So , for example, my unit test would :
> *create an instance of my implentation class
> *call the getService(int resourceId)
> *compare the generated request to what I expected to be sent
>
> I've seen that a Test framework exists for Jersey server side (JesrseyTest)
>
> Is there something similar for the client side, so that I can unit test my
> client side API without consuming the real service ?
>
> Thank you for your answers !
> Anthony
>