Search in sources :

Example 1 with StringDecoder

use of feign.codec.StringDecoder in project feign by OpenFeign.

the class FeignUnderAsyncTest method responseMapperIsAppliedBeforeDelegate.

@Test
public void responseMapperIsAppliedBeforeDelegate() throws IOException {
    ResponseMappingDecoder decoder = new ResponseMappingDecoder(upperCaseResponseMapper(), new StringDecoder());
    String output = (String) decoder.decode(responseWithText("response"), String.class);
    assertThat(output).isEqualTo("RESPONSE");
}
Also used : StringDecoder(feign.codec.StringDecoder) ResponseMappingDecoder(feign.Feign.ResponseMappingDecoder) Test(org.junit.Test)

Example 2 with StringDecoder

use of feign.codec.StringDecoder in project feign by OpenFeign.

the class FeignTest method responseMapperIsAppliedBeforeDelegate.

@Test
public void responseMapperIsAppliedBeforeDelegate() throws IOException {
    ResponseMappingDecoder decoder = new ResponseMappingDecoder(upperCaseResponseMapper(), new StringDecoder());
    String output = (String) decoder.decode(responseWithText("response"), String.class);
    assertThat(output).isEqualTo("RESPONSE");
}
Also used : StringDecoder(feign.codec.StringDecoder) ResponseMappingDecoder(feign.Feign.ResponseMappingDecoder) Test(org.junit.Test)

Example 3 with StringDecoder

use of feign.codec.StringDecoder in project feign by OpenFeign.

the class Http2ClientAsyncTest method responseMapperIsAppliedBeforeDelegate.

@Test
public void responseMapperIsAppliedBeforeDelegate() throws IOException {
    final ResponseMappingDecoder decoder = new ResponseMappingDecoder(upperCaseResponseMapper(), new StringDecoder());
    final String output = (String) decoder.decode(responseWithText("response"), String.class);
    Assertions.assertThat(output).isEqualTo("RESPONSE");
}
Also used : StringDecoder(feign.codec.StringDecoder) ResponseMappingDecoder(feign.Feign.ResponseMappingDecoder) Test(org.junit.Test)

Example 4 with StringDecoder

use of feign.codec.StringDecoder in project feign by OpenFeign.

the class AsyncFeignTest method responseMapperIsAppliedBeforeDelegate.

@Test
public void responseMapperIsAppliedBeforeDelegate() throws IOException {
    ResponseMappingDecoder decoder = new ResponseMappingDecoder(upperCaseResponseMapper(), new StringDecoder());
    String output = (String) decoder.decode(responseWithText("response"), String.class);
    assertThat(output).isEqualTo("RESPONSE");
}
Also used : StringDecoder(feign.codec.StringDecoder) ResponseMappingDecoder(feign.Feign.ResponseMappingDecoder) Test(org.junit.Test)

Aggregations

ResponseMappingDecoder (feign.Feign.ResponseMappingDecoder)4 StringDecoder (feign.codec.StringDecoder)4 Test (org.junit.Test)4