summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/document_source_lookup_change_post_image_test.cpp
diff options
context:
space:
mode:
authorIan Boros <puppyofkosh@gmail.com>2019-05-08 13:23:47 -0400
committerIan Boros <puppyofkosh@gmail.com>2019-05-09 12:06:00 -0400
commitbf47260ea0cbc58d3744d8964b2eb036b9a1a19e (patch)
tree3814d7b3315e37c54a5f0395a0e3fb0a999f5879 /src/mongo/db/pipeline/document_source_lookup_change_post_image_test.cpp
parent7e6a80789cd74f9b533065f57afb5c9221eea1e7 (diff)
downloadmongo-bf47260ea0cbc58d3744d8964b2eb036b9a1a19e.tar.gz
SERVER-41053 Don't create ServiceContexts while doing updates
This commit also renames DocumentSourceMock::create to DocumentSourceMock::createForTest.
Diffstat (limited to 'src/mongo/db/pipeline/document_source_lookup_change_post_image_test.cpp')
-rw-r--r--src/mongo/db/pipeline/document_source_lookup_change_post_image_test.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/mongo/db/pipeline/document_source_lookup_change_post_image_test.cpp b/src/mongo/db/pipeline/document_source_lookup_change_post_image_test.cpp
index 32ce6ebce8f..bd88e955337 100644
--- a/src/mongo/db/pipeline/document_source_lookup_change_post_image_test.cpp
+++ b/src/mongo/db/pipeline/document_source_lookup_change_post_image_test.cpp
@@ -85,7 +85,7 @@ TEST_F(DocumentSourceLookupChangePostImageTest, ShouldErrorIfMissingDocumentKeyO
auto lookupChangeStage = DocumentSourceLookupChangePostImage::create(expCtx);
// Mock its input with a document without a "documentKey" field.
- auto mockLocalSource = DocumentSourceMock::create(
+ auto mockLocalSource = DocumentSourceMock::createForTest(
Document{{"_id", makeResumeToken(0)},
{"operationType", "update"_sd},
{"fullDocument", Document{{"_id", 0}}},
@@ -107,7 +107,7 @@ TEST_F(DocumentSourceLookupChangePostImageTest, ShouldErrorIfMissingOperationTyp
auto lookupChangeStage = DocumentSourceLookupChangePostImage::create(expCtx);
// Mock its input with a document without a "ns" field.
- auto mockLocalSource = DocumentSourceMock::create(
+ auto mockLocalSource = DocumentSourceMock::createForTest(
Document{{"_id", makeResumeToken(0)},
{"documentKey", Document{{"_id", 0}}},
{"fullDocument", Document{{"_id", 0}}},
@@ -129,7 +129,7 @@ TEST_F(DocumentSourceLookupChangePostImageTest, ShouldErrorIfMissingNamespace) {
auto lookupChangeStage = DocumentSourceLookupChangePostImage::create(expCtx);
// Mock its input with a document without a "ns" field.
- auto mockLocalSource = DocumentSourceMock::create(Document{
+ auto mockLocalSource = DocumentSourceMock::createForTest(Document{
{"_id", makeResumeToken(0)},
{"documentKey", Document{{"_id", 0}}},
{"operationType", "update"_sd},
@@ -152,10 +152,10 @@ TEST_F(DocumentSourceLookupChangePostImageTest, ShouldErrorIfNsFieldHasWrongType
// Mock its input with a document without a "ns" field.
auto mockLocalSource =
- DocumentSourceMock::create(Document{{"_id", makeResumeToken(0)},
- {"documentKey", Document{{"_id", 0}}},
- {"operationType", "update"_sd},
- {"ns", 4}});
+ DocumentSourceMock::createForTest(Document{{"_id", makeResumeToken(0)},
+ {"documentKey", Document{{"_id", 0}}},
+ {"operationType", "update"_sd},
+ {"ns", 4}});
lookupChangeStage->setSource(mockLocalSource.get());
@@ -173,7 +173,7 @@ TEST_F(DocumentSourceLookupChangePostImageTest, ShouldErrorIfNsFieldDoesNotMatch
auto lookupChangeStage = DocumentSourceLookupChangePostImage::create(expCtx);
// Mock its input with a document without a "ns" field.
- auto mockLocalSource = DocumentSourceMock::create(
+ auto mockLocalSource = DocumentSourceMock::createForTest(
Document{{"_id", makeResumeToken(0)},
{"documentKey", Document{{"_id", 0}}},
{"operationType", "update"_sd},
@@ -197,7 +197,7 @@ TEST_F(DocumentSourceLookupChangePostImageTest, ShouldErrorIfDatabaseMismatchOnC
auto lookupChangeStage = DocumentSourceLookupChangePostImage::create(expCtx);
// Mock its input with a document without a "ns" field.
- auto mockLocalSource = DocumentSourceMock::create(
+ auto mockLocalSource = DocumentSourceMock::createForTest(
Document{{"_id", makeResumeToken(0)},
{"documentKey", Document{{"_id", 0}}},
{"operationType", "update"_sd},
@@ -224,7 +224,7 @@ TEST_F(DocumentSourceLookupChangePostImageTest, ShouldPassIfDatabaseMatchesOnCol
deque<DocumentSource::GetNextResult> mockForeignContents{Document{{"_id", 0}}};
expCtx->mongoProcessInterface = stdx::make_unique<MockMongoInterface>(mockForeignContents);
- auto mockLocalSource = DocumentSourceMock::create(
+ auto mockLocalSource = DocumentSourceMock::createForTest(
Document{{"_id", makeResumeToken(0)},
{"documentKey", Document{{"_id", 0}}},
{"operationType", "update"_sd},
@@ -250,7 +250,7 @@ TEST_F(DocumentSourceLookupChangePostImageTest, ShouldErrorIfDocumentKeyIsNotUni
auto lookupChangeStage = DocumentSourceLookupChangePostImage::create(expCtx);
// Mock its input with an update document.
- auto mockLocalSource = DocumentSourceMock::create(
+ auto mockLocalSource = DocumentSourceMock::createForTest(
Document{{"_id", makeResumeToken(0)},
{"documentKey", Document{{"_id", 0}}},
{"operationType", "update"_sd},
@@ -275,7 +275,7 @@ TEST_F(DocumentSourceLookupChangePostImageTest, ShouldPropagatePauses) {
auto lookupChangeStage = DocumentSourceLookupChangePostImage::create(expCtx);
// Mock its input, pausing every other result.
- auto mockLocalSource = DocumentSourceMock::create(
+ auto mockLocalSource = DocumentSourceMock::createForTest(
{Document{{"_id", makeResumeToken(0)},
{"documentKey", Document{{"_id", 0}}},
{"operationType", "insert"_sd},