Hello,
I am using the arquillian rest extension, which provides a very comfortable way for testing.
Now I need to send to REST-API calls to the server with two different headers in one test case.
I now aobut the annotation @Header, but I couldn't find a way of changing the header information in code.
The background is, that I first have to call the login REST endpoint and then the real action to be tested.
Currently I have
@Header(name = "Authorization", value = "Basic a2hfsdfsdfsfsfdsfsfsfsdfsfsfsdfsdfsdfs")
public void when_list_my_tasks_from_client_then_ordered_list(
@ArquillianResteasyResource ResourceInterface resource, @ArquillianResteasyResource WebTarget webTarget) {
//Call login -- works
Response loginResponse = webTarget.path("/private/authc").request().post(null);
//Call action with Header 'Authorization'] = 'Token ' -- header needs to change
}
Does anybody have an idea how I can change the header for the second call?
Thank you!
J.