diff --git a/gen/definitions/profile_parcels/policy_object_expanded_community.yaml b/gen/definitions/profile_parcels/policy_object_expanded_community.yaml index 6d757c7c..1c94bb83 100644 --- a/gen/definitions/profile_parcels/policy_object_expanded_community.yaml +++ b/gen/definitions/profile_parcels/policy_object_expanded_community.yaml @@ -10,16 +10,15 @@ attributes: mandatory: true description: Feature Profile ID example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac - test_value: '"e4d9392a-7765-4a64-b719-a4bcaf534f25"' - # test_value: sdwan_policy_object_feature_profile.test.id + test_value: sdwan_policy_object_feature_profile.test.id - model_name: expandedCommunityList tf_name: expanded_community_lists id: true mandatory: true example: abcd -# test_prerequisites: | -# resource "sdwan_policy_object_feature_profile" "test" { -# name = "TF_TEST" -# description = "Terraform test" -# } \ No newline at end of file +test_prerequisites: | + resource "sdwan_policy_object_feature_profile" "test" { + name = "TF_TEST" + description = "Terraform test" + } \ No newline at end of file diff --git a/internal/provider/data_source_sdwan_policy_object_expanded_community_profile_parcel_test.go b/internal/provider/data_source_sdwan_policy_object_expanded_community_profile_parcel_test.go index 6d948276..749b88a8 100644 --- a/internal/provider/data_source_sdwan_policy_object_expanded_community_profile_parcel_test.go +++ b/internal/provider/data_source_sdwan_policy_object_expanded_community_profile_parcel_test.go @@ -38,7 +38,7 @@ func TestAccDataSourceSdwanPolicyObjectExpandedCommunityProfileParcel(t *testing ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccDataSourceSdwanPolicyObjectExpandedCommunityProfileParcelConfig(), + Config: testAccDataSourceSdwanPolicyObjectExpandedCommunityPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectExpandedCommunityProfileParcelConfig(), Check: resource.ComposeTestCheckFunc(checks...), }, }, @@ -48,6 +48,13 @@ func TestAccDataSourceSdwanPolicyObjectExpandedCommunityProfileParcel(t *testing // End of section. //template:end testAccDataSource // Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites +const testAccDataSourceSdwanPolicyObjectExpandedCommunityPrerequisitesProfileParcelConfig = ` +resource "sdwan_policy_object_feature_profile" "test" { + name = "TF_TEST" + description = "Terraform test" +} +` + // End of section. //template:end testPrerequisites // Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig @@ -55,14 +62,14 @@ func testAccDataSourceSdwanPolicyObjectExpandedCommunityProfileParcelConfig() st config := `resource "sdwan_policy_object_expanded_community_profile_parcel" "test" {` + "\n" config += ` name = "TF_TEST"` + "\n" config += ` description = "Terraform integration test"` + "\n" - config += ` feature_profile_id = "e4d9392a-7765-4a64-b719-a4bcaf534f25"` + "\n" + config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n" config += ` expanded_community_lists = ["abcd"]` + "\n" config += `}` + "\n" config += ` data "sdwan_policy_object_expanded_community_profile_parcel" "test" { id = sdwan_policy_object_expanded_community_profile_parcel.test.id - feature_profile_id = "e4d9392a-7765-4a64-b719-a4bcaf534f25" + feature_profile_id = sdwan_policy_object_feature_profile.test.id } ` return config diff --git a/internal/provider/resource_sdwan_policy_object_expanded_community_profile_parcel_test.go b/internal/provider/resource_sdwan_policy_object_expanded_community_profile_parcel_test.go index db1887cb..66d34efa 100644 --- a/internal/provider/resource_sdwan_policy_object_expanded_community_profile_parcel_test.go +++ b/internal/provider/resource_sdwan_policy_object_expanded_community_profile_parcel_test.go @@ -38,10 +38,10 @@ func TestAccSdwanPolicyObjectExpandedCommunityProfileParcel(t *testing.T) { ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccSdwanPolicyObjectExpandedCommunityProfileParcelConfig_minimum(), + Config: testAccSdwanPolicyObjectExpandedCommunityPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectExpandedCommunityProfileParcelConfig_minimum(), }, { - Config: testAccSdwanPolicyObjectExpandedCommunityProfileParcelConfig_all(), + Config: testAccSdwanPolicyObjectExpandedCommunityPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectExpandedCommunityProfileParcelConfig_all(), Check: resource.ComposeTestCheckFunc(checks...), }, }, @@ -51,6 +51,13 @@ func TestAccSdwanPolicyObjectExpandedCommunityProfileParcel(t *testing.T) { // End of section. //template:end testAcc // Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites +const testAccSdwanPolicyObjectExpandedCommunityPrerequisitesProfileParcelConfig = ` +resource "sdwan_policy_object_feature_profile" "test" { + name = "TF_TEST" + description = "Terraform test" +} +` + // End of section. //template:end testPrerequisites // Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum @@ -58,7 +65,7 @@ func testAccSdwanPolicyObjectExpandedCommunityProfileParcelConfig_minimum() stri config := `resource "sdwan_policy_object_expanded_community_profile_parcel" "test" {` + "\n" config += ` name = "TF_TEST_MIN"` + "\n" config += ` description = "Terraform integration test"` + "\n" - config += ` feature_profile_id = "e4d9392a-7765-4a64-b719-a4bcaf534f25"` + "\n" + config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n" config += ` expanded_community_lists = ["abcd"]` + "\n" config += `}` + "\n" return config @@ -71,7 +78,7 @@ func testAccSdwanPolicyObjectExpandedCommunityProfileParcelConfig_all() string { config := `resource "sdwan_policy_object_expanded_community_profile_parcel" "test" {` + "\n" config += ` name = "TF_TEST_ALL"` + "\n" config += ` description = "Terraform integration test"` + "\n" - config += ` feature_profile_id = "e4d9392a-7765-4a64-b719-a4bcaf534f25"` + "\n" + config += ` feature_profile_id = sdwan_policy_object_feature_profile.test.id` + "\n" config += ` expanded_community_lists = ["abcd"]` + "\n" config += `}` + "\n" return config