diff options
author | Geir Storli <geirst@yahooinc.com> | 2023-03-13 13:55:29 +0000 |
---|---|---|
committer | Geir Storli <geirst@yahooinc.com> | 2023-03-13 13:59:08 +0000 |
commit | 0c657642eff7d85c000464e9edba16ded4845e7d (patch) | |
tree | 3315f420e49dd85739089780388007ce1649672a /storage/src/tests/storageserver | |
parent | a40183094fd45dbf320dd57f8d56a5a6fac7f247 (diff) |
Reduce creation of Document instances without DocumentTypeRepo.
Diffstat (limited to 'storage/src/tests/storageserver')
-rw-r--r-- | storage/src/tests/storageserver/documentapiconvertertest.cpp | 4 | ||||
-rw-r--r-- | storage/src/tests/storageserver/rpc/storage_api_rpc_service_test.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/storage/src/tests/storageserver/documentapiconvertertest.cpp b/storage/src/tests/storageserver/documentapiconvertertest.cpp index c375443b265..42944c81f13 100644 --- a/storage/src/tests/storageserver/documentapiconvertertest.cpp +++ b/storage/src/tests/storageserver/documentapiconvertertest.cpp @@ -106,7 +106,7 @@ struct DocumentApiConverterTest : Test { }; TEST_F(DocumentApiConverterTest, put) { - auto doc = std::make_shared<Document>(_html_type, defaultDocId); + auto doc = std::make_shared<Document>(*_repo, _html_type, defaultDocId); documentapi::PutDocumentMessage putmsg(doc); putmsg.setTimestamp(1234); @@ -126,7 +126,7 @@ TEST_F(DocumentApiConverterTest, put) { } TEST_F(DocumentApiConverterTest, forwarded_put) { - auto doc = std::make_shared<Document>(_html_type, DocumentId("id:ns:" + _html_type.getName() + "::test")); + auto doc = std::make_shared<Document>(*_repo, _html_type, DocumentId("id:ns:" + _html_type.getName() + "::test")); auto putmsg = std::make_unique<documentapi::PutDocumentMessage>(doc); auto* putmsg_raw = putmsg.get(); diff --git a/storage/src/tests/storageserver/rpc/storage_api_rpc_service_test.cpp b/storage/src/tests/storageserver/rpc/storage_api_rpc_service_test.cpp index bfc22b9f1ea..26c5b8df5a5 100644 --- a/storage/src/tests/storageserver/rpc/storage_api_rpc_service_test.cpp +++ b/storage/src/tests/storageserver/rpc/storage_api_rpc_service_test.cpp @@ -161,7 +161,7 @@ public: std::shared_ptr<api::PutCommand> create_dummy_put_command() const { auto doc_type = _doc_type_repo->getDocumentType("testdoctype1"); - auto doc = std::make_shared<document::Document>(*doc_type, document::DocumentId("id:foo:testdoctype1::bar")); + auto doc = std::make_shared<document::Document>(*_doc_type_repo, *doc_type, document::DocumentId("id:foo:testdoctype1::bar")); doc->setFieldValue(doc->getField("hstringval"), std::make_unique<document::StringFieldValue>("hello world")); return std::make_shared<api::PutCommand>(makeDocumentBucket(document::BucketId(0)), std::move(doc), 100); } |