diff options
author | Randolph Tan <randolph@10gen.com> | 2017-04-18 11:03:18 -0400 |
---|---|---|
committer | Randolph Tan <randolph@10gen.com> | 2017-04-18 13:20:08 -0400 |
commit | 89931a9ab6942c8f55afa1a523ac8fb0801ba731 (patch) | |
tree | 6a964a35703a7007f2b73e6eb3f8b9d08aab9882 | |
parent | ecb02672a5bb3c2de35729278bb0537e8df3aefd (diff) | |
download | mongo-89931a9ab6942c8f55afa1a523ac8fb0801ba731.tar.gz |
SERVER-28433 Use mock DistLockManager in test
-rw-r--r-- | src/mongo/db/keys_collection_cache_reader_and_updater_test.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/db/keys_collection_cache_reader_and_updater_test.cpp b/src/mongo/db/keys_collection_cache_reader_and_updater_test.cpp index fdb8e150f07..84a50dbe759 100644 --- a/src/mongo/db/keys_collection_cache_reader_and_updater_test.cpp +++ b/src/mongo/db/keys_collection_cache_reader_and_updater_test.cpp @@ -37,6 +37,7 @@ #include "mongo/db/logical_clock.h" #include "mongo/db/namespace_string.h" #include "mongo/db/operation_context.h" +#include "mongo/s/catalog/dist_lock_manager_mock.h" #include "mongo/s/config_server_test_fixture.h" #include "mongo/stdx/memory.h" #include "mongo/unittest/unittest.h" @@ -52,6 +53,12 @@ protected: auto clockSource = stdx::make_unique<ClockSourceMock>(); operationContext()->getServiceContext()->setFastClockSource(std::move(clockSource)); } + + std::unique_ptr<DistLockManager> makeDistLockManager( + std::unique_ptr<DistLockCatalog> distLockCatalog) override { + invariant(distLockCatalog); + return stdx::make_unique<DistLockManagerMock>(std::move(distLockCatalog)); + } }; TEST_F(CacheUpdaterTest, ShouldCreate2KeysFromEmpty) { |