Fix GetMongoIT test failures
This closes
@@ -135,7 +135,7 @@ public class GetMongoIT {
// 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 class GetMongoIT {
@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 class GetMongoIT {
@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 class GetMongoIT {
@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 class GetMongoIT {
@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();
