summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/aggregation_request_test.cpp
diff options
context:
space:
mode:
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) {