@Test
    public void testCompleteFeedWithCreateAndCondition() {
        JsonReader r = createReader("""
                                    [
                                      {
                                        "put": "id:unittest:smoke::whee",
                                        "fields": {
                                          "something": "smoketest",
                                          "flag": true,
                                          "nalle": "bamse"
                                        }
                                      },
                                      {
                                        "condition":"bla",
                                        "update": "id:unittest:testarray::whee",
                                        "create":true,
                                        "fields": {
                                          "actualarray": {
                                            "add": [
                                              "person",
                                              "another person"
                                            ]
                                          }
                                        }
                                      },
                                      {
                                        "remove": "id:unittest:smoke::whee"
                                      }
                                    ]
                                    """);

        DocumentOperation d = r.next();
        Document doc = ((DocumentPut) d).getDocument();
        smokeTestDoc(doc);

        d = r.next();
        DocumentUpdate update = (DocumentUpdate) d;
        checkSimpleArrayAdd(update);
        assertTrue(update.getCreateIfNonExistent());
        assertEquals("bla", update.getCondition().getSelection());

        d = r.next();
        DocumentRemove remove = (DocumentRemove) d;
        assertEquals("smoke", remove.getId().getDocType());

        assertNull(r.next());
    }
Basic test of JSON streams to Vespa document instances.

@author Steinar Knutsen
@author bratseth
document/src/test/java/com/yahoo/document/json/JsonReaderTestCase.java