exceptionfactory commented on a change in pull request #5350:
URL: https://github.com/apache/nifi/pull/5350#discussion_r749350885



##########
File path: 
nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-processors/src/test/java/org/apache/nifi/processors/elasticsearch/ITPutElasticsearch.java
##########
@@ -0,0 +1,114 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.nifi.processors.elasticsearch;
+
+import org.apache.nifi.util.TestRunner;
+import org.apache.nifi.util.TestRunners;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import java.io.InputStream;
+import java.util.HashMap;
+
+public class ITPutElasticsearch {
+    private InputStream docExample;
+
+    @BeforeEach
+    public void setUp() {
+        ClassLoader classloader = 
Thread.currentThread().getContextClassLoader();
+        docExample = classloader.getResourceAsStream("DocumentExample.json");
+    }
+
+    /**
+     * Tests basic ES functionality against a local or test ES cluster
+     */
+    @Test
+    public void testPutElasticSearchBasic() {
+        System.out.println("Starting test " + new Object() {
+        }.getClass().getEnclosingMethod().getName());
+        final TestRunner runner = TestRunners.newTestRunner(new 
PutElasticsearch());
+
+        //Local Cluster - Mac pulled from brew
+        
runner.setProperty(AbstractElasticsearchTransportClientProcessor.CLUSTER_NAME, 
"elasticsearch_brew");
+        
runner.setProperty(AbstractElasticsearchTransportClientProcessor.HOSTS, 
"127.0.0.1:9300");
+        
runner.setProperty(AbstractElasticsearchTransportClientProcessor.PING_TIMEOUT, 
"5s");
+        
runner.setProperty(AbstractElasticsearchTransportClientProcessor.SAMPLER_INTERVAL,
 "5s");
+
+        runner.setProperty(PutElasticsearch.INDEX, "doc");
+        runner.setProperty(PutElasticsearch.BATCH_SIZE, "1");
+
+        runner.setProperty(PutElasticsearch.TYPE, "status");
+        runner.setProperty(PutElasticsearch.ID_ATTRIBUTE, "doc_id");
+        runner.assertValid();
+
+        runner.enqueue(docExample, new HashMap<String, String>() {{
+            put("doc_id", "28039652140");
+        }});
+
+
+        runner.enqueue(docExample);
+        runner.run(1, true, true);
+
+        runner.assertAllFlowFilesTransferred(PutElasticsearch.REL_SUCCESS, 1);
+    }
+
+    @Test
+    public void testPutElasticSearchBatch() {
+        System.out.println("Starting test " + new Object() {
+        }.getClass().getEnclosingMethod().getName());

Review comment:
       System.out.println() usage should be removed

##########
File path: 
nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-processors/src/test/java/org/apache/nifi/processors/elasticsearch/ITPutElasticsearchHttp.java
##########
@@ -0,0 +1,136 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.nifi.processors.elasticsearch;
+
+import org.apache.nifi.util.TestRunner;
+import org.apache.nifi.util.TestRunners;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import java.io.InputStream;
+import java.util.HashMap;
+
+public class ITPutElasticsearchHttp {
+    private InputStream docExample;
+
+    @BeforeEach
+    public void setUp() {
+        ClassLoader classloader = 
Thread.currentThread().getContextClassLoader();
+        docExample = classloader.getResourceAsStream("DocumentExample.json");
+    }
+
+    /**
+     * Tests basic ES functionality against a local or test ES cluster
+     */
+    @Test
+    public void testPutElasticSearchBasic() {
+        System.out.println("Starting test " + new Object() {
+        }.getClass().getEnclosingMethod().getName());

Review comment:
       System.out.println() usage should be removed

##########
File path: 
nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-processors/src/test/java/org/apache/nifi/processors/elasticsearch/ITQueryElasticsearchHttp.java
##########
@@ -89,4 +88,53 @@ public void testFetchElasticsearchOnTrigger_IncomingFile() 
throws IOException {
                 QueryElasticsearchHttp.REL_SUCCESS).get(0);
         assertNotNull(out);
     }
+
+    @Test
+    public void testQueryElasticsearchBasicBehindProxy() {
+        System.out.println("Starting test " + new Object() {
+        }.getClass().getEnclosingMethod().getName());

Review comment:
       System.out.println() usage should be removed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to