88
99import com .carrotsearch .randomizedtesting .annotations .Name ;
1010import com .carrotsearch .randomizedtesting .annotations .ParametersFactory ;
11-
1211import org .elasticsearch .common .xcontent .XContentLocation ;
1312import org .elasticsearch .index .mapper .BooleanFieldMapper ;
1413import org .elasticsearch .index .mapper .DateFieldMapper ;
@@ -58,7 +57,7 @@ public static Iterable<Object[]> parameters() throws Exception {
5857 // The setup section contains an unsupported option
5958 continue ;
6059 }
61- if (false == modifySection (candidate .getTestPath (), candidate . getTestSection ().getExecutableSections ())) {
60+ if (false == modifySection (candidate .getTestSection ().getExecutableSections ())) {
6261 // The test section contains an unsupported option
6362 continue ;
6463 }
@@ -80,7 +79,7 @@ public static Iterable<Object[]> parameters() throws Exception {
8079 * with scripts that load from source.
8180 */
8281 private static ClientYamlTestSuite modifiedSuite (ClientYamlTestCandidate candidate ) {
83- if (false == modifySection (candidate .getSuitePath () + "/setup" , candidate . getSetupSection ().getExecutableSections ())) {
82+ if (false == modifySection (candidate .getSetupSection ().getExecutableSections ())) {
8483 return null ;
8584 }
8685 List <ExecutableSection > setup = new ArrayList <>(candidate .getSetupSection ().getExecutableSections ().size () + 1 );
@@ -99,7 +98,7 @@ private static ClientYamlTestSuite modifiedSuite(ClientYamlTestCandidate candida
9998 * Replace field configuration in {@code indices.create} with scripts
10099 * that load from the source.
101100 */
102- private static boolean modifySection (String sectionName , List <ExecutableSection > executables ) {
101+ private static boolean modifySection (List <ExecutableSection > executables ) {
103102 for (ExecutableSection section : executables ) {
104103 if (false == (section instanceof DoSection )) {
105104 continue ;
@@ -232,10 +231,6 @@ public void execute(ClientYamlTestExecutionContext executionContext) throws IOEx
232231 Map .entry ("runtime_type" , type ),
233232 Map .entry ("script" , painlessToLoadFromSource ("{name}" , type ))
234233 );
235- Map <String , Object > body = Map .ofEntries (
236- Map .entry ("match_mapping_type" , type .equals ("keyword" ) ? "string" : type ),
237- Map .entry ("mapping" , mapping )
238- );
239234 if (type .contentEquals ("keyword" )) {
240235 /*
241236 * For "string"-type dynamic mappings emulate our default
@@ -248,7 +243,6 @@ public void execute(ClientYamlTestExecutionContext executionContext) throws IOEx
248243 } else {
249244 dynamicTemplates .add (Map .of (type , Map .of ("match_mapping_type" , type , "mapping" , mapping )));
250245 }
251- dynamicTemplates .add (Map .of (type , body ));
252246 }
253247 List <Map <String , Object >> bodies = List .of (
254248 Map .ofEntries (
0 commit comments