@@ -0,0 +1,2237 @@
+/*%0A * Licensed to Elasticsearch under one or more contributor%0A * license agreements. See the NOTICE file distributed with%0A * this work for additional information regarding copyright%0A * ownership. Elasticsearch licenses this file to you under%0A * the Apache License, Version 2.0 (the %22License%22); you may%0A * not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *    http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing,%0A * software distributed under the License is distributed on an%0A * %22AS IS%22 BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY%0A * KIND, either express or implied.  See the License for the%0A * specific language governing permissions and limitations%0A * under the License.%0A */%0A%0Apackage org.elasticsearch.ingest;%0A%0Aimport java.util.Arrays;%0Aimport java.util.Collections;%0Aimport java.util.Map;%0A%0Aimport org.elasticsearch.common.settings.Settings;%0Aimport org.elasticsearch.env.Environment;%0Aimport org.elasticsearch.plugins.IngestPlugin;%0Aimport org.elasticsearch.script.ScriptService;%0Aimport org.elasticsearch.test.ESTestCase;%0A%0Apublic class IngestServiceTests extends ESTestCase %7B%0A    private final IngestPlugin DUMMY_PLUGIN = new IngestPlugin() %7B%0A        @Override%0A        public Map%3CString, Processor.Factory%3E getProcessors(Environment env, ScriptService scriptService, TemplateService templateService) %7B%0A            return Collections.singletonMap(%22foo%22, (factories, tag, config) -%3E null);%0A        %7D%0A    %7D;%0A%0A    public void testIngestPlugin() %7B%0A        IngestService ingestService = new IngestService(Settings.EMPTY, null, null, null, Collections.singletonList(DUMMY_PLUGIN));%0A        Map%3CString, Processor.Factory%3E factories = ingestService.getPipelineStore().getProcessorFactories();%0A        assertTrue(factories.containsKey(%22foo%22));%0A        assertEquals(1, factories.size());%0A    %7D%0A%0A    public void testIngestPluginDuplicate() %7B%0A        IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -%3E%0A            new IngestService(Settings.EMPTY, null, null, null, Arrays.asList(DUMMY_PLUGIN, DUMMY_PLUGIN))%0A        );%0A        assertTrue(e.getMessage(), e.getMessage().contains(%22already registered%22));%0A    %7D%0A%7D%0A

Add basic tests for ingest plugins setup