{"action":"created","comment":{"url":"https://api.github.com/repos/apache/nifi/pulls/comments/178330389","pull_request_review_id":108377037,"id":178330389,"diff_hunk":"@@ -0,0 +1,231 @@\n+/*\n+ * Licensed to the Apache Software Foundation (ASF) under one or more\n+ * contributor license agreements.  See the NOTICE file distributed with\n+ * this work for additional information regarding copyright ownership.\n+ * The ASF licenses this file to You under the Apache License, Version 2.0\n+ * (the \"License\"); you may not use this file except in compliance with\n+ * the License.  You may obtain a copy of the License at\n+ *\n+ *     http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package org.apache.nifi.processors.influxdb;\n+import static org.junit.Assert.assertEquals;\n+import org.junit.Assert;\n+import java.util.List;\n+import java.util.concurrent.TimeUnit;\n+\n+import org.apache.nifi.processor.ProcessContext;\n+import org.apache.nifi.util.MockFlowFile;\n+import org.apache.nifi.util.TestRunners;\n+import org.influxdb.InfluxDB;\n+import org.influxdb.dto.QueryResult;\n+import org.junit.Before;\n+import org.junit.Test;\n+\n+/**\n+ * Integration test for executing InfluxDB queries. Please ensure that the InfluxDB is running\n+ * on local host with default port and has database test with table test. Please set user\n+ * and password if applicable before running the integration tests.\n+ */\n+public class ITExecuteInfluxDBQuery extends AbstractITInfluxDB {\n+\n+    @Before\n+    public void setUp() throws Exception {\n+        initInfluxDB();\n+        runner = TestRunners.newTestRunner(ExecuteInfluxDBQuery.class);\n+        initializeRunner();\n+    }\n+\n+    @Test\n+    public void testValidScheduleQueryWithNoIncoming() {\n+        String message = \"water,country=US,city=newark rain=1,humidity=0.6 1501002274856668652\";\n+        influxDB.write(dbName, DEFAULT_RETENTION_POLICY, InfluxDB.ConsistencyLevel.ONE, message);\n+\n+        String query = \"select * from water\";\n+        runner.setProperty(ExecuteInfluxDBQuery.INFLUX_DB_QUERY, query);\n+\n+        runner.setIncomingConnection(false);\n+        runner.run(1,true,true);\n+        runner.assertAllFlowFilesTransferred(ExecuteInfluxDBQuery.REL_SUCCESS, 1);\n+        List<MockFlowFile> flowFiles = runner.getFlowFilesForRelationship(ExecuteInfluxDBQuery.REL_SUCCESS);\n+        assertEquals(\"Value should be equal\", 1, flowFiles.size());\n+        assertEquals(\"Value should be equal\",null, flowFiles.get(0).getAttribute(ExecuteInfluxDBQuery.INFLUX_DB_ERROR_MESSAGE));\n+        assertEquals(\"Value should be equal\",query, flowFiles.get(0).getAttribute(ExecuteInfluxDBQuery.INFLUX_DB_EXECUTED_QUERY));\n+        flowFiles.get(0).assertContentEquals(","path":"nifi-nar-bundles/nifi-influxdb-bundle/nifi-influxdb-processors/src/test/java/org/apache/nifi/processors/influxdb/ITExecuteInfluxDBQuery.java","position":60,"original_position":60,"commit_id":"ec88582be6f751abc4a4a9a0cf3b827f6d72bf2b","original_commit_id":"ec88582be6f751abc4a4a9a0cf3b827f6d72bf2b","user":{"login":"MikeThomsen","id":108184,"avatar_url":"https://avatars1.githubusercontent.com/u/108184?v=4","gravatar_id":"","url":"https://api.github.com/users/MikeThomsen","html_url":"https://github.com/MikeThomsen","followers_url":"https://api.github.com/users/MikeThomsen/followers","following_url":"https://api.github.com/users/MikeThomsen/following{/other_user}","gists_url":"https://api.github.com/users/MikeThomsen/gists{/gist_id}","starred_url":"https://api.github.com/users/MikeThomsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MikeThomsen/subscriptions","organizations_url":"https://api.github.com/users/MikeThomsen/orgs","repos_url":"https://api.github.com/users/MikeThomsen/repos","events_url":"https://api.github.com/users/MikeThomsen/events{/privacy}","received_events_url":"https://api.github.com/users/MikeThomsen/received_events","type":"User","site_admin":false},"body":"If you can parse this with Gson and evaluate it that way, the test will be less likely to be brittle as InfluxDB evolves.","created_at":"2018-03-30T17:13:20Z","updated_at":"2018-03-30T17:17:13Z","html_url":"https://github.com/apache/nifi/pull/2562#discussion_r178330389","pull_request_url":"https://api.github.com/repos/apache/nifi/pulls/2562","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/apache/nifi/pulls/comments/178330389"},"html":{"href":"https://github.com/apache/nifi/pull/2562#discussion_r178330389"},"pull_request":{"href":"https://api.github.com/repos/apache/nifi/pulls/2562"}}},"pull_request":{"url":"https://api.github.com/repos/apache/nifi/pulls/2562","id":175730897,"html_url":"https://github.com/apache/nifi/pull/2562","diff_url":"https://github.com/apache/nifi/pull/2562.diff","patch_url":"https://github.com/apache/nifi/pull/2562.patch","issue_url":"https://api.github.com/repos/apache/nifi/issues/2562","number":2562,"state":"open","locked":false,"title":"NIFI-4927 - InfluxDB Query Processor","user":{"login":"mans2singh","id":8467404,"avatar_url":"https://avatars0.githubusercontent.com/u/8467404?v=4","gravatar_id":"","url":"https://api.github.com/users/mans2singh","html_url":"https://github.com/mans2singh","followers_url":"https://api.github.com/users/mans2singh/followers","following_url":"https://api.github.com/users/mans2singh/following{/other_user}","gists_url":"https://api.github.com/users/mans2singh/gists{/gist_id}","starred_url":"https://api.github.com/users/mans2singh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mans2singh/subscriptions","organizations_url":"https://api.github.com/users/mans2singh/orgs","repos_url":"https://api.github.com/users/mans2singh/repos","events_url":"https://api.github.com/users/mans2singh/events{/privacy}","received_events_url":"https://api.github.com/users/mans2singh/received_events","type":"User","site_admin":false},"body":"Thank you for submitting a contribution to Apache NiFi.\r\n\r\nIn order to streamline the review of the contribution we ask you\r\nto ensure the following steps have been taken:\r\n\r\n### For all changes:\r\n- [x] Is there a JIRA ticket associated with this PR? Is it referenced \r\n     in the commit message?\r\n\r\n- [x] Does your PR title start with NIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen \"-\" character.\r\n\r\n- [x] Has your PR been rebased against the latest commit within the target branch (typically master)?\r\n\r\n- [x] Is your initial contribution a single, squashed commit?\r\n\r\n### For code changes:\r\n- [x] Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder?\r\n- [x] Have you written or updated unit tests to verify your changes?\r\n- [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? \r\n- [ ] If applicable, have you updated the LICENSE file, including the main LICENSE file under nifi-assembly?\r\n- [ ] If applicable, have you updated the NOTICE file, including the main NOTICE file found under nifi-assembly?\r\n- [x] If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties?\r\n\r\n### For documentation related changes:\r\n- [ ] Have you ensured that format looks appropriate for the output in which it is rendered?\r\n\r\n### Note:\r\nPlease ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.\r\n","created_at":"2018-03-18T01:55:31Z","updated_at":"2018-03-30T17:17:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"72dceeedea89e69ea235fec009c8b968ed14412d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/nifi/pulls/2562/commits","review_comments_url":"https://api.github.com/repos/apache/nifi/pulls/2562/comments","review_comment_url":"https://api.github.com/repos/apache/nifi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/nifi/issues/2562/comments","statuses_url":"https://api.github.com/repos/apache/nifi/statuses/ec88582be6f751abc4a4a9a0cf3b827f6d72bf2b","head":{"label":"mans2singh:NIFI-4927","ref":"NIFI-4927","sha":"ec88582be6f751abc4a4a9a0cf3b827f6d72bf2b","user":{"login":"mans2singh","id":8467404,"avatar_url":"https://avatars0.githubusercontent.com/u/8467404?v=4","gravatar_id":"","url":"https://api.github.com/users/mans2singh","html_url":"https://github.com/mans2singh","followers_url":"https://api.github.com/users/mans2singh/followers","following_url":"https://api.github.com/users/mans2singh/following{/other_user}","gists_url":"https://api.github.com/users/mans2singh/gists{/gist_id}","starred_url":"https://api.github.com/users/mans2singh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mans2singh/subscriptions","organizations_url":"https://api.github.com/users/mans2singh/orgs","repos_url":"https://api.github.com/users/mans2singh/repos","events_url":"https://api.github.com/users/mans2singh/events{/privacy}","received_events_url":"https://api.github.com/users/mans2singh/received_events","type":"User","site_admin":false},"repo":{"id":51235186,"name":"nifi","full_name":"mans2singh/nifi","owner":{"login":"mans2singh","id":8467404,"avatar_url":"https://avatars0.githubusercontent.com/u/8467404?v=4","gravatar_id":"","url":"https://api.github.com/users/mans2singh","html_url":"https://github.com/mans2singh","followers_url":"https://api.github.com/users/mans2singh/followers","following_url":"https://api.github.com/users/mans2singh/following{/other_user}","gists_url":"https://api.github.com/users/mans2singh/gists{/gist_id}","starred_url":"https://api.github.com/users/mans2singh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mans2singh/subscriptions","organizations_url":"https://api.github.com/users/mans2singh/orgs","repos_url":"https://api.github.com/users/mans2singh/repos","events_url":"https://api.github.com/users/mans2singh/events{/privacy}","received_events_url":"https://api.github.com/users/mans2singh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mans2singh/nifi","description":"Mirror of Apache NiFi","fork":true,"url":"https://api.github.com/repos/mans2singh/nifi","forks_url":"https://api.github.com/repos/mans2singh/nifi/forks","keys_url":"https://api.github.com/repos/mans2singh/nifi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mans2singh/nifi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mans2singh/nifi/teams","hooks_url":"https://api.github.com/repos/mans2singh/nifi/hooks","issue_events_url":"https://api.github.com/repos/mans2singh/nifi/issues/events{/number}","events_url":"https://api.github.com/repos/mans2singh/nifi/events","assignees_url":"https://api.github.com/repos/mans2singh/nifi/assignees{/user}","branches_url":"https://api.github.com/repos/mans2singh/nifi/branches{/branch}","tags_url":"https://api.github.com/repos/mans2singh/nifi/tags","blobs_url":"https://api.github.com/repos/mans2singh/nifi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mans2singh/nifi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mans2singh/nifi/git/refs{/sha}","trees_url":"https://api.github.com/repos/mans2singh/nifi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mans2singh/nifi/statuses/{sha}","languages_url":"https://api.github.com/repos/mans2singh/nifi/languages","stargazers_url":"https://api.github.com/repos/mans2singh/nifi/stargazers","contributors_url":"https://api.github.com/repos/mans2singh/nifi/contributors","subscribers_url":"https://api.github.com/repos/mans2singh/nifi/subscribers","subscription_url":"https://api.github.com/repos/mans2singh/nifi/subscription","commits_url":"https://api.github.com/repos/mans2singh/nifi/commits{/sha}","git_commits_url":"https://api.github.com/repos/mans2singh/nifi/git/commits{/sha}","comments_url":"https://api.github.com/repos/mans2singh/nifi/comments{/number}","issue_comment_url":"https://api.github.com/repos/mans2singh/nifi/issues/comments{/number}","contents_url":"https://api.github.com/repos/mans2singh/nifi/contents/{+path}","compare_url":"https://api.github.com/repos/mans2singh/nifi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mans2singh/nifi/merges","archive_url":"https://api.github.com/repos/mans2singh/nifi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mans2singh/nifi/downloads","issues_url":"https://api.github.com/repos/mans2singh/nifi/issues{/number}","pulls_url":"https://api.github.com/repos/mans2singh/nifi/pulls{/number}","milestones_url":"https://api.github.com/repos/mans2singh/nifi/milestones{/number}","notifications_url":"https://api.github.com/repos/mans2singh/nifi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mans2singh/nifi/labels{/name}","releases_url":"https://api.github.com/repos/mans2singh/nifi/releases{/id}","deployments_url":"https://api.github.com/repos/mans2singh/nifi/deployments","created_at":"2016-02-07T04:22:11Z","updated_at":"2018-03-18T04:28:34Z","pushed_at":"2018-03-27T03:13:15Z","git_url":"git://github.com/mans2singh/nifi.git","ssh_url":"git@github.com:mans2singh/nifi.git","clone_url":"https://github.com/mans2singh/nifi.git","svn_url":"https://github.com/mans2singh/nifi","homepage":"","size":112941,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"c9f1c9789d03c9b25c52d0f2ba3973284ff5037e","user":{"login":"apache","id":47359,"avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":27911088,"name":"nifi","full_name":"apache/nifi","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/nifi","description":"Mirror of Apache NiFi","fork":false,"url":"https://api.github.com/repos/apache/nifi","forks_url":"https://api.github.com/repos/apache/nifi/forks","keys_url":"https://api.github.com/repos/apache/nifi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/nifi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/nifi/teams","hooks_url":"https://api.github.com/repos/apache/nifi/hooks","issue_events_url":"https://api.github.com/repos/apache/nifi/issues/events{/number}","events_url":"https://api.github.com/repos/apache/nifi/events","assignees_url":"https://api.github.com/repos/apache/nifi/assignees{/user}","branches_url":"https://api.github.com/repos/apache/nifi/branches{/branch}","tags_url":"https://api.github.com/repos/apache/nifi/tags","blobs_url":"https://api.github.com/repos/apache/nifi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/nifi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/nifi/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/nifi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/nifi/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/nifi/languages","stargazers_url":"https://api.github.com/repos/apache/nifi/stargazers","contributors_url":"https://api.github.com/repos/apache/nifi/contributors","subscribers_url":"https://api.github.com/repos/apache/nifi/subscribers","subscription_url":"https://api.github.com/repos/apache/nifi/subscription","commits_url":"https://api.github.com/repos/apache/nifi/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/nifi/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/nifi/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/nifi/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/nifi/contents/{+path}","compare_url":"https://api.github.com/repos/apache/nifi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/nifi/merges","archive_url":"https://api.github.com/repos/apache/nifi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/nifi/downloads","issues_url":"https://api.github.com/repos/apache/nifi/issues{/number}","pulls_url":"https://api.github.com/repos/apache/nifi/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/nifi/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/nifi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/nifi/labels{/name}","releases_url":"https://api.github.com/repos/apache/nifi/releases{/id}","deployments_url":"https://api.github.com/repos/apache/nifi/deployments","created_at":"2014-12-12T08:00:05Z","updated_at":"2018-03-30T09:46:35Z","pushed_at":"2018-03-30T14:56:38Z","git_url":"git://github.com/apache/nifi.git","ssh_url":"git@github.com:apache/nifi.git","clone_url":"https://github.com/apache/nifi.git","svn_url":"https://github.com/apache/nifi","homepage":"","size":115704,"stargazers_count":869,"watchers_count":869,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":836,"mirror_url":null,"archived":false,"open_issues_count":126,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":836,"open_issues":126,"watchers":869,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/nifi/pulls/2562"},"html":{"href":"https://github.com/apache/nifi/pull/2562"},"issue":{"href":"https://api.github.com/repos/apache/nifi/issues/2562"},"comments":{"href":"https://api.github.com/repos/apache/nifi/issues/2562/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/nifi/pulls/2562/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/nifi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/nifi/pulls/2562/commits"},"statuses":{"href":"https://api.github.com/repos/apache/nifi/statuses/ec88582be6f751abc4a4a9a0cf3b827f6d72bf2b"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"MikeThomsen"}}