@@ -22,12 +22,12 @@ func TestAccConfigDSAlertConfiguration_basic(t *testing.T) {
22
22
resource .ParallelTest (t , resource.TestCase {
23
23
PreCheck : func () { acc .PreCheckBasic (t ) },
24
24
ProtoV6ProviderFactories : acc .TestAccProviderV6Factories ,
25
- CheckDestroy : testAccCheckMongoDBAtlasAlertConfigurationDestroy ,
25
+ CheckDestroy : checkDestroy ,
26
26
Steps : []resource.TestStep {
27
27
{
28
- Config : testAccDSMongoDBAtlasAlertConfiguration (orgID , projectName ),
28
+ Config : configBasicDS (orgID , projectName ),
29
29
Check : resource .ComposeTestCheckFunc (
30
- testAccCheckMongoDBAtlasAlertConfigurationExists (dataSourceName , alert ),
30
+ checkExists (dataSourceName , alert ),
31
31
resource .TestCheckResourceAttrSet (dataSourceName , "project_id" ),
32
32
resource .TestCheckResourceAttr (dataSourceName , "notification.#" , "1" ),
33
33
resource .TestCheckResourceAttrSet (dataSourceName , "notification.0.notifier_id" ),
@@ -51,12 +51,12 @@ func TestAccConfigDSAlertConfiguration_withThreshold(t *testing.T) {
51
51
resource .ParallelTest (t , resource.TestCase {
52
52
PreCheck : func () { acc .PreCheckBasic (t ) },
53
53
ProtoV6ProviderFactories : acc .TestAccProviderV6Factories ,
54
- CheckDestroy : testAccCheckMongoDBAtlasAlertConfigurationDestroy ,
54
+ CheckDestroy : checkDestroy ,
55
55
Steps : []resource.TestStep {
56
56
{
57
- Config : testAccDSMongoDBAtlasAlertConfigurationConfigWithThreshold (orgID , projectName , true , 1 ),
57
+ Config : configWithThreshold (orgID , projectName , true , 1 ),
58
58
Check : resource .ComposeTestCheckFunc (
59
- testAccCheckMongoDBAtlasAlertConfigurationExists (dataSourceName , alert ),
59
+ checkExists (dataSourceName , alert ),
60
60
resource .TestCheckResourceAttrSet (dataSourceName , "project_id" ),
61
61
resource .TestCheckResourceAttrSet (dataSourceName , "project_id" ),
62
62
resource .TestCheckResourceAttr (dataSourceName , "notification.#" , "1" ),
@@ -81,12 +81,12 @@ func TestAccConfigDSAlertConfiguration_withOutput(t *testing.T) {
81
81
resource .ParallelTest (t , resource.TestCase {
82
82
PreCheck : func () { acc .PreCheckBasic (t ) },
83
83
ProtoV6ProviderFactories : acc .TestAccProviderV6Factories ,
84
- CheckDestroy : testAccCheckMongoDBAtlasAlertConfigurationDestroy ,
84
+ CheckDestroy : checkDestroy ,
85
85
Steps : []resource.TestStep {
86
86
{
87
- Config : testAccDSMongoDBAtlasAlertConfigurationWithOutputs (orgID , projectName , outputLabel ),
87
+ Config : configWithOutputs (orgID , projectName , outputLabel ),
88
88
Check : resource .ComposeTestCheckFunc (
89
- testAccCheckMongoDBAtlasAlertConfigurationExists (dataSourceName , alert ),
89
+ checkExists (dataSourceName , alert ),
90
90
resource .TestCheckResourceAttrSet (dataSourceName , "project_id" ),
91
91
resource .TestCheckResourceAttrSet (dataSourceName , "project_id" ),
92
92
resource .TestCheckResourceAttr (dataSourceName , "notification.#" , "1" ),
@@ -114,20 +114,20 @@ func TestAccConfigDSAlertConfiguration_withPagerDuty(t *testing.T) {
114
114
resource .Test (t , resource.TestCase {
115
115
PreCheck : func () { acc .PreCheckBasic (t ) },
116
116
ProtoV6ProviderFactories : acc .TestAccProviderV6Factories ,
117
- CheckDestroy : testAccCheckMongoDBAtlasAlertConfigurationDestroy ,
117
+ CheckDestroy : checkDestroy ,
118
118
Steps : []resource.TestStep {
119
119
{
120
- Config : testAccDSMongoDBAtlasAlertConfigurationConfigWithPagerDuty (orgID , projectName , serviceKey , true ),
120
+ Config : configWithPagerDutyDS (orgID , projectName , serviceKey , true ),
121
121
Check : resource .ComposeTestCheckFunc (
122
- testAccCheckMongoDBAtlasAlertConfigurationExists (dataSourceName , alert ),
122
+ checkExists (dataSourceName , alert ),
123
123
resource .TestCheckResourceAttrSet (dataSourceName , "project_id" ),
124
124
),
125
125
},
126
126
},
127
127
})
128
128
}
129
129
130
- func testAccDSMongoDBAtlasAlertConfiguration (orgID , projectName string ) string {
130
+ func configBasicDS (orgID , projectName string ) string {
131
131
return fmt .Sprintf (`
132
132
resource "mongodbatlas_project" "test" {
133
133
name = %[2]q
@@ -168,7 +168,7 @@ func testAccDSMongoDBAtlasAlertConfiguration(orgID, projectName string) string {
168
168
` , orgID , projectName )
169
169
}
170
170
171
- func testAccDSMongoDBAtlasAlertConfigurationConfigWithThreshold (orgID , projectName string , enabled bool , threshold float64 ) string {
171
+ func configWithThreshold (orgID , projectName string , enabled bool , threshold float64 ) string {
172
172
return fmt .Sprintf (`
173
173
resource "mongodbatlas_project" "test" {
174
174
name = %[2]q
@@ -208,7 +208,7 @@ func testAccDSMongoDBAtlasAlertConfigurationConfigWithThreshold(orgID, projectNa
208
208
` , orgID , projectName , enabled , threshold )
209
209
}
210
210
211
- func testAccDSMongoDBAtlasAlertConfigurationWithOutputs (orgID , projectName , outputLabel string ) string {
211
+ func configWithOutputs (orgID , projectName , outputLabel string ) string {
212
212
return fmt .Sprintf (`
213
213
resource "mongodbatlas_project" "test" {
214
214
name = %[2]q
@@ -246,7 +246,7 @@ func testAccDSMongoDBAtlasAlertConfigurationWithOutputs(orgID, projectName, outp
246
246
` , orgID , projectName , outputLabel )
247
247
}
248
248
249
- func testAccDSMongoDBAtlasAlertConfigurationConfigWithPagerDuty (orgID , projectName , serviceKey string , enabled bool ) string {
249
+ func configWithPagerDutyDS (orgID , projectName , serviceKey string , enabled bool ) string {
250
250
return fmt .Sprintf (`
251
251
resource "mongodbatlas_project" "test" {
252
252
name = %[2]q
0 commit comments