From 34511bc52fbf8915f38823921668f01ab11d7c8f Mon Sep 17 00:00:00 2001 From: zenfenan Date: Sat, 23 Jun 2018 14:17:58 +0530 Subject: [PATCH] NIFI-5332: Fix GetMongoIT test failures --- .../apache/nifi/processors/mongodb/GetMongoIT.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/test/java/org/apache/nifi/processors/mongodb/GetMongoIT.java b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/test/java/org/apache/nifi/processors/mongodb/GetMongoIT.java index 71bfc2bde8b5..4bb0078d0f68 100644 --- a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/test/java/org/apache/nifi/processors/mongodb/GetMongoIT.java +++ b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/test/java/org/apache/nifi/processors/mongodb/GetMongoIT.java @@ -135,7 +135,7 @@ public void testValidators() { // invalid projection runner.setVariable("projection", "{a: x,y,z}"); - runner.setProperty(GetMongo.QUERY, "{a: 1}"); + runner.setProperty(GetMongo.QUERY, "{\"a\": 1}"); runner.setProperty(GetMongo.PROJECTION, "{a: z}"); runner.enqueue(new byte[0]); pc = runner.getProcessContext(); @@ -190,7 +190,7 @@ public void testReadOneDocument() throws Exception { @Test public void testReadMultipleDocuments() throws Exception { - runner.setProperty(GetMongo.QUERY, "{a: {$exists: true}}"); + runner.setProperty(GetMongo.QUERY, "{\"a\": {\"$exists\": \"true\"}}"); runner.run(); runner.assertAllFlowFilesTransferred(GetMongo.REL_SUCCESS, 3); @@ -202,8 +202,8 @@ public void testReadMultipleDocuments() throws Exception { @Test public void testProjection() throws Exception { - runner.setProperty(GetMongo.QUERY, "{a: 1, b: 3}"); - runner.setProperty(GetMongo.PROJECTION, "{_id: 0, a: 1}"); + runner.setProperty(GetMongo.QUERY, "{\"a\": 1, \"b\": 3}"); + runner.setProperty(GetMongo.PROJECTION, "{\"_id\": 0, \"a\": 1}"); runner.run(); runner.assertAllFlowFilesTransferred(GetMongo.REL_SUCCESS, 1); @@ -215,7 +215,7 @@ public void testProjection() throws Exception { @Test public void testSort() throws Exception { runner.setVariable("sort", "{a: -1, b: -1, c: 1}"); - runner.setProperty(GetMongo.QUERY, "{a: {$exists: true}}"); + runner.setProperty(GetMongo.QUERY, "{\"a\": {\"$exists\": \"true\"}}"); runner.setProperty(GetMongo.SORT, "${sort}"); runner.run(); @@ -228,7 +228,7 @@ public void testSort() throws Exception { @Test public void testLimit() throws Exception { - runner.setProperty(GetMongo.QUERY, "{a: {$exists: true}}"); + runner.setProperty(GetMongo.QUERY, "{\"a\": {\"$exists\": \"true\"}}"); runner.setProperty(GetMongo.LIMIT, "${limit}"); runner.setVariable("limit", "1"); runner.run();