@Test void skipDecode_whenResponseBodyIsNull() { Object result = this.decoder.decode(this.response, Object.class); assertThat(result).isNull(); }
@SuppressWarnings("unchecked") @Override public <T> T decode(Response response, Class<T> type) { try { if (byte[].class.equals(type)) { return (T) response.toByteArray(); } else if (InputStream.class.isAssignableFrom(type)) { return (T) response.body(); } if (response == null || response.body() == null) { return null; } return this.decodeInternal(response, type); } catch (Exception ex) { throw new FeignException("Error decoding the Response", ex, this.getClass().getName() + "#decode"); } }
AbstractResponseDecoder implements ResponseDecoder { @SuppressWarnings("unchecked") @Override public <T> T decode(Response response, Class<T> type) { try { if (byte[].class.equals(type)) { return (T) response.toByteArray(); } else if (InputStream.class.isAssignableFrom(type)) { return (T) response.body(); } if (response == null || response.body() == null) { return null; } return this.decodeInternal(response, type); } catch (Exception ex) { throw new FeignException("Error decoding the Response", ex, this.getClass().getName() + "#decode"); } } }
AbstractResponseDecoder implements ResponseDecoder { @SuppressWarnings("unchecked") @Override public <T> T decode(Response response, Class<T> type) { try { if (byte[].class.equals(type)) { return (T) response.toByteArray(); } else if (InputStream.class.isAssignableFrom(type)) { return (T) response.body(); } if (response == null || response.body() == null) { return null; } return this.decodeInternal(response, type); } catch (Exception ex) { throw new FeignException("Error decoding the Response", ex, this.getClass().getName() + "#decode"); } }  }
AbstractResponseDecoder implements ResponseDecoder { @SuppressWarnings("unchecked") @Override public <T> T decode(Response response, Class<T> type) { try { if (byte[].class.equals(type)) { return (T) response.toByteArray(); } else if (InputStream.class.isAssignableFrom(type)) { return (T) response.body(); } if (response == null || response.body() == null) { return null; } return this.decodeInternal(response, type); } catch (Exception ex) { throw new FeignException("Error decoding the Response", ex, this.getClass().getName() + "#decode"); } }  @SuppressWarnings("unchecked") @Override T decode(Response response, Class<T> type); }
AbstractResponseDecoder implements ResponseDecoder { @SuppressWarnings("unchecked") @Override public <T> T decode(Response response, Class<T> type) { try { if (byte[].class.equals(type)) { return (T) response.toByteArray(); } else if (InputStream.class.isAssignableFrom(type)) { return (T) response.body(); } if (response == null || response.body() == null) { return null; } return this.decodeInternal(response, type); } catch (Exception ex) { throw new FeignException("Error decoding the Response", ex, this.getClass().getName() + "#decode"); } }  @SuppressWarnings("unchecked") @Override T decode(Response response, Class<T> type);  }