Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

javanna
Copy link
Member

@javanna javanna commented Sep 12, 2014

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.

…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.
@javanna javanna added >test Issues or PRs that are addressing/adding tests v2.0.0-beta1 v1.4.0.Beta1 review labels Sep 12, 2014

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 {
Copy link
Member

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.

Copy link
Member Author

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...

@rjernst
Copy link
Member

rjernst commented Sep 13, 2014

Looks fine. Left one minor comment.

@javanna javanna closed this in ec5ceec Sep 15, 2014
javanna added a commit that referenced this pull request Sep 15, 2014
…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
@javanna javanna added the v1.5.0 label Sep 15, 2014
javanna added a commit that referenced this pull request Sep 15, 2014
…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
@javanna javanna removed the review label Sep 15, 2014
mute pushed a commit to mute/elasticsearch that referenced this pull request Jul 29, 2015
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>test Issues or PRs that are addressing/adding tests v1.4.0.Beta1 v1.5.0 v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants