-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Upgrades
privatelink_endpoint_serverless
resource to auto-ge…
…nerated SDK (#1908) * rename methods * migrate to new SDK * add migration test * fix evalOrder: may want to evaluate p.GetStatus() before the return statement * add privatelink endpoint serverless to migration tests change detection * typo * remove to avoid conflicts * change mig test name to match regex * test mig * Revert "test mig" This reverts commit 47c9019. * re-add comment for 404/400 case * rename mig test
- Loading branch information
Showing
3 changed files
with
102 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
.../privatelinkendpointserverless/resource_privatelink_endpoint_serverless_migration_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package privatelinkendpointserverless_test | ||
|
||
import ( | ||
"os" | ||
"testing" | ||
|
||
"github.com/hashicorp/terraform-plugin-testing/helper/acctest" | ||
"github.com/hashicorp/terraform-plugin-testing/helper/resource" | ||
"github.com/hashicorp/terraform-plugin-testing/plancheck" | ||
"github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" | ||
"github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/mig" | ||
) | ||
|
||
func TestAccMigrationServerlessPrivateLinkEndpoint_basic(t *testing.T) { | ||
var ( | ||
resourceName = "mongodbatlas_privatelink_endpoint_serverless.test" | ||
orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") | ||
projectName = acctest.RandomWithPrefix("test-acc-serverless") | ||
instanceName = "serverlessplink" | ||
) | ||
|
||
resource.Test(t, resource.TestCase{ | ||
PreCheck: func() { mig.PreCheckBasic(t) }, | ||
CheckDestroy: checkDestroy, | ||
Steps: []resource.TestStep{ | ||
{ | ||
ExternalProviders: mig.ExternalProviders(), | ||
Config: configBasic(orgID, projectName, instanceName, true), | ||
Check: resource.ComposeTestCheckFunc( | ||
checkExists(resourceName), | ||
resource.TestCheckResourceAttr(resourceName, "instance_name", instanceName), | ||
), | ||
}, | ||
{ | ||
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories, | ||
Config: configBasic(orgID, projectName, instanceName, true), | ||
ConfigPlanChecks: resource.ConfigPlanChecks{ | ||
PreApply: []plancheck.PlanCheck{ | ||
acc.DebugPlan(), | ||
plancheck.ExpectEmptyPlan(), | ||
}, | ||
}, | ||
}, | ||
}, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters