summaryrefslogtreecommitdiff
path: root/src/mongo/db/auth/auth_op_observer_test.cpp
diff options
context:
space:
mode:
authorjannaerin <golden.janna@gmail.com>2023-02-01 20:54:39 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-02-08 02:46:14 +0000
commit567bcd0e4822d726aea15f0338c89c49de2a56b5 (patch)
treefa2a6ea1d3cbd4872fba26df3fdb44548544206f /src/mongo/db/auth/auth_op_observer_test.cpp
parentf7afadd90f50662b2b3b3a45595b65b37a59bdc3 (diff)
downloadmongo-567bcd0e4822d726aea15f0338c89c49de2a56b5.tar.gz
SERVER-73112 Expose function to construct NamespaceString in unit tests
Diffstat (limited to 'src/mongo/db/auth/auth_op_observer_test.cpp')
-rw-r--r--src/mongo/db/auth/auth_op_observer_test.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/db/auth/auth_op_observer_test.cpp b/src/mongo/db/auth/auth_op_observer_test.cpp
index 56d9e80c82e..d1f6ac87506 100644
--- a/src/mongo/db/auth/auth_op_observer_test.cpp
+++ b/src/mongo/db/auth/auth_op_observer_test.cpp
@@ -90,7 +90,7 @@ public:
});
}
- NamespaceString _nss = {"test", "coll"};
+ NamespaceString _nss = NamespaceString::createNamespaceString_forTest("test", "coll");
private:
// Creates a reasonable set of ReplSettings for most tests. We need to be able to
@@ -145,7 +145,7 @@ TEST_F(AuthOpObserverTest, OnRollbackDoesntInvalidateAuthCacheWhenNoAuthNamespac
TEST_F(AuthOpObserverTest, MultipleAboutToDeleteAndOnDelete) {
AuthOpObserver opObserver;
auto opCtx = cc().makeOperationContext();
- NamespaceString nss = {"test", "coll"};
+ NamespaceString nss = NamespaceString::createNamespaceString_forTest("test", "coll");
WriteUnitOfWork wunit(opCtx.get());
AutoGetCollection autoColl(opCtx.get(), nss, MODE_IX);
opObserver.aboutToDelete(opCtx.get(), *autoColl, BSON("_id" << 1));
@@ -158,7 +158,7 @@ DEATH_TEST_F(AuthOpObserverTest, AboutToDeleteMustPreceedOnDelete, "invariant")
AuthOpObserver opObserver;
auto opCtx = cc().makeOperationContext();
cc().swapLockState(std::make_unique<LockerNoop>());
- NamespaceString nss = {"test", "coll"};
+ NamespaceString nss = NamespaceString::createNamespaceString_forTest("test", "coll");
AutoGetCollection autoColl(opCtx.get(), nss, MODE_IX);
opObserver.onDelete(opCtx.get(), *autoColl, {}, {});
}