summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/aggregation_request_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/pipeline/aggregation_request_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/pipeline/aggregation_request_test.cpp')
-rw-r--r--src/mongo/db/pipeline/aggregation_request_test.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mongo/db/pipeline/aggregation_request_test.cpp b/src/mongo/db/pipeline/aggregation_request_test.cpp
index 5b5540357c7..8192e0fed3e 100644
--- a/src/mongo/db/pipeline/aggregation_request_test.cpp
+++ b/src/mongo/db/pipeline/aggregation_request_test.cpp
@@ -404,25 +404,27 @@ TEST(AggregationRequestTest, ParseNSShouldReturnAggregateOneNSIfAggregateFieldIs
TEST(AggregationRequestTest, ParseNSShouldRejectNumericNSIfAggregateFieldIsNotOne) {
const BSONObj inputBSON = fromjson("{aggregate: 2, pipeline: []}");
ASSERT_THROWS_CODE(
- AggregationRequest::parseNs("a", inputBSON), UserException, ErrorCodes::FailedToParse);
+ AggregationRequest::parseNs("a", inputBSON), AssertionException, ErrorCodes::FailedToParse);
}
TEST(AggregationRequestTest, ParseNSShouldRejectNonStringNonNumericNS) {
const BSONObj inputBSON = fromjson("{aggregate: {}, pipeline: []}");
ASSERT_THROWS_CODE(
- AggregationRequest::parseNs("a", inputBSON), UserException, ErrorCodes::TypeMismatch);
+ AggregationRequest::parseNs("a", inputBSON), AssertionException, ErrorCodes::TypeMismatch);
}
TEST(AggregationRequestTest, ParseNSShouldRejectAggregateOneStringAsCollectionName) {
const BSONObj inputBSON = fromjson("{aggregate: '$cmd.aggregate', pipeline: []}");
- ASSERT_THROWS_CODE(
- AggregationRequest::parseNs("a", inputBSON), UserException, ErrorCodes::InvalidNamespace);
+ ASSERT_THROWS_CODE(AggregationRequest::parseNs("a", inputBSON),
+ AssertionException,
+ ErrorCodes::InvalidNamespace);
}
TEST(AggregationRequestTest, ParseNSShouldRejectInvalidCollectionName) {
const BSONObj inputBSON = fromjson("{aggregate: '', pipeline: []}");
- ASSERT_THROWS_CODE(
- AggregationRequest::parseNs("a", inputBSON), UserException, ErrorCodes::InvalidNamespace);
+ ASSERT_THROWS_CODE(AggregationRequest::parseNs("a", inputBSON),
+ AssertionException,
+ ErrorCodes::InvalidNamespace);
}
TEST(AggregationRequestTest, ParseFromBSONOverloadsShouldProduceIdenticalRequests) {