From 697ba872b78f20004f45f7dbba0280b734abf479 Mon Sep 17 00:00:00 2001 From: Graham Russell Date: Tue, 17 Dec 2024 11:48:41 +0000 Subject: [PATCH] fixup! [INF-5307] - Add the MongoDB Ably Ingress Rule --- .../resource_ably_ingress_rule_mongo_test.go | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/internal/provider/resource_ably_ingress_rule_mongo_test.go b/internal/provider/resource_ably_ingress_rule_mongo_test.go index b94bb5f..c0c9ffd 100644 --- a/internal/provider/resource_ably_ingress_rule_mongo_test.go +++ b/internal/provider/resource_ably_ingress_rule_mongo_test.go @@ -23,11 +23,12 @@ func TestAccAblyIngressRuleMongo(t *testing.T) { Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr("ably_app.app0", "name", app_name), resource.TestCheckResourceAttr("ably_ingress_rule_mongodb.rule0", "status", "enabled"), - // resource.TestCheckResourceAttr("ably_rule_amqp.rule0", "source.channel_filter", "^my-channel.*"), - // resource.TestCheckResourceAttr("ably_rule_amqp.rule0", "source.type", "channel.message"), - // resource.TestCheckResourceAttr("ably_rule_amqp.rule0", "request_mode", "single"), - // resource.TestCheckResourceAttr("ably_rule_amqp.rule0", "target.enveloped", "true"), - // resource.TestCheckResourceAttr("ably_rule_amqp.rule0", "target.format", "json"), + resource.TestCheckResourceAttr("ably_ingress_rule_mongodb.rule", "target.url", "mongodb://coco:nut@coco.io:27017"), + resource.TestCheckResourceAttr("ably_ingress_rule_mongodb.rule", "target.collection", "coconut"), + resource.TestCheckResourceAttr("ably_ingress_rule_mongodb.rule0", "target.database", "coconut"), + resource.TestCheckResourceAttr("ably_ingress_rule_mongodb.rule0", "target.full_document", "off"), + resource.TestCheckResourceAttr("ably_ingress_rule_mongodb.rule0", "target.full_document_before_change", "off"), + resource.TestCheckResourceAttr("ably_ingress_rule_mongodb.rule0", "target.primary_site", "us-east-1-A"), ), }, // Update and Read testing of ably_app.app0 @@ -38,12 +39,13 @@ func TestAccAblyIngressRuleMongo(t *testing.T) { ), Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr("ably_app.app0", "name", update_app_name), - resource.TestCheckResourceAttr("ably_rule_amqp.rule0", "status", "enabled"), - resource.TestCheckResourceAttr("ably_rule_amqp.rule0", "source.channel_filter", "^my-channel.*"), - resource.TestCheckResourceAttr("ably_rule_amqp.rule0", "source.type", "channel.message"), - resource.TestCheckResourceAttr("ably_rule_amqp.rule0", "request_mode", "single"), - resource.TestCheckResourceAttr("ably_rule_amqp.rule0", "target.enveloped", "false"), - resource.TestCheckResourceAttr("ably_rule_amqp.rule0", "target.format", "msgpack"), + resource.TestCheckResourceAttr("ably_ingress_rule_mongodb.rule0", "status", "enabled"), + resource.TestCheckResourceAttr("ably_ingress_rule_mongodb.rule", "target.url", "mongodb://coco:nut@coco.io:27017"), + resource.TestCheckResourceAttr("ably_ingress_rule_mongodb.rule", "target.collection", "coconut"), + resource.TestCheckResourceAttr("ably_ingress_rule_mongodb.rule0", "target.database", "coconut"), + resource.TestCheckResourceAttr("ably_ingress_rule_mongodb.rule0", "target.full_document", "off"), + resource.TestCheckResourceAttr("ably_ingress_rule_mongodb.rule0", "target.full_document_before_change", "off"), + resource.TestCheckResourceAttr("ably_ingress_rule_mongodb.rule0", "target.primary_site", "us-east-1-A"), ), }, // Delete testing automatically occurs in TestCase