mirror of https://github.com/apache/nifi.git
NIFI-5332: Fix GetMongoIT test failures
This closes #2808 Signed-off-by: Mike Thomsen <mikerthomsen@gmail.com>
This commit is contained in:
parent
0721d9a0ee
commit
9af61d3a2d
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue