Skip to content

Commit

Permalink
test: modified test for gcp where you can make update
Browse files Browse the repository at this point in the history
  • Loading branch information
Edgar López committed Apr 29, 2020
1 parent 49f2ed1 commit 83799b6
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions mongodbatlas/resource_mongodbatlas_encryption_at_rest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ func TestAccResourceMongoDBAtlasEncryptionAtRest_basicGCP(t *testing.T) {
ServiceAccountKey: os.Getenv("GCP_SERVICE_ACCOUNT_KEY"),
KeyVersionResourceID: os.Getenv("GCP_KEY_VERSION_RESOURCE_ID"),
}
googleCloudKmsUpdated := matlas.GoogleCloudKms{
Enabled: pointy.Bool(true),
ServiceAccountKey: os.Getenv("GCP_SERVICE_ACCOUNT_KEY_UPDATED"),
KeyVersionResourceID: os.Getenv("GCP_KEY_VERSION_RESOURCE_ID_UPDATED"),
}

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckGPCEnv(t) },
Expand All @@ -160,6 +165,16 @@ func TestAccResourceMongoDBAtlasEncryptionAtRest_basicGCP(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "google_cloud_kms.key_version_resource_id", googleCloudKms.KeyVersionResourceID),
),
},
{
Config: testAccMongoDBAtlasEncryptionAtRestConfigGoogleCloudKms(projectID, &googleCloudKmsUpdated),
Check: resource.ComposeTestCheckFunc(
testAccCheckMongoDBAtlasEncryptionAtRestExists(resourceName),
resource.TestCheckResourceAttr(resourceName, "project_id", projectID),
resource.TestCheckResourceAttr(resourceName, "google_cloud_kms.enabled", cast.ToString(googleCloudKmsUpdated.Enabled)),
resource.TestCheckResourceAttr(resourceName, "google_cloud_kms.service_account_key", googleCloudKmsUpdated.ServiceAccountKey),
resource.TestCheckResourceAttr(resourceName, "google_cloud_kms.key_version_resource_id", googleCloudKmsUpdated.KeyVersionResourceID),
),
},
},
})
}
Expand Down

0 comments on commit 83799b6

Please sign in to comment.