@Test
    public void testAssignSimpleMapValueWithVariable() {
        Document doc = new Document(docMan.getDocumentType("foobar"), new DocumentId("id:ns:foobar::foooo"));
        MapFieldValue mfv = new MapFieldValue((MapDataType)doc.getField("strmap").getDataType());

        mfv.put(new StringFieldValue("foo"), new StringFieldValue("bar"));
        mfv.put(new StringFieldValue("baz"), new StringFieldValue("bananas"));
        doc.setFieldValue("strmap", mfv);

        // Select on map value, not key
        DocumentUpdate docUp = new DocumentUpdate(docType, new DocumentId("id:ns:foobar::hargl:bargl"));
        docUp.addFieldPathUpdate(new AssignFieldPathUpdate(doc.getDataType(), "strmap{$x}",
                "foobar.strmap{$x} == \"bar\"", new StringFieldValue("shinyvalue")));
        docUp.applyTo(doc);

        MapFieldValue valueNow = (MapFieldValue)doc.getFieldValue("strmap");
        assertEquals(2, valueNow.size());
        assertEquals(new StringFieldValue("shinyvalue"), valueNow.get(new StringFieldValue("foo")));
        assertEquals(new StringFieldValue("bananas"), valueNow.get(new StringFieldValue("baz")));
    }
Tests applying and serializing document updates.

@author Einar M R Rosenvinge
document/src/test/java/com/yahoo/document/DocumentPathUpdateTestCase.java