Q:

Mock up InboundJaxrsResponse

For testing I want to create a mockup of InboundJaxrsResponse, or any class extending javax.ws.rs.core.Response and implementing readEntity() methods. This proves rather difficult. Is there a library ready to do it, or is there a way I don't see? My searches don't turn out anything.

A:

In this thread you see an example of using Mockito to mock the readEntity() call:
Response response = mock(Response.class);
when(response.readEntity(InputStream.class)).thenReturn(ClassLoader.getSystemResourceAsStream("example_response.xml");

Hope this helps, and if not, can you explain what problems you run into?

