// Code generated by "gen/generator.go"; DO NOT EDIT.
// In order to regenerate this file execute `go generate` from the repository root.
// More details can be found in the [README](https://github.com/CiscoDevNet/terraform-provider-aci/blob/master/README.md).

package provider

import (
	"regexp"
	"testing"

	"github.com/hashicorp/terraform-plugin-testing/helper/resource"
)

func TestAccResourceFvRsConsIfWithFvAEPg(t *testing.T) {

	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t, "both", "1.0(1e)-") },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			// Create with minimum config and verify default APIC values
			{
				Config:             testConfigFvRsConsIfMinDependencyWithFvAEPgAllowExisting,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.allow_test", "imported_contract_name", "test_tn_vz_cp_if_name"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.allow_test_2", "imported_contract_name", "test_tn_vz_cp_if_name"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.allow_test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.allow_test_2", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.allow_test", "priority", "unspecified"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.allow_test_2", "priority", "unspecified"),
				),
			},
		},
	})

	setEnvVariable(t, "ACI_ALLOW_EXISTING_ON_CREATE", "false")
	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t, "both", "1.0(1e)-") },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			// Create with minimum config and verify default APIC values
			{
				Config:      testConfigFvRsConsIfMinDependencyWithFvAEPgAllowExisting,
				ExpectError: regexp.MustCompile("Object Already Exists"),
			},
		},
	})

	setEnvVariable(t, "ACI_ALLOW_EXISTING_ON_CREATE", "true")
	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t, "both", "1.0(1e)-") },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			// Create with minimum config and verify default APIC values
			{
				Config:             testConfigFvRsConsIfMinDependencyWithFvAEPgAllowExisting,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.allow_test", "imported_contract_name", "test_tn_vz_cp_if_name"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.allow_test_2", "imported_contract_name", "test_tn_vz_cp_if_name"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.allow_test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.allow_test_2", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.allow_test", "priority", "unspecified"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.allow_test_2", "priority", "unspecified"),
				),
			},
		},
	})

	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t, "both", "1.0(1e)-") },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			// Create with minimum config and verify default APIC values
			{
				Config:             testConfigFvRsConsIfMinDependencyWithFvAEPg,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "imported_contract_name", "test_tn_vz_cp_if_name"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "priority", "unspecified"),
				),
			},
			// Update with all config and verify default APIC values
			{
				Config:             testConfigFvRsConsIfAllDependencyWithFvAEPg,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "imported_contract_name", "test_tn_vz_cp_if_name"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "annotation", "annotation"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "priority", "level1"),
				),
			},
			// Update with minimum config and verify config is unchanged
			{
				Config:             testConfigFvRsConsIfMinDependencyWithFvAEPg,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "imported_contract_name", "test_tn_vz_cp_if_name"),
				),
			},
			// Update with empty strings config or default value
			{
				Config:             testConfigFvRsConsIfResetDependencyWithFvAEPg,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "imported_contract_name", "test_tn_vz_cp_if_name"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "priority", "unspecified"),
				),
			},
			// Import testing
			{
				ResourceName:      "aci_relation_to_imported_contract.test",
				ImportState:       true,
				ImportStateVerify: true,
			},
			// Update with children
			{
				Config:             testConfigFvRsConsIfChildrenDependencyWithFvAEPg,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "imported_contract_name", "test_tn_vz_cp_if_name"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "priority", "unspecified"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "tags.1.value", "test_value"),
				),
			},
			// Refresh State before import testing to ensure that the state is up to date
			{
				RefreshState:       true,
				ExpectNonEmptyPlan: false,
			},
			// Import testing with children
			{
				ResourceName:      "aci_relation_to_imported_contract.test",
				ImportState:       true,
				ImportStateVerify: true,
			},
			// Update with children removed from config
			{
				Config:             testConfigFvRsConsIfChildrenRemoveFromConfigDependencyWithFvAEPg,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "tags.#", "2"),
				),
			},
			// Update with children first child removed
			{
				Config:             testConfigFvRsConsIfChildrenRemoveOneDependencyWithFvAEPg,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "annotations.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "annotations.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "annotations.#", "1"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "tags.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "tags.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "tags.#", "1"),
				),
			},
			// Update with all children removed
			{
				Config:             testConfigFvRsConsIfChildrenRemoveAllDependencyWithFvAEPg,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "annotations.#", "0"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "tags.#", "0"),
				),
			},
			// Update with minimum config and custom type semantic equivalent values
			{
				Config:             testConfigFvRsConsIfCustomTypeDependencyWithFvAEPg,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "imported_contract_name", "test_tn_vz_cp_if_name"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "priority", "1"),
				),
			},
		},
		CheckDestroy: testCheckResourceDestroy,
	})
}
func TestAccResourceFvRsConsIfWithFvESg(t *testing.T) {

	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t, "both", "1.0(1e)-") },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			// Create with minimum config and verify default APIC values
			{
				Config:             testConfigFvRsConsIfMinDependencyWithFvESgAllowExisting,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.allow_test", "imported_contract_name", "test_tn_vz_cp_if_name"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.allow_test_2", "imported_contract_name", "test_tn_vz_cp_if_name"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.allow_test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.allow_test_2", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.allow_test", "priority", "unspecified"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.allow_test_2", "priority", "unspecified"),
				),
			},
		},
	})

	setEnvVariable(t, "ACI_ALLOW_EXISTING_ON_CREATE", "false")
	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t, "both", "1.0(1e)-") },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			// Create with minimum config and verify default APIC values
			{
				Config:      testConfigFvRsConsIfMinDependencyWithFvESgAllowExisting,
				ExpectError: regexp.MustCompile("Object Already Exists"),
			},
		},
	})

	setEnvVariable(t, "ACI_ALLOW_EXISTING_ON_CREATE", "true")
	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t, "both", "1.0(1e)-") },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			// Create with minimum config and verify default APIC values
			{
				Config:             testConfigFvRsConsIfMinDependencyWithFvESgAllowExisting,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.allow_test", "imported_contract_name", "test_tn_vz_cp_if_name"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.allow_test_2", "imported_contract_name", "test_tn_vz_cp_if_name"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.allow_test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.allow_test_2", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.allow_test", "priority", "unspecified"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.allow_test_2", "priority", "unspecified"),
				),
			},
		},
	})

	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t, "both", "1.0(1e)-") },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			// Create with minimum config and verify default APIC values
			{
				Config:             testConfigFvRsConsIfMinDependencyWithFvESg,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "imported_contract_name", "test_tn_vz_cp_if_name"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "priority", "unspecified"),
				),
			},
			// Update with all config and verify default APIC values
			{
				Config:             testConfigFvRsConsIfAllDependencyWithFvESg,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "imported_contract_name", "test_tn_vz_cp_if_name"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "annotation", "annotation"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "priority", "level1"),
				),
			},
			// Update with minimum config and verify config is unchanged
			{
				Config:             testConfigFvRsConsIfMinDependencyWithFvESg,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "imported_contract_name", "test_tn_vz_cp_if_name"),
				),
			},
			// Update with empty strings config or default value
			{
				Config:             testConfigFvRsConsIfResetDependencyWithFvESg,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "imported_contract_name", "test_tn_vz_cp_if_name"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "priority", "unspecified"),
				),
			},
			// Import testing
			{
				ResourceName:      "aci_relation_to_imported_contract.test",
				ImportState:       true,
				ImportStateVerify: true,
			},
			// Update with children
			{
				Config:             testConfigFvRsConsIfChildrenDependencyWithFvESg,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "imported_contract_name", "test_tn_vz_cp_if_name"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "priority", "unspecified"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "tags.1.value", "test_value"),
				),
			},
			// Refresh State before import testing to ensure that the state is up to date
			{
				RefreshState:       true,
				ExpectNonEmptyPlan: false,
			},
			// Import testing with children
			{
				ResourceName:      "aci_relation_to_imported_contract.test",
				ImportState:       true,
				ImportStateVerify: true,
			},
			// Update with children removed from config
			{
				Config:             testConfigFvRsConsIfChildrenRemoveFromConfigDependencyWithFvESg,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "tags.#", "2"),
				),
			},
			// Update with children first child removed
			{
				Config:             testConfigFvRsConsIfChildrenRemoveOneDependencyWithFvESg,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "annotations.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "annotations.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "annotations.#", "1"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "tags.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "tags.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "tags.#", "1"),
				),
			},
			// Update with all children removed
			{
				Config:             testConfigFvRsConsIfChildrenRemoveAllDependencyWithFvESg,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "annotations.#", "0"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "tags.#", "0"),
				),
			},
			// Update with minimum config and custom type semantic equivalent values
			{
				Config:             testConfigFvRsConsIfCustomTypeDependencyWithFvESg,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "imported_contract_name", "test_tn_vz_cp_if_name"),
					resource.TestCheckResourceAttr("aci_relation_to_imported_contract.test", "priority", "1"),
				),
			},
		},
		CheckDestroy: testCheckResourceDestroy,
	})
}

