use of com.yahoo.document.fieldpathupdate.FieldPathUpdate in project vespa by vespa-engine.
the class PathUpdateToDocumentTestCase method requireThatRemoveIsConverted.
@Test
public void requireThatRemoveIsConverted() {
DocumentType docType = new DocumentType("my_type");
ArrayDataType arrType = DataType.getArray(DataType.INT);
docType.addField(new Field("my_arr", arrType));
FieldPathUpdate upd = new RemoveFieldPathUpdate(docType, "my_arr", "");
Document doc = FieldPathUpdateHelper.newPartialDocument(null, upd);
assertNotNull(doc);
FieldValue obj = doc.getFieldValue("my_arr");
assertTrue(obj instanceof Array);
Array arr = (Array) obj;
assertEquals(0, arr.size());
}
Aggregations