Skip to content

Commit a025a20

Browse files
authored
Fix google_apigee_developer_app: do not delete credentials block in decoder (#15440)
1 parent 4d721b1 commit a025a20

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

mmv1/templates/terraform/decoders/apigee_developer_app.go.tmpl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ if obj, ok := res["credentials"]; ok {
3333
res["apiProducts"] = flattenedProducts
3434
}
3535
}
36-
37-
delete(res, "credentials")
3836
} else {
3937
return nil, fmt.Errorf("Unable to decode the first element of the credentials array.")
4038
}

mmv1/third_party/terraform/services/apigee/resource_apigee_developer_app_update_test.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import (
1212
func TestAccApigeeDeveloperApp_apigeeDeveloperAppUpdateTest(t *testing.T) {
1313
t.Parallel()
1414

15+
resourceName := "google_apigee_developer_app.apigee_developer_app"
16+
1517
context := map[string]interface{}{
1618
"billing_account": envvar.GetTestBillingAccountFromEnv(t),
1719
"org_id": envvar.GetTestOrgFromEnv(t),
@@ -28,18 +30,26 @@ func TestAccApigeeDeveloperApp_apigeeDeveloperAppUpdateTest(t *testing.T) {
2830
Steps: []resource.TestStep{
2931
{
3032
Config: testAccApigeeDeveloperApp_apigeeDeveloperAppBasicTest(context),
33+
Check: resource.ComposeTestCheckFunc(
34+
resource.TestCheckResourceAttrSet(resourceName, "credentials.0.consumer_key"),
35+
resource.TestCheckResourceAttrSet(resourceName, "credentials.0.consumer_secret"),
36+
),
3137
},
3238
{
33-
ResourceName: "google_apigee_developer_app.apigee_developer_app",
39+
ResourceName: resourceName,
3440
ImportState: true,
3541
ImportStateVerify: true,
3642
ImportStateVerifyIgnore: []string{"org_id"},
3743
},
3844
{
3945
Config: testAccApigeeDeveloperApp_apigeeDeveloperAppUpdateTest(context),
46+
Check: resource.ComposeTestCheckFunc(
47+
resource.TestCheckResourceAttrSet(resourceName, "credentials.0.consumer_key"),
48+
resource.TestCheckResourceAttrSet(resourceName, "credentials.0.consumer_secret"),
49+
),
4050
},
4151
{
42-
ResourceName: "google_apigee_developer_app.apigee_developer_app",
52+
ResourceName: resourceName,
4353
ImportState: true,
4454
ImportStateVerify: true,
4555
ImportStateVerifyIgnore: []string{"org_id"},

0 commit comments

Comments
 (0)