@Test public void throws_nullpointerexception_when_body_is_string_null() { Response response = Response.create(200, "OK", headers, "null", StandardCharsets.UTF_8); Assertions.assertThatLoggableExceptionThrownBy(() -> textDelegateDecoder.decode(response, List.class)) .isInstanceOf(NullPointerException.class) .hasLogMessage("Unexpected null body") .containsArgs(SafeArg.of("status", 200)); }
@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);  }