Github user mgaido91 commented on a diff in the pull request: https://github.com/apache/nifi/pull/2392#discussion_r161213967 --- Diff: nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/test/java/org/apache/nifi/processors/mongodb/PutMongoTest.java --- @@ -256,4 +258,72 @@ public void testUpsertWithOperators() throws Exception { Assert.assertEquals("Msg had wrong value", msg, "Hi"); } } + + /* + * Start NIFI-4759 Regression Tests + * + * 2 issues with ID field: + * + * * Assumed _id is the update key, causing failures when the user configured a different one in the UI. + * * Treated _id as a string even when it is an ObjectID sent from another processor as a string value. + * + * Expected behavior: + * + * * update key field should work no matter what (legal) value it is set to be. + * * _ids that are ObjectID should become real ObjectIDs when added to Mongo. + * * _ids that are arbitrary strings should be still go in as strings. + * + */ + + @Test + public void testNiFi_4759_Regressions() { + String[] upserts = new String[]{ + "{\n" + --- End diff -- I just meant that is hard to read and understand the content of this JSON. I think that something like: ``` String[] upserts = new String[]{ "{...}", "{...}", "{...}"}; ``` would improve readability.
---