Open ramgom opened 4 months ago
@ramgom try to use dismiss404():
val userClient = Feign.builder()
.dismiss404()
.encoder(JacksonEncoder(objectMapper))
.decoder(OptionalDecoder(JacksonDecoder(objectMapper)))
.target(UserClient::class.java, BASE_URL)
I think it should help you.
Given this feign client:
`interface UserClient {
}`
val userClient = Feign.builder() .encoder(JacksonEncoder(objectMapper)) .decoder(OptionalDecoder(JacksonDecoder(objectMapper))) .target(UserClient::class.java, BASE_URL)
when I unit test this:
` WireMock.stubFor( WireMock.get("/users/test") .willReturn(WireMock.notFound()) )
`
I'm getting this exception: [404 Not Found] during [GET] to [http://localhost:7070/users/test] [UserClient#getUser(String)]: []
And I was expecting to actually get an empty optional.