Hi!
I'm trying to setup HTTP JUnit test of the Jersey resources, and after long struggles
I managed to get Grizzly setup in my @Before function:
@Before
public void setup() throws IllegalArgumentException, IOException {
final Map<String, String> initParams = new HashMap<String, String>();
initParams.put("com.sun.jersey.config.property.packages", packageName);
initParams.put("com.sun.jersey.config.property.resourceConfigClass", MyApplication.class.getName());
threadSelector = GrizzlyWebContainerFactory.create(baseUri, initParams);
}
Then I create a java.net.URL object, open a stream and read. This works fine,
except I can't get the config to understand my ExceptionMapper classes, so all
sunshine tests works fine, and all failure tests fail with exceptions, instead of
being mapped to proper Response objects by my ExceptionMappers.
So, how would I do that? Is that because my mappers aren't in the same package
as my resources?
Mats