Merge pull request elastic/elasticsearch#4398 from danielmitterdorfer/xcontent_strict_duplicate_checks
Enable strict duplicate checks for all XContent types Original commit: elastic/x-pack-elasticsearch@ad249c2e65
This commit is contained in:
commit
7a652fa090
|
@ -8,6 +8,7 @@ package org.elasticsearch.xpack.notification.email.attachment;
|
|||
import org.elasticsearch.ElasticsearchParseException;
|
||||
import org.elasticsearch.common.ParseField;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.XContent;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.common.xcontent.json.JsonXContent;
|
||||
|
@ -115,8 +116,8 @@ public class EmailAttachmentParsersTests extends ESTestCase {
|
|||
}
|
||||
|
||||
public void testThatTwoAttachmentsWithTheSameIdThrowError() throws Exception {
|
||||
assumeFalse("Test only makes sense if JSON parser doesn't have strict duplicate checks enabled",
|
||||
JsonXContent.isStrictDuplicateDetectionEnabled());
|
||||
assumeFalse("Test only makes sense if XContent parser doesn't have strict duplicate checks enabled",
|
||||
XContent.isStrictDuplicateDetectionEnabled());
|
||||
Map<String, EmailAttachmentParser> parsers = new HashMap<>();
|
||||
parsers.put("test", new TestEmailAttachmentParser());
|
||||
EmailAttachmentsParser parser = new EmailAttachmentsParser(parsers);
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
package org.elasticsearch.xpack.watcher.condition;
|
||||
|
||||
import org.elasticsearch.ElasticsearchParseException;
|
||||
import org.elasticsearch.common.xcontent.XContent;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.common.xcontent.json.JsonXContent;
|
||||
|
@ -194,8 +195,8 @@ public class ArrayCompareConditionTests extends ESTestCase {
|
|||
}
|
||||
|
||||
public void testParseContainsDuplicateOperator() throws IOException {
|
||||
assumeFalse("Test only makes sense if JSON parser doesn't have strict duplicate checks enabled",
|
||||
JsonXContent.isStrictDuplicateDetectionEnabled());
|
||||
assumeFalse("Test only makes sense if XContent parser doesn't have strict duplicate checks enabled",
|
||||
XContent.isStrictDuplicateDetectionEnabled());
|
||||
ArrayCompareCondition.Op op = randomFrom(ArrayCompareCondition.Op.values());
|
||||
ArrayCompareCondition.Quantifier quantifier = randomFrom(ArrayCompareCondition.Quantifier.values());
|
||||
Object value = randomFrom("value", 1, null);
|
||||
|
@ -247,8 +248,8 @@ public class ArrayCompareConditionTests extends ESTestCase {
|
|||
}
|
||||
|
||||
public void testParseContainsDuplicateValue() throws IOException {
|
||||
assumeFalse("Test only makes sense if JSON parser doesn't have strict duplicate checks enabled",
|
||||
JsonXContent.isStrictDuplicateDetectionEnabled());
|
||||
assumeFalse("Test only makes sense if XContent parser doesn't have strict duplicate checks enabled",
|
||||
XContent.isStrictDuplicateDetectionEnabled());
|
||||
ArrayCompareCondition.Op op = randomFrom(ArrayCompareCondition.Op.values());
|
||||
ArrayCompareCondition.Quantifier quantifier = randomFrom(ArrayCompareCondition.Quantifier.values());
|
||||
Object value = randomFrom("value", 1, null);
|
||||
|
@ -274,8 +275,8 @@ public class ArrayCompareConditionTests extends ESTestCase {
|
|||
}
|
||||
|
||||
public void testParseContainsDuplicateQuantifier() throws IOException {
|
||||
assumeFalse("Test only makes sense if JSON parser doesn't have strict duplicate checks enabled",
|
||||
JsonXContent.isStrictDuplicateDetectionEnabled());
|
||||
assumeFalse("Test only makes sense if XContent parser doesn't have strict duplicate checks enabled",
|
||||
XContent.isStrictDuplicateDetectionEnabled());
|
||||
ArrayCompareCondition.Op op = randomFrom(ArrayCompareCondition.Op.values());
|
||||
ArrayCompareCondition.Quantifier quantifier = randomFrom(ArrayCompareCondition.Quantifier.values());
|
||||
Object value = randomFrom("value", 1, null);
|
||||
|
|
Loading…
Reference in New Issue