/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.elasticsearch.examples.nativescript.script;

import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.examples.nativescript.plugin.NativeScriptExamplesPlugin;
import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
import org.elasticsearch.test.ESIntegTestCase.Scope;

import static org.elasticsearch.cluster.metadata.IndexMetaData.SETTING_NUMBER_OF_REPLICAS;
import static org.elasticsearch.cluster.metadata.IndexMetaData.SETTING_NUMBER_OF_SHARDS;

/**
 */
@ClusterScope(scope = Scope.SUITE, numDataNodes = 1)
public abstract class AbstractSearchScriptTests extends ESIntegTestCase {

    @Override
    public Settings indexSettings() {
        Settings.Builder builder = Settings.builder();
        builder.put(SETTING_NUMBER_OF_SHARDS, 1);
        builder.put(SETTING_NUMBER_OF_REPLICAS, 0);
        return builder.build();
    }

    @Override
    protected Settings nodeSettings(int nodeOrdinal) {
        return Settings.settingsBuilder()
                .put("gateway.type", "none")
                .put("plugin.types", NativeScriptExamplesPlugin.class)
                .put(super.nodeSettings(nodeOrdinal))
                .build();
    }
    
}

@@ -741,16 +741,57 @@
 Plugin;%0A
+import org.elasticsearch.plugins.Plugin;%0A
 import o
@@ -943,16 +943,46 @@
 Scope;%0A%0A
+import java.util.Collection;%0A%0A
 import s
@@ -1570,284 +1570,118 @@
 ted 
-Settings nodeSettings(int nodeOrdinal) %7B%0A        return Settings.settingsBuilder()%0A                .put(%22gateway.type%22, %22none%22)%0A                .put(%22plugin.types%22, NativeScriptExamplesPlugin.class)%0A                .put(super.nodeSettings(nodeOrdinal))%0A                .build(
+Collection%3CClass%3C? extends Plugin%3E%3E nodePlugins() %7B%0A        return pluginList(NativeScriptExamplesPlugin.class
 );%0A 
@@ -1689,11 +1689,6 @@
   %7D%0A
-    %0A
 %7D%0A

Switch to the direct way of injecting plugins into test nodes