@@ -611,32 +611,32 @@ func TestAccProject_basic(t *testing.T) {
611611 })
612612}
613613
614- func TestAccProjectGov_withProjectOwner (t * testing.T ) {
615- acc .SkipTestForCI (t ) // Gov test config not set
616-
614+ func TestAccGovProject_withProjectOwner (t * testing.T ) {
617615 var (
618- orgID = os .Getenv ("MONGODB_ATLAS_ORG_ID_GOV " )
619- projectOwnerID = os .Getenv ("MONGODB_ATLAS_PROJECT_OWNER_ID_GOV " )
616+ orgID = os .Getenv ("MONGODB_ATLAS_GOV_ORG_ID " )
617+ projectOwnerID = os .Getenv ("MONGODB_ATLAS_GOV_PROJECT_OWNER_ID " )
620618 projectName = acc .RandomProjectName ()
621619 )
622620
623621 resource .ParallelTest (t , resource.TestCase {
624622 PreCheck : func () { acc .PreCheckGovBasic (t ) },
625623 ProtoV6ProviderFactories : acc .TestAccProviderV6Factories ,
626- CheckDestroy : acc .CheckDestroyProject ,
624+ CheckDestroy : acc .CheckDestroyProjectGov ,
627625 Steps : []resource.TestStep {
628626 {
629627 Config : configGovWithOwner (orgID , projectName , projectOwnerID ),
630628 Check : resource .ComposeTestCheckFunc (
631- checkExists (resourceName ),
629+ checkExistsGov (resourceName ),
632630 resource .TestCheckResourceAttr (resourceName , "name" , projectName ),
633631 resource .TestCheckResourceAttr (resourceName , "org_id" , orgID ),
632+ resource .TestCheckResourceAttr (resourceName , "project_owner_id" , projectOwnerID ),
634633 resource .TestCheckResourceAttr (resourceName , "region_usage_restrictions" , "GOV_REGIONS_ONLY" ),
635634 ),
636635 },
637636 },
638637 })
639638}
639+
640640func TestAccProject_withFalseDefaultSettings (t * testing.T ) {
641641 var (
642642 orgID = os .Getenv ("MONGODB_ATLAS_ORG_ID" )
@@ -1076,6 +1076,14 @@ func tagChecks(tags map[string]string, notFoundKeys ...string) resource.TestChec
10761076}
10771077
10781078func checkExists (resourceName string ) resource.TestCheckFunc {
1079+ return checkExistsWithConn (resourceName , acc .ConnV2 ())
1080+ }
1081+
1082+ func checkExistsGov (resourceName string ) resource.TestCheckFunc {
1083+ return checkExistsWithConn (resourceName , acc .ConnV2UsingGov ())
1084+ }
1085+
1086+ func checkExistsWithConn (resourceName string , conn * admin.APIClient ) resource.TestCheckFunc {
10791087 return func (s * terraform.State ) error {
10801088 rs , ok := s .RootModule ().Resources [resourceName ]
10811089 if ! ok {
@@ -1084,7 +1092,7 @@ func checkExists(resourceName string) resource.TestCheckFunc {
10841092 if rs .Primary .ID == "" {
10851093 return fmt .Errorf ("no ID is set" )
10861094 }
1087- if _ , _ , err := acc . ConnV2 () .ProjectsApi .GetProjectByName (context .Background (), rs .Primary .Attributes ["name" ]).Execute (); err == nil {
1095+ if _ , _ , err := conn .ProjectsApi .GetProjectByName (context .Background (), rs .Primary .Attributes ["name" ]).Execute (); err == nil {
10881096 return nil
10891097 }
10901098 return fmt .Errorf ("project (%s) does not exist" , rs .Primary .ID )
@@ -1135,7 +1143,7 @@ func configBasic(orgID, projectName, projectOwnerID string, includeDataSource bo
11351143}
11361144
11371145func configGovWithOwner (orgID , projectName , projectOwnerID string ) string {
1138- return fmt .Sprintf (`
1146+ return acc . ConfigGovProvider () + fmt .Sprintf (`
11391147 resource "mongodbatlas_project" "test" {
11401148 org_id = %[1]q
11411149 name = %[2]q
0 commit comments