@@ -10,7 +10,9 @@ import (
10
10
11
11
"github.com/hashicorp/terraform-plugin-testing/helper/acctest"
12
12
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
13
+ "github.com/hashicorp/terraform-plugin-testing/plancheck"
13
14
"github.com/hashicorp/terraform-plugin-testing/terraform"
15
+ "github.com/mongodb/terraform-provider-mongodbatlas/mongodbatlas/testutils"
14
16
"github.com/mwielbut/pointy"
15
17
matlas "go.mongodb.org/atlas/mongodbatlas"
16
18
)
@@ -1410,6 +1412,49 @@ func TestAccClusterRSCluster_basicAWS_PausedToUnpaused(t *testing.T) {
1410
1412
})
1411
1413
}
1412
1414
1415
+ func TestAccClusterRSCluster_withDefaultBiConnectorAndAdvancedConfiguration_maintainsBackwardCompatibility (t * testing.T ) {
1416
+ var (
1417
+ cluster matlas.Cluster
1418
+ resourceName = "mongodbatlas_cluster.test"
1419
+ orgID = os .Getenv ("MONGODB_ATLAS_ORG_ID" )
1420
+ projectName = acctest .RandomWithPrefix ("test-acc" )
1421
+ name = fmt .Sprintf ("test-acc-%s" , acctest .RandString (10 ))
1422
+ config = testAccMongoDBAtlasClusterConfigAWS (orgID , projectName , name , true , true )
1423
+ )
1424
+
1425
+ resource .ParallelTest (t , resource.TestCase {
1426
+ PreCheck : func () { testAccPreCheckBasic (t ) },
1427
+ CheckDestroy : testAccCheckMongoDBAtlasClusterDestroy ,
1428
+ Steps : []resource.TestStep {
1429
+ {
1430
+ ExternalProviders : map [string ]resource.ExternalProvider {
1431
+ "mongodbatlas" : {
1432
+ VersionConstraint : "1.11.0" ,
1433
+ Source : "mongodb/mongodbatlas" ,
1434
+ },
1435
+ },
1436
+ Config : config ,
1437
+ Check : resource .ComposeTestCheckFunc (
1438
+ testAccCheckMongoDBAtlasClusterExists (resourceName , & cluster ),
1439
+ testAccCheckMongoDBAtlasClusterAttributes (& cluster , name ),
1440
+ resource .TestCheckResourceAttrSet (resourceName , "project_id" ),
1441
+ resource .TestCheckResourceAttr (resourceName , "name" , name ),
1442
+ ),
1443
+ },
1444
+ {
1445
+ ProtoV6ProviderFactories : testAccProviderV6Factories ,
1446
+ Config : config ,
1447
+ ConfigPlanChecks : resource.ConfigPlanChecks {
1448
+ PostApplyPreRefresh : []plancheck.PlanCheck {
1449
+ testutils .DebugPlan (),
1450
+ },
1451
+ },
1452
+ PlanOnly : true ,
1453
+ },
1454
+ },
1455
+ })
1456
+ }
1457
+
1413
1458
func testAccCheckMongoDBAtlasClusterImportStateIDFunc (resourceName string ) resource.ImportStateIdFunc {
1414
1459
return func (s * terraform.State ) (string , error ) {
1415
1460
rs , ok := s .RootModule ().Resources [resourceName ]
0 commit comments