use of feign.jaxb.JAXBDecoder in project feign by OpenFeign.
the class SOAPCodecTest method notFoundDecodesToNull.
/**
* Enabled via {@link feign.Feign.Builder#decode404()}
*/
@Test
public void notFoundDecodesToNull() throws Exception {
Response response = Response.builder().status(404).reason("NOT FOUND").request(Request.create(HttpMethod.GET, "/api", Collections.emptyMap(), null, Util.UTF_8)).headers(Collections.emptyMap()).build();
assertThat((byte[]) new JAXBDecoder(new JAXBContextFactory.Builder().build()).decode(response, byte[].class)).isNull();
}
Aggregations