aboutsummaryrefslogtreecommitdiffstats
path: root/storageapi
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@verizonmedia.com>2019-04-10 09:38:01 +0000
committerTor Brede Vekterli <vekterli@verizonmedia.com>2019-04-10 09:38:01 +0000
commitdb23cae328fc179185a1707319f57259674826df (patch)
tree18bf50c86e61d4aee43a41ea1d37a0a3a8562dc5 /storageapi
parent2354e794031cec8bcb654e676338bc0ddcbb71d6 (diff)
Explicitly test response without bucket ID remapping
Diffstat (limited to 'storageapi')
-rw-r--r--storageapi/src/tests/mbusprot/storageprotocoltest.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/storageapi/src/tests/mbusprot/storageprotocoltest.cpp b/storageapi/src/tests/mbusprot/storageprotocoltest.cpp
index b1de64162fa..52f988d22b3 100644
--- a/storageapi/src/tests/mbusprot/storageprotocoltest.cpp
+++ b/storageapi/src/tests/mbusprot/storageprotocoltest.cpp
@@ -184,10 +184,21 @@ TEST_P(StorageProtocolTest, put) {
EXPECT_EQ(*_testDoc, *reply->getDocument());
EXPECT_EQ(_testDoc->getId(), reply2->getDocumentId());
EXPECT_EQ(Timestamp(14), reply2->getTimestamp());
- // TODO test without remapping as well
EXPECT_NO_FATAL_FAILURE(assert_bucket_info_reply_fields_propagated(*reply2));
}
+TEST_P(StorageProtocolTest, response_without_remapped_bucket_preserves_original_bucket) {
+ auto cmd = std::make_shared<PutCommand>(_bucket, _testDoc, 14);
+ auto cmd2 = copyCommand(cmd);
+ auto reply = std::make_shared<PutReply>(*cmd2);
+ auto reply2 = copyReply(reply);
+
+ EXPECT_FALSE(reply2->hasBeenRemapped());
+ EXPECT_EQ(_bucket_id, reply2->getBucketId());
+ EXPECT_EQ(document::BucketId(), reply2->getOriginalBucketId());
+
+}
+
TEST_P(StorageProtocolTest, update) {
auto update = std::make_shared<document::DocumentUpdate>(
_docMan.getTypeRepo(), *_testDoc->getDataType(), _testDoc->getId());