[ https://issues.apache.org/jira/browse/NIFI-4927?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16424886#comment-16424886 ]
ASF GitHub Bot commented on NIFI-4927: -------------------------------------- Github user mans2singh commented on a diff in the pull request: https://github.com/apache/nifi/pull/2562#discussion_r179012036 --- Diff: nifi-nar-bundles/nifi-influxdb-bundle/nifi-influxdb-processors/src/test/java/org/apache/nifi/processors/influxdb/ITExecuteInfluxDBQuery.java --- @@ -110,8 +125,72 @@ public void testCreateDB() { assertEquals("Value should be equal",null, flowFiles.get(0).getAttribute(ExecuteInfluxDBQuery.INFLUX_DB_ERROR_MESSAGE)); assertEquals("Value should be equal",query, flowFiles.get(0).getAttribute(ExecuteInfluxDBQuery.INFLUX_DB_EXECUTED_QUERY)); - flowFiles.get(0).assertContentEquals("{\"results\":[{}]}"); + QueryResult queryResult = gson.fromJson(new StringReader(new String(flowFiles.get(0).toByteArray())), QueryResult.class); + assertEquals("results array should be empty", 1, queryResult.getResults().size()); + assertEquals("No series", null, queryResult.getResults().get(0).getSeries()); + } + + @Test + public void testEmptyFlowFileQueryWithScheduledQuery() { + String message = "water,country=US,city=newark rain=1,humidity=0.6 1501002274856668652"; + influxDB.write(dbName, DEFAULT_RETENTION_POLICY, InfluxDB.ConsistencyLevel.ONE, message); + + String query = "select * from water"; + runner.setProperty(ExecuteInfluxDBQuery.INFLUX_DB_QUERY, query); + + byte [] bytes = new byte [] {}; + runner.enqueue(bytes); + runner.run(1,true,true); + runner.assertAllFlowFilesTransferred(ExecuteInfluxDBQuery.REL_SUCCESS, 1); + + List<MockFlowFile> flowFiles = runner.getFlowFilesForRelationship(ExecuteInfluxDBQuery.REL_SUCCESS); + assertEquals("Value should be equal", 1, flowFiles.size()); + assertEquals("Value should be equal",null, flowFiles.get(0).getAttribute(ExecuteInfluxDBQuery.INFLUX_DB_ERROR_MESSAGE)); --- End diff -- Corrected. > Create InfluxDB Query Processor > ------------------------------- > > Key: NIFI-4927 > URL: https://issues.apache.org/jira/browse/NIFI-4927 > Project: Apache NiFi > Issue Type: New Feature > Components: Extensions > Affects Versions: 1.5.0 > Reporter: Mans Singh > Assignee: Mans Singh > Priority: Minor > Labels: measurements,, query, realtime, timeseries > > Create InfluxDB Query processor -- This message was sent by Atlassian JIRA (v7.6.3#76005)