summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/type_shard_collection_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/s/type_shard_collection_test.cpp')
-rw-r--r--src/mongo/db/s/type_shard_collection_test.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mongo/db/s/type_shard_collection_test.cpp b/src/mongo/db/s/type_shard_collection_test.cpp
index 57ef1140eeb..a9e8eba50bd 100644
--- a/src/mongo/db/s/type_shard_collection_test.cpp
+++ b/src/mongo/db/s/type_shard_collection_test.cpp
@@ -109,5 +109,18 @@ TEST(ShardCollectionType, ReshardingFieldsIncluded) {
ASSERT_EQ(reshardingUuid, shardCollType.getReshardingFields()->getUuid());
}
+TEST(ShardCollectionType, AllowMigrationsFieldBackwardsCompatibility) {
+ ShardCollectionType shardCollType(kNss, OID::gen(), UUID::gen(), kKeyPattern, true);
+ shardCollType.setAllowMigrations(false);
+ ASSERT_EQ(
+ false,
+ shardCollType.toBSON()[ShardCollectionTypeBase::kPre50CompatibleAllowMigrationsFieldName]
+ .Bool());
+
+ shardCollType.setAllowMigrations(true);
+ ASSERT(shardCollType.toBSON()[ShardCollectionTypeBase::kPre50CompatibleAllowMigrationsFieldName]
+ .eoo());
+}
+
} // namespace
} // namespace mongo