@Test
    public void nonExistingFieldsCanBeIgnoredInUpdate()  throws IOException{
        JsonReader r = createReader("""
                                    {
                                      "update": "id:unittest:smoke::doc1",
                                      "fields": {
                                        "nonexisting1": { "assign": "ignored value" },
                                        "field1": { "assign": "value1" },
                                        "nonexisting2": {
                                          "assign": {
                                            "blocks": {
                                              "a":[2.0,3.0],
                                              "b":[4.0,5.0]
                                            }
                                          }
                                        },
                                        "field2": { "assign": "value2" },
                                        "nonexisting3": {
                                          "assign" : {
                                            "cells": [{"address": {"x": "x1"}, "value": 1.0}]
                                          }
                                        },
                                        "tensor1": {"assign": { "cells": {"x1": 1.0} } },
                                        "nonexisting4": { "assign": "ignored value" }
                                      }
                                    }
                                    """);
        DocumentParseInfo parseInfo = r.parseDocument().get();
        DocumentType docType = r.readDocumentType(parseInfo.documentId);
        DocumentUpdate update = new DocumentUpdate(docType, parseInfo.documentId);
        boolean fullyApplied = new VespaJsonDocumentReader(true).readUpdate(parseInfo.fieldsBuffer, update);
        assertFalse(fullyApplied);
        assertNull(update.getFieldUpdate("nonexisting1"));
        assertEquals("value1", update.getFieldUpdate("field1").getValueUpdates().get(0).getValue().getWrappedValue().toString());
        assertNull(update.getFieldUpdate("nonexisting2"));
        assertEquals("value2", update.getFieldUpdate("field2").getValueUpdates().get(0).getValue().getWrappedValue().toString());
        assertNull(update.getFieldUpdate("nonexisting3"));
        assertEquals(Tensor.from("tensor(x{}):{{x:x1}:1.0}"), update.getFieldUpdate("tensor1").getValueUpdates().get(0).getValue().getWrappedValue());
        assertNull(update.getFieldUpdate("nonexisting4"));
    }
Basic test of JSON streams to Vespa document instances.

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