Skip to content

Commit aa0860a

Browse files
committed
iot: Replace 'PlanOnly' acceptance test steps with 'plancheck's.
1 parent bd6c474 commit aa0860a

File tree

2 files changed

+32
-3
lines changed

2 files changed

+32
-3
lines changed

internal/service/inspector2/enabler_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,6 @@ func testAccEnabler_memberAccount_updateMemberAccountsAndScanTypes(t *testing.T)
524524
resource.TestCheckResourceAttr(resourceName, "resource_types.#", "1"),
525525
resource.TestCheckTypeSetElemAttr(resourceName, "resource_types.*", string(types.ResourceScanTypeLambda)),
526526
),
527-
// PlanOnly: true,
528527
},
529528
},
530529
})

internal/service/iot/billing_group_test.go

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"github.com/YakDriver/regexache"
1212
sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest"
1313
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
14+
"github.com/hashicorp/terraform-plugin-testing/plancheck"
1415
"github.com/hashicorp/terraform-plugin-testing/terraform"
1516
"github.com/hashicorp/terraform-provider-aws/internal/acctest"
1617
"github.com/hashicorp/terraform-provider-aws/internal/conns"
@@ -186,11 +187,23 @@ func TestAccIoTBillingGroup_migrateFromPluginSDK(t *testing.T) {
186187
resource.TestCheckResourceAttr(resourceName, acctest.CtTagsPercent, "0"),
187188
resource.TestCheckResourceAttr(resourceName, names.AttrVersion, "1"),
188189
),
190+
ConfigPlanChecks: resource.ConfigPlanChecks{
191+
PreApply: []plancheck.PlanCheck{
192+
plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate),
193+
},
194+
},
189195
},
190196
{
191197
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
192198
Config: testAccBillingGroupConfig_basic(rName),
193-
PlanOnly: true,
199+
ConfigPlanChecks: resource.ConfigPlanChecks{
200+
PreApply: []plancheck.PlanCheck{
201+
plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop),
202+
},
203+
PostApplyPostRefresh: []plancheck.PlanCheck{
204+
plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop),
205+
},
206+
},
194207
},
195208
},
196209
})
@@ -217,11 +230,23 @@ func TestAccIoTBillingGroup_migrateFromPluginSDK_properties(t *testing.T) {
217230
Check: resource.ComposeAggregateTestCheckFunc(
218231
testAccCheckBillingGroupExists(ctx, resourceName),
219232
),
233+
ConfigPlanChecks: resource.ConfigPlanChecks{
234+
PreApply: []plancheck.PlanCheck{
235+
plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate),
236+
},
237+
},
220238
},
221239
{
222240
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
223241
Config: testAccBillingGroupConfig_properties(rName),
224-
PlanOnly: true,
242+
ConfigPlanChecks: resource.ConfigPlanChecks{
243+
PreApply: []plancheck.PlanCheck{
244+
plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop),
245+
},
246+
PostApplyPostRefresh: []plancheck.PlanCheck{
247+
plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionNoop),
248+
},
249+
},
225250
},
226251
{
227252
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
@@ -232,6 +257,11 @@ func TestAccIoTBillingGroup_migrateFromPluginSDK_properties(t *testing.T) {
232257
resource.TestCheckResourceAttr(resourceName, "properties.0.description", "test description 2"),
233258
resource.TestCheckResourceAttr(resourceName, names.AttrVersion, "2"),
234259
),
260+
ConfigPlanChecks: resource.ConfigPlanChecks{
261+
PreApply: []plancheck.PlanCheck{
262+
plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate),
263+
},
264+
},
235265
},
236266
},
237267
})

0 commit comments

Comments
 (0)