Search in sources :

Example 1 with JAXBDecoder

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();
}
Also used : Response(feign.Response) JAXBDecoder(feign.jaxb.JAXBDecoder) Test(org.junit.Test)

Aggregations

Response (feign.Response)1 JAXBDecoder (feign.jaxb.JAXBDecoder)1 Test (org.junit.Test)1