Hey,
Just ran into the problem of testing endpoint when the endpoint method
should throw business exception. In the Integration Test I have to catch &
verify this exception. To my frustration, the call on the endpoint does not
throw desired exception, but rather
java.lang.ClassCastException: java.lang.Class cannot be cast to
javax.ws.rs.core.Response
The endpoint configuration (client test side) is done via Spring, as
follows:
<jaxrs:client id="helloWorldEndpoint"
address="${jetty.url}"
serviceClass="endpoint.HelloWorldEndpointImpl">
</jaxrs:client>
In the business scenario when endpoint finishes normally, the test works
fine, endpoint returns Response object.
Tried to register ResponseExceptionMapper, but no avail, ClassCastException
issue persists.
Any suggestions on what could be the matter and how to make IT tests handle
exceptions in endpoints are very welcome :thinking:
-Ivan
--
View this message in context:
http://old.nabble.com/ClassCastException-prevents-thorough-endpoint-testing-tp28719118p28719118.html
Sent from the cxf-user mailing list archive at Nabble.com.