0

I am trying to implement OpenFeign client. In my api interface, I have:

@RequestLine("GET /testUser/{uuid}") TestUser get(@Param("uuid") UUID uuid);

And in my test case, I test it like this:

TestUser testUser = TestUserApi.get(uuid);

I do not want to pass authorization as a header in api definition, but I want to set it in my test case. So, do we have any thing like TestUserApi.setHeader("something", "something")?

DevToCode
  • 11
  • 5

1 Answers1

0

You will want to use a RequestInterceptor to modify the headers before the requests are sent. You can find more information on how to create and register a RequestInterceptor in the Feign Documentation

Kevin Davis
  • 1,193
  • 8
  • 14