@Test public void works_fine_when_body_is_not_null() throws Exception { Response response = Response.create(200, "OK", headers, "[1, 2, 3]", StandardCharsets.UTF_8); Object decodedObject = textDelegateDecoder.decode(response, List.class); assertThat(decodedObject).isEqualTo(ImmutableList.of(1, 2, 3)); }
@Override public Object decode(Response response, Type type) throws FeignException, IOException { Object object = delegate.decode(response, type); Preconditions.checkNotNull(object, "Unexpected null body", SafeArg.of("status", response.status())); return object; }
NeverReturnNullDecoder implements Decoder { @Override public Object decode(Response response, Type type) throws FeignException, IOException { Object object = delegate.decode(response, type); Preconditions.checkNotNull(object, "Unexpected null body", SafeArg.of("status", response.status())); return object; } }
NeverReturnNullDecoder implements Decoder { @Override public Object decode(Response response, Type type) throws FeignException, IOException { Object object = delegate.decode(response, type); Preconditions.checkNotNull(object, "Unexpected null body", SafeArg.of("status", response.status())); return object; } NeverReturnNullDecoder(Decoder delegate); }
NeverReturnNullDecoder implements Decoder { @Override public Object decode(Response response, Type type) throws FeignException, IOException { Object object = delegate.decode(response, type); Preconditions.checkNotNull(object, "Unexpected null body", SafeArg.of("status", response.status())); return object; } NeverReturnNullDecoder(Decoder delegate); @Override Object decode(Response response, Type type); }
NeverReturnNullDecoder implements Decoder { @Override public Object decode(Response response, Type type) throws FeignException, IOException { Object object = delegate.decode(response, type); Preconditions.checkNotNull(object, "Unexpected null body", SafeArg.of("status", response.status())); return object; } NeverReturnNullDecoder(Decoder delegate); @Override Object decode(Response response, Type type);  }