summaryrefslogtreecommitdiff
path: root/src/mongo/dbtests/mock_dbclient_conn_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/dbtests/mock_dbclient_conn_test.cpp')
-rw-r--r--src/mongo/dbtests/mock_dbclient_conn_test.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/mongo/dbtests/mock_dbclient_conn_test.cpp b/src/mongo/dbtests/mock_dbclient_conn_test.cpp
index 19ca674c84c..a0da2e717ea 100644
--- a/src/mongo/dbtests/mock_dbclient_conn_test.cpp
+++ b/src/mongo/dbtests/mock_dbclient_conn_test.cpp
@@ -507,23 +507,23 @@ TEST(MockDBClientConnTest, CyclingCmd) {
MockRemoteDBServer server("test");
{
- vector<mongo::StatusWith<BSONObj>> helloReplySequence;
- helloReplySequence.push_back(BSON("set"
- << "a"
- << "isWritablePrimary" << true << "ok" << 1));
- helloReplySequence.push_back(BSON("set"
- << "a"
- << "isWritablePrimary" << false << "ok" << 1));
- server.setCommandReply("hello", helloReplySequence);
+ vector<mongo::StatusWith<BSONObj>> isMasterSequence;
+ isMasterSequence.push_back(BSON("set"
+ << "a"
+ << "isMaster" << true << "ok" << 1));
+ isMasterSequence.push_back(BSON("set"
+ << "a"
+ << "isMaster" << false << "ok" << 1));
+ server.setCommandReply("isMaster", isMasterSequence);
}
{
MockDBClientConnection conn(&server);
BSONObj response;
- ASSERT(conn.runCommand("foo.baz", BSON("hello" << 1), response));
+ ASSERT(conn.runCommand("foo.baz", BSON("isMaster" << 1), response));
ASSERT_EQUALS(1, response["ok"].numberInt());
ASSERT_EQUALS("a", response["set"].str());
- ASSERT(response["isWritablePrimary"].trueValue());
+ ASSERT(response["isMaster"].trueValue());
ASSERT_EQUALS(1U, server.getCmdCount());
}
@@ -531,10 +531,10 @@ TEST(MockDBClientConnTest, CyclingCmd) {
{
MockDBClientConnection conn(&server);
BSONObj response;
- ASSERT(conn.runCommand("foo.baz", BSON("hello" << 1), response));
+ ASSERT(conn.runCommand("foo.baz", BSON("isMaster" << 1), response));
ASSERT_EQUALS(1, response["ok"].numberInt());
ASSERT_EQUALS("a", response["set"].str());
- ASSERT(!response["isWritablePrimary"].trueValue());
+ ASSERT(!response["isMaster"].trueValue());
ASSERT_EQUALS(2U, server.getCmdCount());
}
@@ -542,10 +542,10 @@ TEST(MockDBClientConnTest, CyclingCmd) {
{
MockDBClientConnection conn(&server);
BSONObj response;
- ASSERT(conn.runCommand("foo.baz", BSON("hello" << 1), response));
+ ASSERT(conn.runCommand("foo.baz", BSON("isMaster" << 1), response));
ASSERT_EQUALS(1, response["ok"].numberInt());
ASSERT_EQUALS("a", response["set"].str());
- ASSERT(response["isWritablePrimary"].trueValue());
+ ASSERT(response["isMaster"].trueValue());
ASSERT_EQUALS(3U, server.getCmdCount());
}
@@ -554,13 +554,13 @@ TEST(MockDBClientConnTest, CyclingCmd) {
TEST(MockDBClientConnTest, MultipleStoredResponse) {
MockRemoteDBServer server("test");
server.setCommandReply("serverStatus", BSON("ok" << 0));
- server.setCommandReply("hello", BSON("ok" << 1 << "secondary" << false));
+ server.setCommandReply("isMaster", BSON("ok" << 1 << "secondary" << false));
MockDBClientConnection conn(&server);
{
BSONObj response;
ASSERT(conn.runCommand("foo.baz",
- BSON("hello"
+ BSON("isMaster"
<< "abc"),
response));
ASSERT(!response["secondary"].trueValue());