const testDependencyConfigFvRsConsIf = `
resource "aci_imported_contract" "test_imported_contract_0" {
  tenant_dn = aci_tenant.test.id
  name = "imported_contract_name_0"
}
resource "aci_imported_contract" "test_imported_contract_1" {
  tenant_dn = aci_tenant.test.id
  name = "imported_contract_name_1"
}
`

const testConfigFvRsConsIfMinDependencyWithFvAEPgAllowExisting = testDependencyConfigFvRsConsIf + testConfigFvAEPgMinDependencyWithFvAp + `
resource "aci_relation_to_imported_contract" "allow_test" {
  parent_dn = aci_application_epg.test.id
  imported_contract_name = "test_tn_vz_cp_if_name"
}
resource "aci_relation_to_imported_contract" "allow_test_2" {
  parent_dn = aci_application_epg.test.id
  imported_contract_name = "test_tn_vz_cp_if_name"
  depends_on = [aci_relation_to_imported_contract.allow_test]
}
`

const testConfigFvRsConsIfMinDependencyWithFvAEPg = testDependencyConfigFvRsConsIf + testConfigFvAEPgMinDependencyWithFvAp + `
resource "aci_relation_to_imported_contract" "test" {
  parent_dn = aci_application_epg.test.id
  imported_contract_name = "test_tn_vz_cp_if_name"
}
`

