Test: Allow merging mock secure settings#25387
Merged
rjernst merged 3 commits intoelastic:masterfrom Jun 25, 2017
Merged
Conversation
While real secure settings (ie an ES keystore) cannot be merged together, mocked secure settings can and need to be sometimes merged. This commit adds a merge method to allow tests to merge together multiple instances of secure settings.
s1monw
approved these changes
Jun 24, 2017
Contributor
s1monw
left a comment
There was a problem hiding this comment.
LGTM but I left a question
| throw new IllegalStateException("Secure settings must already be loaded"); | ||
| } | ||
| if (secureSettings.getSettingNames().isEmpty()) { | ||
| // TODO: fix this leniency!!! |
Contributor
There was a problem hiding this comment.
I ran into this a couple of times working on the branch. Can we throw an exception instead?
Member
Author
|
@s1monw I removed the leniency, and instead changed the offending code to only merge non secure settings. Can you take another look? |
rjernst
added a commit
that referenced
this pull request
Jun 25, 2017
While real secure settings (ie an ES keystore) cannot be merged together, mocked secure settings can and need to be sometimes merged. This commit adds a merge method to allow tests to merge together multiple instances of secure settings.
jasontedor
added a commit
to jasontedor/elasticsearch
that referenced
this pull request
Jun 26, 2017
* master: Move more token filters to analysis-common module Test: Allow merging mock secure settings (elastic#25387) Remove remaining `index.mapper.single_type` setting usage from tests (elastic#25388) Remove dead logger prefix code Tests: Improve stability and logging of TemplateUpgradeServiceIT tests (elastic#25386) Remove `index.mapping.single_type=false` from reindex tests (elastic#25365) Adapt `SearchIT#testSearchWithParentJoin` to new join field (elastic#25379) Added unit test coverage for SignificantTerms (elastic#24904)
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.
While real secure settings (ie an ES keystore) cannot be merged
together, mocked secure settings can and need to be sometimes merged.
This commit adds a merge method to allow tests to merge together
multiple instances of secure settings. Also, a bit of unfortunate leniency is added, which makes passing an empty secure settings a no-op (eg when a test has an empty MockSecureSettings). Finally it adds an explicit error message when secure settings are already set on the settings builder.