cerner / beadledom

A simple, composable framework for building RESTful services
http://engineering.cerner.com/beadledom
Apache License 2.0
25 stars 30 forks source link

[beadledom-jaxrs-clientproxy] Handle responses that do not contain a body #109

Closed nathanschile closed 6 years ago

nathanschile commented 6 years ago

Describe the problem:

When using GenericResponse with the beandledom-jaxrs-clientproxy project, and the resource interface returns a GenericResponse without a type, the client call fails with an exception because the code expects the response to have a entity.

Steps to reproduce:

  1. Have a interface method that returns a untyped GenericResponse. GenericResponse getGenericWithNoType();
  2. Attempt to call this method using a GenericClientProxy

Observed Results:

java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType java.lang.ClassCastException: java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType at com.cerner.beadledom.client.proxy.GenericClientProxy.buildGenericResponse(GenericClientProxy.java:56) at com.cerner.beadledom.client.proxy.GenericClientProxy.invoke(GenericClientProxy.java:42)



#### Expected Results:

  * A GenericResponse is returned without a `body()`