const testConfigFvRsConsIfAllDependencyWithFvAEPg = testDependencyConfigFvRsConsIf + testConfigFvAEPgMinDependencyWithFvAp + `
resource "aci_relation_to_imported_contract" "test" {
  parent_dn = aci_application_epg.test.id
  imported_contract_name = "test_tn_vz_cp_if_name"
  annotation = "annotation"
  priority = "level1"
}
`

const testConfigFvRsConsIfResetDependencyWithFvAEPg = testDependencyConfigFvRsConsIf + testConfigFvAEPgMinDependencyWithFvAp + `
resource "aci_relation_to_imported_contract" "test" {
  parent_dn = aci_application_epg.test.id
  imported_contract_name = "test_tn_vz_cp_if_name"
  annotation = "orchestrator:terraform"
  priority = "unspecified"
}
`
const testConfigFvRsConsIfChildrenDependencyWithFvAEPg = testDependencyConfigFvRsConsIf + testConfigFvAEPgMinDependencyWithFvAp + `
resource "aci_relation_to_imported_contract" "test" {
  parent_dn = aci_application_epg.test.id
  imported_contract_name = "test_tn_vz_cp_if_name"
  annotations = [
    {
      key = "key_0"
      value = "value_1"
    },
    {
      key = "key_1"
      value = "test_value"
    },
  ]
  tags = [
    {
      key = "key_0"
      value = "value_1"
    },
    {
      key = "key_1"
      value = "test_value"
    },
  ]
}
`

const testConfigFvRsConsIfChildrenRemoveFromConfigDependencyWithFvAEPg = testDependencyConfigFvRsConsIf + testConfigFvAEPgMinDependencyWithFvAp + `
resource "aci_relation_to_imported_contract" "test" {
  parent_dn = aci_application_epg.test.id
  imported_contract_name = "test_tn_vz_cp_if_name"
}
`

const testConfigFvRsConsIfChildrenRemoveOneDependencyWithFvAEPg = testDependencyConfigFvRsConsIf + testConfigFvAEPgMinDependencyWithFvAp + `
resource "aci_relation_to_imported_contract" "test" {
  parent_dn = aci_application_epg.test.id
  imported_contract_name = "test_tn_vz_cp_if_name"
  annotations = [ 
	{
	  key = "key_1"
	  value = "test_value"
	},
  ]
  tags = [ 
	{
	  key = "key_1"
	  value = "test_value"
	},
  ]
}
`

const testConfigFvRsConsIfChildrenRemoveAllDependencyWithFvAEPg = testDependencyConfigFvRsConsIf + testConfigFvAEPgMinDependencyWithFvAp + `
resource "aci_relation_to_imported_contract" "test" {
  parent_dn = aci_application_epg.test.id
  imported_contract_name = "test_tn_vz_cp_if_name"
  annotations = []
  tags = []
}
`

