summaryrefslogtreecommitdiffstats
path: root/storageapi/src/tests/mbusprot/storageprotocoltest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'storageapi/src/tests/mbusprot/storageprotocoltest.cpp')
-rw-r--r--storageapi/src/tests/mbusprot/storageprotocoltest.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/storageapi/src/tests/mbusprot/storageprotocoltest.cpp b/storageapi/src/tests/mbusprot/storageprotocoltest.cpp
index b927c045f51..40969455d68 100644
--- a/storageapi/src/tests/mbusprot/storageprotocoltest.cpp
+++ b/storageapi/src/tests/mbusprot/storageprotocoltest.cpp
@@ -34,6 +34,11 @@ using document::Document;
using document::DocumentId;
using document::DocumentType;
using document::DocumentTypeRepo;
+using document::FieldUpdate;
+using document::FieldPathUpdate;
+using document::AssignValueUpdate;
+using document::IntFieldValue;
+using document::RemoveFieldPathUpdate;
using document::test::makeDocumentBucket;
using document::test::makeBucketSpace;
using storage::lib::ClusterState;
@@ -245,13 +250,9 @@ TEST_P(StorageProtocolTest, response_metadata_is_propagated) {
TEST_P(StorageProtocolTest, update) {
auto update = std::make_shared<document::DocumentUpdate>(
_docMan.getTypeRepo(), *_testDoc->getDataType(), _testDoc->getId());
- auto assignUpdate = std::make_shared<document::AssignValueUpdate>(document::IntFieldValue(17));
- document::FieldUpdate fieldUpdate(_testDoc->getField("headerval"));
- fieldUpdate.addUpdate(*assignUpdate);
- update->addUpdate(fieldUpdate);
+ update->addUpdate(FieldUpdate(_testDoc->getField("headerval")).addUpdate(std::make_unique<AssignValueUpdate>(IntFieldValue(17))));
- update->addFieldPathUpdate(document::FieldPathUpdate::CP(
- new document::RemoveFieldPathUpdate("headerval", "testdoctype1.headerval > 0")));
+ update->addFieldPathUpdate(FieldPathUpdate::CP(new RemoveFieldPathUpdate("headerval", "testdoctype1.headerval > 0")));
auto cmd = std::make_shared<UpdateCommand>(_bucket, update, 14);
EXPECT_EQ(Timestamp(0), cmd->getOldTimestamp());