Remove UpdateSettingsTestHelper class#32557
Merged
dakrone merged 9 commits intoelastic:index-lifecyclefrom Aug 6, 2018
Merged
Conversation
By making the `settings()` method public on `UpdateSettingsRequest` (I think it should have been in the first place) we can get rid of this class entirely. Mock response objects are now constructed by parsing JSON without making the constructor public. Relates to elastic#29823
Collaborator
|
Pinging @elastic/es-core-infra |
talevy
reviewed
Aug 1, 2018
| final UpdateSettingsResponse response; | ||
| try (XContentParser parser = XContentType.JSON.xContent() | ||
| .createParser(NamedXContentRegistry.EMPTY, THROW_UNSUPPORTED_OPERATION, "{\"acknowledged\": true}")) { | ||
| response = UpdateSettingsResponse.fromXContent(parser); |
Contributor
There was a problem hiding this comment.
I ended up using the UpdateSettingsAction.INSTANCE.newResponse() then response.readFrom(StreamInput.wrap(new byte[] { ... })) route for this workaround. But I like this better! more self-describing
Contributor
There was a problem hiding this comment.
Can we not make the Response constructor public here? Having the object parsed from a JSON string seems fragile and ugly to me.
talevy
approved these changes
Aug 1, 2018
…-update-settings-test-helper
colings86
suggested changes
Aug 2, 2018
…-update-settings-test-helper
…-update-settings-test-helper
…-update-settings-test-helper
…-update-settings-test-helper
…-update-settings-test-helper
jasontedor
pushed a commit
that referenced
this pull request
Aug 17, 2018
* Remove UpdateSettingsTestHelper class By making the `settings()` method public on `UpdateSettingsRequest` (I think it should have been in the first place) we can get rid of this class entirely. Mock response objects are now constructed by parsing JSON without making the constructor public. Relates to #29823
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
By making the
settings()method public onUpdateSettingsRequest(I think itshould have been in the first place) we can get rid of this class entirely. Mock
response objects are now constructed by parsing JSON without making the
constructor public.
Relates to #29823