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.
Asked
Active
Viewed 2,921 times
11

Marek
- 7,337
- 1
- 22
- 33
1 Answers
3
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?

Community
- 1
- 1

Oscar Scholten
- 570
- 5
- 13