I'm adding the following classes to the juneau-rest-server module to allow you to unit test your REST resources without the need of running them in a servlet container:
Here's an example of it in use...
Instead of routing requests through a servlet container, it simply creates the RestContext object for the resource and calls the RestContext.getCallHandler().service(request, response); method with mocked-up ServletRequest and ServletResponse objects.
Here's what it looks like in expanded form:
In theory, everything should work identically to how it would behave in a servlet container, only faster and more efficient.
I'd like to also get something working for RestClient as well so that you can test out remoteable proxy interfaces without a servlet container.