New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TEST] Expose ability to provide http headers when sending requests in our REST tests #7710
Conversation
…n our REST tests ElasticsearchRestTests has now a `restClientSettings` method that can be overriden to provide headers as settings (similarly to what we do with transport client). Those headers will be sent together with every REST requests within the tests.
|
||
private InetSocketAddress[] addresses; | ||
|
||
private final String esVersion; | ||
|
||
public RestClient(InetSocketAddress[] addresses, RestSpec restSpec) throws IOException, RestException { | ||
public RestClient(RestSpec restSpec, InetSocketAddress[] addresses, Settings settings) throws IOException, RestException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a specific reason the first two args need to be reversed? I would tend to keep them the same, but I'm not against it changing if there is some kind of justification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, I'll change the order to this: RestSpec restSpec, Settings settings, InetSocketAddress[] addresses
. I think it's more intuitive since the first two args are final while addresses
isn't.
I'll also try to come up with another PR to fix these mutability issues in RestClient...
Looks fine. Left one minor comment. |
…n our REST tests ElasticsearchRestTests has now a `restClientSettings` method that can be overriden to provide headers as settings (similarly to what we do with transport client). Those headers will be sent together with every REST requests within the tests. Closes #7710
…n our REST tests ElasticsearchRestTests has now a `restClientSettings` method that can be overriden to provide headers as settings (similarly to what we do with transport client). Those headers will be sent together with every REST requests within the tests. Closes #7710
…n our REST tests ElasticsearchRestTests has now a `restClientSettings` method that can be overriden to provide headers as settings (similarly to what we do with transport client). Those headers will be sent together with every REST requests within the tests. Closes elastic#7710
ElasticsearchRestTests
has now arestClientSettings
method that can be overriden to provide headers as settings (similarly to what we do with transport client). Those headers will be sent together with every REST requests within the tests.