@@ -18,93 +18,93 @@ var configVariables = config.Variables{
18
18
"zone_id" : config .StringVariable (os .Getenv ("CLOUDFLARE_ZONE_ID" )),
19
19
}
20
20
21
- func TestAccCloudflareRuleset_Name (t * testing.T ) {
21
+ func TestAccCloudflareRuleset_Kind (t * testing.T ) {
22
22
resource .Test (t , resource.TestCase {
23
23
PreCheck : func () { acctest .TestAccPreCheck (t ) },
24
24
ProtoV6ProviderFactories : acctest .TestAccProtoV6ProviderFactories ,
25
25
Steps : []resource.TestStep {
26
26
{
27
- ConfigFile : config .TestNameFile ("before .tf" ),
27
+ ConfigFile : config .TestNameFile ("1 .tf" ),
28
28
ConfigVariables : configVariables ,
29
29
ConfigPlanChecks : resource.ConfigPlanChecks {
30
30
PreApply : []plancheck.PlanCheck {
31
31
plancheck .ExpectResourceAction ("cloudflare_ruleset.my_ruleset" , plancheck .ResourceActionCreate ),
32
32
plancheck .ExpectKnownValue (
33
33
"cloudflare_ruleset.my_ruleset" ,
34
- tfjsonpath .New ("name " ),
35
- knownvalue .StringExact ("My ruleset " ),
34
+ tfjsonpath .New ("kind " ),
35
+ knownvalue .StringExact ("root " ),
36
36
),
37
37
},
38
38
},
39
39
ConfigStateChecks : []statecheck.StateCheck {
40
40
statecheck .ExpectKnownValue (
41
41
"cloudflare_ruleset.my_ruleset" ,
42
- tfjsonpath .New ("name " ),
43
- knownvalue .StringExact ("My ruleset " ),
42
+ tfjsonpath .New ("kind " ),
43
+ knownvalue .StringExact ("root " ),
44
44
),
45
45
},
46
46
},
47
47
{
48
- ConfigFile : config .TestNameFile ("after .tf" ),
48
+ ConfigFile : config .TestNameFile ("2 .tf" ),
49
49
ConfigVariables : configVariables ,
50
50
ConfigPlanChecks : resource.ConfigPlanChecks {
51
51
PreApply : []plancheck.PlanCheck {
52
52
plancheck .ExpectResourceAction ("cloudflare_ruleset.my_ruleset" , plancheck .ResourceActionReplace ),
53
53
plancheck .ExpectKnownValue (
54
54
"cloudflare_ruleset.my_ruleset" ,
55
- tfjsonpath .New ("name " ),
56
- knownvalue .StringExact ("My updated ruleset " ),
55
+ tfjsonpath .New ("kind " ),
56
+ knownvalue .StringExact ("custom " ),
57
57
),
58
58
},
59
59
},
60
60
ConfigStateChecks : []statecheck.StateCheck {
61
61
statecheck .ExpectKnownValue (
62
62
"cloudflare_ruleset.my_ruleset" ,
63
- tfjsonpath .New ("name " ),
64
- knownvalue .StringExact ("My updated ruleset " ),
63
+ tfjsonpath .New ("kind " ),
64
+ knownvalue .StringExact ("custom " ),
65
65
),
66
66
},
67
67
},
68
68
},
69
69
})
70
70
}
71
71
72
- func TestAccCloudflareRuleset_Description (t * testing.T ) {
72
+ func TestAccCloudflareRuleset_Name (t * testing.T ) {
73
73
resource .Test (t , resource.TestCase {
74
74
PreCheck : func () { acctest .TestAccPreCheck (t ) },
75
75
ProtoV6ProviderFactories : acctest .TestAccProtoV6ProviderFactories ,
76
76
Steps : []resource.TestStep {
77
77
{
78
- ConfigFile : config .TestNameFile ("before .tf" ),
78
+ ConfigFile : config .TestNameFile ("1 .tf" ),
79
79
ConfigVariables : configVariables ,
80
80
ConfigPlanChecks : resource.ConfigPlanChecks {
81
81
PreApply : []plancheck.PlanCheck {
82
82
plancheck .ExpectResourceAction ("cloudflare_ruleset.my_ruleset" , plancheck .ResourceActionCreate ),
83
83
plancheck .ExpectKnownValue (
84
84
"cloudflare_ruleset.my_ruleset" ,
85
- tfjsonpath .New ("description " ),
86
- knownvalue .StringExact ("My ruleset description " ),
85
+ tfjsonpath .New ("name " ),
86
+ knownvalue .StringExact ("My ruleset" ),
87
87
),
88
88
},
89
89
},
90
90
ConfigStateChecks : []statecheck.StateCheck {
91
91
statecheck .ExpectKnownValue (
92
92
"cloudflare_ruleset.my_ruleset" ,
93
- tfjsonpath .New ("description " ),
94
- knownvalue .StringExact ("My ruleset description " ),
93
+ tfjsonpath .New ("name " ),
94
+ knownvalue .StringExact ("My ruleset" ),
95
95
),
96
96
},
97
97
},
98
98
{
99
- ConfigFile : config .TestNameFile ("after .tf" ),
99
+ ConfigFile : config .TestNameFile ("2 .tf" ),
100
100
ConfigVariables : configVariables ,
101
101
ConfigPlanChecks : resource.ConfigPlanChecks {
102
102
PreApply : []plancheck.PlanCheck {
103
- plancheck .ExpectResourceAction ("cloudflare_ruleset.my_ruleset" , plancheck .ResourceActionUpdate ),
103
+ plancheck .ExpectResourceAction ("cloudflare_ruleset.my_ruleset" , plancheck .ResourceActionReplace ),
104
104
plancheck .ExpectKnownValue (
105
105
"cloudflare_ruleset.my_ruleset" ,
106
106
tfjsonpath .New ("name" ),
107
- knownvalue .StringExact ("My updated ruleset description " ),
107
+ knownvalue .StringExact ("My updated ruleset" ),
108
108
),
109
109
},
110
110
},
@@ -126,7 +126,7 @@ func TestAccCloudflareRuleset_Phase(t *testing.T) {
126
126
ProtoV6ProviderFactories : acctest .TestAccProtoV6ProviderFactories ,
127
127
Steps : []resource.TestStep {
128
128
{
129
- ConfigFile : config .TestNameFile ("before .tf" ),
129
+ ConfigFile : config .TestNameFile ("1 .tf" ),
130
130
ConfigVariables : configVariables ,
131
131
ConfigPlanChecks : resource.ConfigPlanChecks {
132
132
PreApply : []plancheck.PlanCheck {
@@ -147,7 +147,7 @@ func TestAccCloudflareRuleset_Phase(t *testing.T) {
147
147
},
148
148
},
149
149
{
150
- ConfigFile : config .TestNameFile ("after .tf" ),
150
+ ConfigFile : config .TestNameFile ("2 .tf" ),
151
151
ConfigVariables : configVariables ,
152
152
ConfigPlanChecks : resource.ConfigPlanChecks {
153
153
PreApply : []plancheck.PlanCheck {
@@ -171,64 +171,64 @@ func TestAccCloudflareRuleset_Phase(t *testing.T) {
171
171
})
172
172
}
173
173
174
- func TestAccCloudflareRuleset_Kind (t * testing.T ) {
174
+ func TestAccCloudflareRuleset_Description (t * testing.T ) {
175
175
resource .Test (t , resource.TestCase {
176
176
PreCheck : func () { acctest .TestAccPreCheck (t ) },
177
177
ProtoV6ProviderFactories : acctest .TestAccProtoV6ProviderFactories ,
178
178
Steps : []resource.TestStep {
179
179
{
180
- ConfigFile : config .TestNameFile ("before .tf" ),
180
+ ConfigFile : config .TestNameFile ("1 .tf" ),
181
181
ConfigVariables : configVariables ,
182
182
ConfigPlanChecks : resource.ConfigPlanChecks {
183
183
PreApply : []plancheck.PlanCheck {
184
184
plancheck .ExpectResourceAction ("cloudflare_ruleset.my_ruleset" , plancheck .ResourceActionCreate ),
185
185
plancheck .ExpectKnownValue (
186
186
"cloudflare_ruleset.my_ruleset" ,
187
- tfjsonpath .New ("kind " ),
188
- knownvalue .StringExact ("root " ),
187
+ tfjsonpath .New ("description " ),
188
+ knownvalue .StringExact ("My ruleset description " ),
189
189
),
190
190
},
191
191
},
192
192
ConfigStateChecks : []statecheck.StateCheck {
193
193
statecheck .ExpectKnownValue (
194
194
"cloudflare_ruleset.my_ruleset" ,
195
- tfjsonpath .New ("kind " ),
196
- knownvalue .StringExact ("root " ),
195
+ tfjsonpath .New ("description " ),
196
+ knownvalue .StringExact ("My ruleset description " ),
197
197
),
198
198
},
199
199
},
200
200
{
201
- ConfigFile : config .TestNameFile ("after .tf" ),
201
+ ConfigFile : config .TestNameFile ("2 .tf" ),
202
202
ConfigVariables : configVariables ,
203
203
ConfigPlanChecks : resource.ConfigPlanChecks {
204
204
PreApply : []plancheck.PlanCheck {
205
- plancheck .ExpectResourceAction ("cloudflare_ruleset.my_ruleset" , plancheck .ResourceActionReplace ),
205
+ plancheck .ExpectResourceAction ("cloudflare_ruleset.my_ruleset" , plancheck .ResourceActionUpdate ),
206
206
plancheck .ExpectKnownValue (
207
207
"cloudflare_ruleset.my_ruleset" ,
208
- tfjsonpath .New ("kind " ),
209
- knownvalue .StringExact ("custom " ),
208
+ tfjsonpath .New ("name " ),
209
+ knownvalue .StringExact ("My updated ruleset description " ),
210
210
),
211
211
},
212
212
},
213
213
ConfigStateChecks : []statecheck.StateCheck {
214
214
statecheck .ExpectKnownValue (
215
215
"cloudflare_ruleset.my_ruleset" ,
216
- tfjsonpath .New ("kind " ),
217
- knownvalue .StringExact ("custom " ),
216
+ tfjsonpath .New ("name " ),
217
+ knownvalue .StringExact ("My updated ruleset " ),
218
218
),
219
219
},
220
220
},
221
221
},
222
222
})
223
223
}
224
224
225
- func TestAccCloudflareRuleset_RuleLogging (t * testing.T ) {
225
+ func TestAccCloudflareRuleset_RulesLogging (t * testing.T ) {
226
226
resource .Test (t , resource.TestCase {
227
227
PreCheck : func () { acctest .TestAccPreCheck (t ) },
228
228
ProtoV6ProviderFactories : acctest .TestAccProtoV6ProviderFactories ,
229
229
Steps : []resource.TestStep {
230
230
{
231
- ConfigFile : config .TestNameFile ("omitted .tf" ),
231
+ ConfigFile : config .TestNameFile ("1 .tf" ),
232
232
ConfigVariables : configVariables ,
233
233
ConfigPlanChecks : resource.ConfigPlanChecks {
234
234
PreApply : []plancheck.PlanCheck {
@@ -261,7 +261,7 @@ func TestAccCloudflareRuleset_RuleLogging(t *testing.T) {
261
261
},
262
262
},
263
263
{
264
- ConfigFile : config .TestNameFile ("enabled .tf" ),
264
+ ConfigFile : config .TestNameFile ("2 .tf" ),
265
265
ConfigVariables : configVariables ,
266
266
ConfigPlanChecks : resource.ConfigPlanChecks {
267
267
PreApply : []plancheck.PlanCheck {
@@ -283,7 +283,7 @@ func TestAccCloudflareRuleset_RuleLogging(t *testing.T) {
283
283
},
284
284
},
285
285
{
286
- ConfigFile : config .TestNameFile ("disabled .tf" ),
286
+ ConfigFile : config .TestNameFile ("3 .tf" ),
287
287
ConfigVariables : configVariables ,
288
288
ConfigPlanChecks : resource.ConfigPlanChecks {
289
289
PreApply : []plancheck.PlanCheck {
@@ -325,7 +325,7 @@ func TestAccCloudflareRuleset_RuleLogging(t *testing.T) {
325
325
ProtoV6ProviderFactories : acctest .TestAccProtoV6ProviderFactories ,
326
326
Steps : []resource.TestStep {
327
327
{
328
- ConfigFile : config .TestNameFile ("before .tf" ),
328
+ ConfigFile : config .TestNameFile ("1 .tf" ),
329
329
ConfigVariables : configVariables ,
330
330
ConfigPlanChecks : resource.ConfigPlanChecks {
331
331
PreApply : []plancheck.PlanCheck {
@@ -368,7 +368,7 @@ func TestAccCloudflareRuleset_RuleLogging(t *testing.T) {
368
368
},
369
369
},
370
370
{
371
- ConfigFile : config .TestNameFile ("after .tf" ),
371
+ ConfigFile : config .TestNameFile ("2 .tf" ),
372
372
ConfigVariables : configVariables ,
373
373
ConfigPlanChecks : resource.ConfigPlanChecks {
374
374
PreApply : []plancheck.PlanCheck {
@@ -415,7 +415,7 @@ func TestAccCloudflareRuleset_RuleLogging(t *testing.T) {
415
415
ProtoV6ProviderFactories : acctest .TestAccProtoV6ProviderFactories ,
416
416
Steps : []resource.TestStep {
417
417
{
418
- ConfigFile : config .TestNameFile ("before .tf" ),
418
+ ConfigFile : config .TestNameFile ("1 .tf" ),
419
419
ConfigVariables : configVariables ,
420
420
ConfigPlanChecks : resource.ConfigPlanChecks {
421
421
PreApply : []plancheck.PlanCheck {
@@ -458,7 +458,7 @@ func TestAccCloudflareRuleset_RuleLogging(t *testing.T) {
458
458
},
459
459
},
460
460
{
461
- ConfigFile : config .TestNameFile ("after .tf" ),
461
+ ConfigFile : config .TestNameFile ("2 .tf" ),
462
462
ConfigVariables : configVariables ,
463
463
ConfigPlanChecks : resource.ConfigPlanChecks {
464
464
PreApply : []plancheck.PlanCheck {
@@ -506,7 +506,7 @@ func TestAccCloudflareRuleset_RuleLogging(t *testing.T) {
506
506
ProtoV6ProviderFactories : acctest .TestAccProtoV6ProviderFactories ,
507
507
Steps : []resource.TestStep {
508
508
{
509
- ConfigFile : config .TestNameFile ("before .tf" ),
509
+ ConfigFile : config .TestNameFile ("1 .tf" ),
510
510
ConfigVariables : configVariables ,
511
511
ConfigPlanChecks : resource.ConfigPlanChecks {
512
512
PreApply : []plancheck.PlanCheck {
@@ -549,7 +549,7 @@ func TestAccCloudflareRuleset_RuleLogging(t *testing.T) {
549
549
},
550
550
},
551
551
{
552
- ConfigFile : config .TestNameFile ("after .tf" ),
552
+ ConfigFile : config .TestNameFile ("2 .tf" ),
553
553
ConfigVariables : configVariables ,
554
554
ConfigPlanChecks : resource.ConfigPlanChecks {
555
555
PreApply : []plancheck.PlanCheck {
@@ -597,14 +597,14 @@ func TestAccCloudflareRuleset_RuleLogging(t *testing.T) {
597
597
})
598
598
}
599
599
600
- func TestAccCloudflareRuleset_RuleRef (t * testing.T ) {
600
+ func TestAccCloudflareRuleset_RulesRef (t * testing.T ) {
601
601
t .Run ("add" , func (t * testing.T ) {
602
602
resource .Test (t , resource.TestCase {
603
603
PreCheck : func () { acctest .TestAccPreCheck (t ) },
604
604
ProtoV6ProviderFactories : acctest .TestAccProtoV6ProviderFactories ,
605
605
Steps : []resource.TestStep {
606
606
{
607
- ConfigFile : config .TestNameFile ("before .tf" ),
607
+ ConfigFile : config .TestNameFile ("1 .tf" ),
608
608
ConfigVariables : configVariables ,
609
609
ConfigPlanChecks : resource.ConfigPlanChecks {
610
610
PreApply : []plancheck.PlanCheck {
@@ -651,7 +651,7 @@ func TestAccCloudflareRuleset_RuleRef(t *testing.T) {
651
651
},
652
652
},
653
653
{
654
- ConfigFile : config .TestNameFile ("after .tf" ),
654
+ ConfigFile : config .TestNameFile ("2 .tf" ),
655
655
ConfigVariables : configVariables ,
656
656
ConfigPlanChecks : resource.ConfigPlanChecks {
657
657
PreApply : []plancheck.PlanCheck {
@@ -693,7 +693,7 @@ func TestAccCloudflareRuleset_RuleRef(t *testing.T) {
693
693
ProtoV6ProviderFactories : acctest .TestAccProtoV6ProviderFactories ,
694
694
Steps : []resource.TestStep {
695
695
{
696
- ConfigFile : config .TestNameFile ("before .tf" ),
696
+ ConfigFile : config .TestNameFile ("1 .tf" ),
697
697
ConfigVariables : configVariables ,
698
698
ConfigPlanChecks : resource.ConfigPlanChecks {
699
699
PreApply : []plancheck.PlanCheck {
@@ -740,7 +740,7 @@ func TestAccCloudflareRuleset_RuleRef(t *testing.T) {
740
740
},
741
741
},
742
742
{
743
- ConfigFile : config .TestNameFile ("after .tf" ),
743
+ ConfigFile : config .TestNameFile ("2 .tf" ),
744
744
ConfigVariables : configVariables ,
745
745
ConfigPlanChecks : resource.ConfigPlanChecks {
746
746
PreApply : []plancheck.PlanCheck {
@@ -782,7 +782,7 @@ func TestAccCloudflareRuleset_RuleRef(t *testing.T) {
782
782
ProtoV6ProviderFactories : acctest .TestAccProtoV6ProviderFactories ,
783
783
Steps : []resource.TestStep {
784
784
{
785
- ConfigFile : config .TestNameFile ("before .tf" ),
785
+ ConfigFile : config .TestNameFile ("1 .tf" ),
786
786
ConfigVariables : configVariables ,
787
787
ConfigPlanChecks : resource.ConfigPlanChecks {
788
788
PreApply : []plancheck.PlanCheck {
@@ -829,7 +829,7 @@ func TestAccCloudflareRuleset_RuleRef(t *testing.T) {
829
829
},
830
830
},
831
831
{
832
- ConfigFile : config .TestNameFile ("after .tf" ),
832
+ ConfigFile : config .TestNameFile ("2 .tf" ),
833
833
ConfigVariables : configVariables ,
834
834
ConfigPlanChecks : resource.ConfigPlanChecks {
835
835
PreApply : []plancheck.PlanCheck {
@@ -863,7 +863,7 @@ func TestAccCloudflareRuleset_RuleRef(t *testing.T) {
863
863
ProtoV6ProviderFactories : acctest .TestAccProtoV6ProviderFactories ,
864
864
Steps : []resource.TestStep {
865
865
{
866
- ConfigFile : config .TestNameFile ("before .tf" ),
866
+ ConfigFile : config .TestNameFile ("1 .tf" ),
867
867
ConfigVariables : configVariables ,
868
868
ConfigPlanChecks : resource.ConfigPlanChecks {
869
869
PreApply : []plancheck.PlanCheck {
@@ -910,7 +910,7 @@ func TestAccCloudflareRuleset_RuleRef(t *testing.T) {
910
910
},
911
911
},
912
912
{
913
- ConfigFile : config .TestNameFile ("after .tf" ),
913
+ ConfigFile : config .TestNameFile ("2 .tf" ),
914
914
ConfigVariables : configVariables ,
915
915
ConfigPlanChecks : resource.ConfigPlanChecks {
916
916
PreApply : []plancheck.PlanCheck {
@@ -939,7 +939,7 @@ func TestAccCloudflareRuleset_RuleRef(t *testing.T) {
939
939
ProtoV6ProviderFactories : acctest .TestAccProtoV6ProviderFactories ,
940
940
Steps : []resource.TestStep {
941
941
{
942
- ConfigFile : config .TestNameFile ("before .tf" ),
942
+ ConfigFile : config .TestNameFile ("1 .tf" ),
943
943
ConfigVariables : configVariables ,
944
944
ConfigPlanChecks : resource.ConfigPlanChecks {
945
945
PreApply : []plancheck.PlanCheck {
@@ -986,7 +986,7 @@ func TestAccCloudflareRuleset_RuleRef(t *testing.T) {
986
986
},
987
987
},
988
988
{
989
- ConfigFile : config .TestNameFile ("after .tf" ),
989
+ ConfigFile : config .TestNameFile ("2 .tf" ),
990
990
ConfigVariables : configVariables ,
991
991
ConfigPlanChecks : resource.ConfigPlanChecks {
992
992
PreApply : []plancheck.PlanCheck {
@@ -1020,7 +1020,7 @@ func TestAccCloudflareRuleset_RuleRef(t *testing.T) {
1020
1020
ProtoV6ProviderFactories : acctest .TestAccProtoV6ProviderFactories ,
1021
1021
Steps : []resource.TestStep {
1022
1022
{
1023
- ConfigFile : config .TestNameFile ("before .tf" ),
1023
+ ConfigFile : config .TestNameFile ("1 .tf" ),
1024
1024
ConfigVariables : configVariables ,
1025
1025
ConfigPlanChecks : resource.ConfigPlanChecks {
1026
1026
PreApply : []plancheck.PlanCheck {
@@ -1067,7 +1067,7 @@ func TestAccCloudflareRuleset_RuleRef(t *testing.T) {
1067
1067
},
1068
1068
},
1069
1069
{
1070
- ConfigFile : config .TestNameFile ("after .tf" ),
1070
+ ConfigFile : config .TestNameFile ("2 .tf" ),
1071
1071
ConfigVariables : configVariables ,
1072
1072
ConfigPlanChecks : resource.ConfigPlanChecks {
1073
1073
PreApply : []plancheck.PlanCheck {
0 commit comments