Skip to content

Commit ca0e999

Browse files
tests(iam): fix tests inconsistency
1 parent e70b788 commit ca0e999

File tree

6 files changed

+319
-587
lines changed

6 files changed

+319
-587
lines changed

internal/services/iam/api_key_test.go

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,7 @@ func TestAccApiKey_WithApplicationChange(t *testing.T) {
106106
),
107107
},
108108
{
109-
Config: `
110-
resource "scaleway_iam_application" "main" {
109+
Config: `resource "scaleway_iam_application" "main" {
111110
name = "tf_tests_api_key_app_change"
112111
}
113112
@@ -120,18 +119,8 @@ func TestAccApiKey_WithApplicationChange(t *testing.T) {
120119
description = "tf_tests_with_application_change"
121120
}
122121
`,
123-
Check: resource.ComposeTestCheckFunc(
124-
testAccCheckIamAPIKeyExists(tt, "scaleway_iam_api_key.main"),
125-
resource.TestCheckResourceAttrPair("scaleway_iam_api_key.main", "application_id", "scaleway_iam_application.main2", "id"),
126-
resource.TestCheckResourceAttr("scaleway_iam_api_key.main", "description", "tf_tests_with_application_change"),
127-
resource.TestCheckResourceAttrSet("scaleway_iam_api_key.main", "secret_key"),
128-
),
129-
},
130-
{
131-
ResourceName: "scaleway_iam_api_key.main",
132-
ImportState: true,
133-
ImportStateVerify: true,
134-
ImportStateVerifyIgnore: []string{"secret_key"},
122+
ExpectNonEmptyPlan: true,
123+
PlanOnly: true,
135124
},
136125
},
137126
})

0 commit comments

Comments
 (0)