users@jersey.java.net

[Jersey] Unit Testing code that uses the Jersey Client API

From: Ronak Patel <ronak2121_at_yahoo.com>
Date: Wed, 7 Dec 2011 10:15:55 -0800 (PST)

Hello,

I'm trying to write unit tests for code that uses the Jersey Client API. Granted that the main Client class is a class and not an interface (and the fact that it is created via a static method) does not really aid in mocking it out.

What have people generally done when trying to mock this out?

Do you resort to using cglib to mock the class (instead of asm) and then go from there? or is there some sort of framework/API in Jersey that aids in this?

Thanks,

Ronak Patel