summaryrefslogtreecommitdiff
path: root/src/mongo/db/catalog/create_collection_test.cpp
diff options
context:
space:
mode:
authorLingzhi Deng <lingzhi.deng@mongodb.com>2019-06-24 16:44:36 -0400
committerLingzhi Deng <lingzhi.deng@mongodb.com>2019-07-29 10:36:12 -0400
commit102c20ab166050ae7357732070bc8262aa61749c (patch)
tree6f1f7149444fe753ad7442b0622d4dc230e24635 /src/mongo/db/catalog/create_collection_test.cpp
parent0ef81e97a8f60329c44640e6b76189a3b51bd42a (diff)
downloadmongo-102c20ab166050ae7357732070bc8262aa61749c.tar.gz
SERVER-37180: Use OplogEntry everywhere in oplog application
Diffstat (limited to 'src/mongo/db/catalog/create_collection_test.cpp')
-rw-r--r--src/mongo/db/catalog/create_collection_test.cpp24
1 files changed, 8 insertions, 16 deletions
diff --git a/src/mongo/db/catalog/create_collection_test.cpp b/src/mongo/db/catalog/create_collection_test.cpp
index af99db09759..90aea925ffd 100644
--- a/src/mongo/db/catalog/create_collection_test.cpp
+++ b/src/mongo/db/catalog/create_collection_test.cpp
@@ -121,10 +121,8 @@ TEST_F(CreateCollectionTest, CreateCollectionForApplyOpsWithSpecificUuidNoExisti
auto uuid = UUID::gen();
Lock::DBLock lock(opCtx.get(), newNss.db(), MODE_X);
- ASSERT_OK(createCollectionForApplyOps(opCtx.get(),
- newNss.db().toString(),
- uuid.toBSON()["uuid"],
- BSON("create" << newNss.coll())));
+ ASSERT_OK(createCollectionForApplyOps(
+ opCtx.get(), newNss.db().toString(), uuid, BSON("create" << newNss.coll())));
ASSERT_TRUE(collectionExists(opCtx.get(), newNss));
}
@@ -149,10 +147,8 @@ TEST_F(CreateCollectionTest,
// This should rename the existing collection 'curNss' to the collection 'newNss' we are trying
// to create.
- ASSERT_OK(createCollectionForApplyOps(opCtx.get(),
- newNss.db().toString(),
- uuid.toBSON()["uuid"],
- BSON("create" << newNss.coll())));
+ ASSERT_OK(createCollectionForApplyOps(
+ opCtx.get(), newNss.db().toString(), uuid, BSON("create" << newNss.coll())));
ASSERT_FALSE(collectionExists(opCtx.get(), curNss));
ASSERT_TRUE(collectionExists(opCtx.get(), newNss));
@@ -177,10 +173,8 @@ TEST_F(CreateCollectionTest,
ASSERT_NOT_EQUALS(uuid, getCollectionUuid(opCtx.get(), newNss));
// This should rename the existing collection 'newNss' to a randomly generated collection name.
- ASSERT_OK(createCollectionForApplyOps(opCtx.get(),
- newNss.db().toString(),
- uuid.toBSON()["uuid"],
- BSON("create" << newNss.coll())));
+ ASSERT_OK(createCollectionForApplyOps(
+ opCtx.get(), newNss.db().toString(), uuid, BSON("create" << newNss.coll())));
ASSERT_TRUE(collectionExists(opCtx.get(), newNss));
ASSERT_EQUALS(uuid, getCollectionUuid(opCtx.get(), newNss));
@@ -217,10 +211,8 @@ TEST_F(CreateCollectionTest,
// This should fail because we are not allowed to take a collection out of its drop-pending
// state.
ASSERT_EQUALS(ErrorCodes::NamespaceExists,
- createCollectionForApplyOps(opCtx.get(),
- newNss.db().toString(),
- uuid.toBSON()["uuid"],
- BSON("create" << newNss.coll())));
+ createCollectionForApplyOps(
+ opCtx.get(), newNss.db().toString(), uuid, BSON("create" << newNss.coll())));
ASSERT_TRUE(collectionExists(opCtx.get(), dropPendingNss));
ASSERT_FALSE(collectionExists(opCtx.get(), newNss));