const testConfigFvRsConsIfCustomTypeDependencyWithFvAEPg = testDependencyConfigFvRsConsIf + testConfigFvAEPgMinDependencyWithFvAp + `
resource "aci_relation_to_imported_contract" "test" {
  parent_dn = aci_application_epg.test.id
  imported_contract_name = "test_tn_vz_cp_if_name"
  priority = "1"
}
`

const testConfigFvRsConsIfMinDependencyWithFvESgAllowExisting = testDependencyConfigFvRsConsIf + testConfigFvESgMinDependencyWithFvAp + `
resource "aci_relation_to_imported_contract" "allow_test" {
  parent_dn = aci_endpoint_security_group.test.id
  imported_contract_name = "test_tn_vz_cp_if_name"
}
resource "aci_relation_to_imported_contract" "allow_test_2" {
  parent_dn = aci_endpoint_security_group.test.id
  imported_contract_name = "test_tn_vz_cp_if_name"
  depends_on = [aci_relation_to_imported_contract.allow_test]
}
`

const testConfigFvRsConsIfMinDependencyWithFvESg = testDependencyConfigFvRsConsIf + testConfigFvESgMinDependencyWithFvAp + `
resource "aci_relation_to_imported_contract" "test" {
  parent_dn = aci_endpoint_security_group.test.id
  imported_contract_name = "test_tn_vz_cp_if_name"
}
`

const testConfigFvRsConsIfAllDependencyWithFvESg = testDependencyConfigFvRsConsIf + testConfigFvESgMinDependencyWithFvAp + `
resource "aci_relation_to_imported_contract" "test" {
  parent_dn = aci_endpoint_security_group.test.id
  imported_contract_name = "test_tn_vz_cp_if_name"
  annotation = "annotation"
  priority = "level1"
}
`

const testConfigFvRsConsIfResetDependencyWithFvESg = testDependencyConfigFvRsConsIf + testConfigFvESgMinDependencyWithFvAp + `
resource "aci_relation_to_imported_contract" "test" {
  parent_dn = aci_endpoint_security_group.test.id
  imported_contract_name = "test_tn_vz_cp_if_name"
  annotation = "orchestrator:terraform"
  priority = "unspecified"
}
`
const testConfigFvRsConsIfChildrenDependencyWithFvESg = testDependencyConfigFvRsConsIf + testConfigFvESgMinDependencyWithFvAp + `
resource "aci_relation_to_imported_contract" "test" {
  parent_dn = aci_endpoint_security_group.test.id
  imported_contract_name = "test_tn_vz_cp_if_name"
  annotations = [
    {
      key = "key_0"
      value = "value_1"
    },
    {
      key = "key_1"
      value = "test_value"
    },
  ]
  tags = [
    {
      key = "key_0"
      value = "value_1"
    },
    {
      key = "key_1"
      value = "test_value"
    },
  ]
}
`

const testConfigFvRsConsIfChildrenRemoveFromConfigDependencyWithFvESg = testDependencyConfigFvRsConsIf + testConfigFvESgMinDependencyWithFvAp + `
resource "aci_relation_to_imported_contract" "test" {
  parent_dn = aci_endpoint_security_group.test.id
  imported_contract_name = "test_tn_vz_cp_if_name"
}
`

const testConfigFvRsConsIfChildrenRemoveOneDependencyWithFvESg = testDependencyConfigFvRsConsIf + testConfigFvESgMinDependencyWithFvAp + `
resource "aci_relation_to_imported_contract" "test" {
  parent_dn = aci_endpoint_security_group.test.id
  imported_contract_name = "test_tn_vz_cp_if_name"
  annotations = [ 
	{
	  key = "key_1"
	  value = "test_value"
	},
  ]
  tags = [ 
	{
	  key = "key_1"
	  value = "test_value"
	},
  ]
}
`

const testConfigFvRsConsIfChildrenRemoveAllDependencyWithFvESg = testDependencyConfigFvRsConsIf + testConfigFvESgMinDependencyWithFvAp + `
resource "aci_relation_to_imported_contract" "test" {
  parent_dn = aci_endpoint_security_group.test.id
  imported_contract_name = "test_tn_vz_cp_if_name"
  annotations = []
  tags = []
}
`

const testConfigFvRsConsIfCustomTypeDependencyWithFvESg = testDependencyConfigFvRsConsIf + testConfigFvESgMinDependencyWithFvAp + `
resource "aci_relation_to_imported_contract" "test" {
  parent_dn = aci_endpoint_security_group.test.id
  imported_contract_name = "test_tn_vz_cp_if_name"
  priority = "1"
}
`
