Skip to content

Commit bbee160

Browse files
committed
iter testSyntheticSourceKeepArrays() test
1 parent 60f45f2 commit bbee160

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

server/src/test/java/org/elasticsearch/index/mapper/KeywordFieldMapperTests.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -971,4 +971,10 @@ public void testFieldTypeDefault_IndexedFalseDocValuesFalse() throws IOException
971971
assertFalse(mapper.fieldType().isIndexed());
972972
assertFalse(mapper.fieldType().hasDocValuesSkipper());
973973
}
974+
975+
@Override
976+
protected String randomSyntheticSourceKeep() {
977+
// Only option all keeps array source in ignored source.
978+
return randomFrom("all");
979+
}
974980
}

test/framework/src/main/java/org/elasticsearch/index/mapper/MapperTestCase.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1707,7 +1707,7 @@ public void testSyntheticSourceKeepArrays() throws IOException {
17071707
SyntheticSourceExample example = syntheticSourceSupportForKeepTests(shouldUseIgnoreMalformed()).example(1);
17081708
DocumentMapper mapperAll = createSytheticSourceMapperService(mapping(b -> {
17091709
b.startObject("field");
1710-
b.field("synthetic_source_keep", randomFrom("all")); // Only option all keeps array source.
1710+
b.field("synthetic_source_keep", randomSyntheticSourceKeep());
17111711
example.mapping().accept(b);
17121712
b.endObject();
17131713
})).documentMapper();
@@ -1726,6 +1726,10 @@ public void testSyntheticSourceKeepArrays() throws IOException {
17261726
assertThat(actual, equalTo(expected));
17271727
}
17281728

1729+
protected String randomSyntheticSourceKeep() {
1730+
return randomFrom("all", "arrays");
1731+
}
1732+
17291733
@Override
17301734
protected final <T> T compileScript(Script script, ScriptContext<T> context) {
17311735
return ingestScriptSupport().compileScript(script, context);

0 commit comments

Comments
 (0)