Search in sources :

Example 1 with CustomErrorDecode

use of es.home.example.feignexample.customize.CustomErrorDecode in project PostExamples by deesebc.

the class FeignRetryableTest method setup.

@BeforeAll
public static void setup() {
    bookClient = Feign.builder().client(new OkHttpClient()).encoder(new GsonEncoder()).decoder(new GsonDecoder()).logger(new Slf4jLogger(BookClient.class)).logLevel(Logger.Level.FULL).retryer(new feign.Retryer.Default(100, 1000, 3)).errorDecoder(new CustomErrorDecode()).options(new Request.Options(2, TimeUnit.SECONDS, 4, TimeUnit.SECONDS, true)).target(BookClient.class, "http://localhost:57005/api/books");
    wireMockServer = new WireMockServer(WireMockConfiguration.wireMockConfig().withRootDirectory(FOLDER).port(57005).notifier(new ConsoleNotifier(true)));
    wireMockServer.start();
}
Also used : CustomErrorDecode(es.home.example.feignexample.customize.CustomErrorDecode) ConsoleNotifier(com.github.tomakehurst.wiremock.common.ConsoleNotifier) OkHttpClient(feign.okhttp.OkHttpClient) GsonEncoder(feign.gson.GsonEncoder) Slf4jLogger(feign.slf4j.Slf4jLogger) GsonDecoder(feign.gson.GsonDecoder) Request(feign.Request) WireMockServer(com.github.tomakehurst.wiremock.WireMockServer) BeforeAll(org.junit.jupiter.api.BeforeAll)

Aggregations

WireMockServer (com.github.tomakehurst.wiremock.WireMockServer)1 ConsoleNotifier (com.github.tomakehurst.wiremock.common.ConsoleNotifier)1 CustomErrorDecode (es.home.example.feignexample.customize.CustomErrorDecode)1 Request (feign.Request)1 GsonDecoder (feign.gson.GsonDecoder)1 GsonEncoder (feign.gson.GsonEncoder)1 OkHttpClient (feign.okhttp.OkHttpClient)1 Slf4jLogger (feign.slf4j.Slf4jLogger)1 BeforeAll (org.junit.jupiter.api.BeforeAll)1