use of feign.FeignException in project feign by OpenFeign.
the class DefaultErrorDecoderTest method testFeignExceptionIncludesStatus.
@Test
public void testFeignExceptionIncludesStatus() throws Throwable {
Response response = Response.builder().status(400).reason("Bad request").headers(headers).build();
Exception exception = errorDecoder.decode("Service#foo()", response);
assertThat(exception).isInstanceOf(FeignException.class);
assertThat(((FeignException) exception).status()).isEqualTo(400);
}
Aggregations