summaryrefslogtreecommitdiff
path: root/src/mongo/db/update/object_replace_node_test.cpp
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2017-08-10 15:52:33 -0400
committerMathias Stearn <mathias@10gen.com>2017-08-16 16:28:02 -0400
commit347935f7a5d0452146b1a73ad7ef9e249eaf1fb5 (patch)
tree00b322f5adcf3eb9c2624747a6b5b2179e440052 /src/mongo/db/update/object_replace_node_test.cpp
parentcdf7aacb213c99d3ce620761ff46b030bbd7732d (diff)
downloadmongo-347935f7a5d0452146b1a73ad7ef9e249eaf1fb5.tar.gz
SERVER-30580 Eliminate UserException and MsgAssertionException types
All users were converted to just use AssertionException.
Diffstat (limited to 'src/mongo/db/update/object_replace_node_test.cpp')
-rw-r--r--src/mongo/db/update/object_replace_node_test.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mongo/db/update/object_replace_node_test.cpp b/src/mongo/db/update/object_replace_node_test.cpp
index 645a3e69ff3..27bb8aea7b3 100644
--- a/src/mongo/db/update/object_replace_node_test.cpp
+++ b/src/mongo/db/update/object_replace_node_test.cpp
@@ -158,7 +158,7 @@ TEST_F(ObjectReplaceNodeTest, CannotRemoveImmutablePath) {
mutablebson::Document doc(fromjson("{_id: 0, a: {b: 1}}"));
addImmutablePath("a.b");
ASSERT_THROWS_CODE_AND_WHAT(node.apply(getApplyParams(doc.root())),
- UserException,
+ AssertionException,
ErrorCodes::ImmutableField,
"After applying the update, the 'a.b' (required and immutable) "
"field was found to have been removed --{ _id: 0, a: { b: 1 } }");
@@ -185,7 +185,7 @@ TEST_F(ObjectReplaceNodeTest, CannotReplaceImmutablePathWithArrayField) {
mutablebson::Document doc(fromjson("{_id: 0, a: {b: 1}}"));
addImmutablePath("a.b");
ASSERT_THROWS_CODE_AND_WHAT(node.apply(getApplyParams(doc.root())),
- UserException,
+ AssertionException,
ErrorCodes::NotSingleValueField,
"After applying the update to the document, the (immutable) field "
"'a.b' was found to be an array or array descendant.");
@@ -198,7 +198,7 @@ TEST_F(ObjectReplaceNodeTest, CannotMakeImmutablePathArrayDescendant) {
mutablebson::Document doc(fromjson("{_id: 0, a: {'0': 1}}"));
addImmutablePath("a.0");
ASSERT_THROWS_CODE_AND_WHAT(node.apply(getApplyParams(doc.root())),
- UserException,
+ AssertionException,
ErrorCodes::NotSingleValueField,
"After applying the update to the document, the (immutable) field "
"'a.0' was found to be an array or array descendant.");
@@ -211,7 +211,7 @@ TEST_F(ObjectReplaceNodeTest, CannotModifyImmutablePath) {
mutablebson::Document doc(fromjson("{_id: 0, a: {b: 1}}"));
addImmutablePath("a.b");
ASSERT_THROWS_CODE_AND_WHAT(node.apply(getApplyParams(doc.root())),
- UserException,
+ AssertionException,
ErrorCodes::ImmutableField,
"After applying the update, the (immutable) field 'a.b' was found "
"to have been altered to b: 2");
@@ -224,7 +224,7 @@ TEST_F(ObjectReplaceNodeTest, CannotModifyImmutableId) {
mutablebson::Document doc(fromjson("{_id: 0}"));
addImmutablePath("_id");
ASSERT_THROWS_CODE_AND_WHAT(node.apply(getApplyParams(doc.root())),
- UserException,
+ AssertionException,
ErrorCodes::ImmutableField,
"After applying the update, the (immutable) field '_id' was found "
"to have been altered to _id: 1");
@@ -265,7 +265,7 @@ TEST_F(ObjectReplaceNodeTest, CannotCreateDollarPrefixedNameWhenValidateForStora
mutablebson::Document doc(fromjson("{}"));
ASSERT_THROWS_CODE_AND_WHAT(
node.apply(getApplyParams(doc.root())),
- UserException,
+ AssertionException,
ErrorCodes::DollarPrefixedFieldName,
"The dollar ($) prefixed field '$bad' in 'a.$bad' is not valid for storage.");
}