summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/sync_tail_test_fixture.cpp
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2018-03-15 13:31:44 -0400
committerBenety Goh <benety@mongodb.com>2018-03-15 13:31:44 -0400
commit2e73e59be2497e5ee054b7cb9eea5e362ad82e69 (patch)
tree948387a1d3f77d84d7db0628bc96352e827166d9 /src/mongo/db/repl/sync_tail_test_fixture.cpp
parentaf4a205d76af2f9ae366e723db47e671cb951ab2 (diff)
downloadmongo-2e73e59be2497e5ee054b7cb9eea5e362ad82e69.tar.gz
SERVER-33902 use StorageInterfaceImpl in SyncTail tests
Diffstat (limited to 'src/mongo/db/repl/sync_tail_test_fixture.cpp')
-rw-r--r--src/mongo/db/repl/sync_tail_test_fixture.cpp23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/mongo/db/repl/sync_tail_test_fixture.cpp b/src/mongo/db/repl/sync_tail_test_fixture.cpp
index 4d84411e4ea..fb7fc2888b6 100644
--- a/src/mongo/db/repl/sync_tail_test_fixture.cpp
+++ b/src/mongo/db/repl/sync_tail_test_fixture.cpp
@@ -39,7 +39,8 @@
#include "mongo/db/repl/replication_coordinator_mock.h"
#include "mongo/db/repl/replication_process.h"
#include "mongo/db/repl/replication_recovery_mock.h"
-#include "mongo/db/repl/storage_interface_mock.h"
+#include "mongo/db/repl/storage_interface.h"
+#include "mongo/db/repl/storage_interface_impl.h"
namespace mongo {
namespace repl {
@@ -93,28 +94,16 @@ void SyncTailTest::setUp() {
ReplicationCoordinator::set(service, stdx::make_unique<ReplicationCoordinatorMock>(service));
ASSERT_OK(ReplicationCoordinator::get(_opCtx.get())->setFollowerMode(MemberState::RS_PRIMARY));
- auto storageInterface = stdx::make_unique<StorageInterfaceMock>();
- _storageInterface = storageInterface.get();
- storageInterface->insertDocumentsFn =
- [](OperationContext*, const NamespaceString&, const std::vector<InsertStatement>&) {
- return Status::OK();
- };
-
- // Storage interface mock should get the real uuid.
- storageInterface->getCollectionUUIDFn = [](
- OperationContext* opCtx, const NamespaceString& nss) -> StatusWith<OptionalCollectionUUID> {
- AutoGetCollectionForRead autoColl(opCtx, nss);
- return autoColl.getCollection()->uuid();
- };
+ StorageInterface::set(service, stdx::make_unique<StorageInterfaceImpl>());
+ auto storageInterface = StorageInterface::get(service);
- StorageInterface::set(service, std::move(storageInterface));
DropPendingCollectionReaper::set(
- service, stdx::make_unique<DropPendingCollectionReaper>(_storageInterface));
+ service, stdx::make_unique<DropPendingCollectionReaper>(storageInterface));
repl::setOplogCollectionName(service);
repl::createOplog(_opCtx.get());
_replicationProcess =
- new ReplicationProcess(_storageInterface,
+ new ReplicationProcess(storageInterface,
stdx::make_unique<ReplicationConsistencyMarkersMock>(),
stdx::make_unique<ReplicationRecoveryMock>());
ReplicationProcess::set(cc().getServiceContext(),