// 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 TestAccDataSourceVzRsAnyToConsIfWithVzAny(t *testing.T) {

	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t, "both", "1.0(1e)-") },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			{
				Config:             testConfigVzRsAnyToConsIfDataSourceDependencyWithVzAny,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("data.aci_relation_from_any_to_contract_interface.test", "imported_contract_name", "test_tn_vz_cp_if_name"),
					resource.TestCheckResourceAttr("data.aci_relation_from_any_to_contract_interface.test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("data.aci_relation_from_any_to_contract_interface.test", "priority", "unspecified"),
				),
			},
			{
				Config:      testConfigVzRsAnyToConsIfNotExistingVzAny,
				ExpectError: regexp.MustCompile("Failed to read aci_relation_from_any_to_contract_interface data source"),
			},
		},
	})
}

const testConfigVzRsAnyToConsIfDataSourceDependencyWithVzAny = testConfigVzRsAnyToConsIfMinDependencyWithVzAny + `
data "aci_relation_from_any_to_contract_interface" "test" {
  parent_dn = aci_any.test.id
  imported_contract_name = "test_tn_vz_cp_if_name"
  depends_on = [aci_relation_from_any_to_contract_interface.test]
}
`

const testConfigVzRsAnyToConsIfNotExistingVzAny = testConfigVzAnyMinDependencyWithFvCtx + `
data "aci_relation_from_any_to_contract_interface" "test_non_existing" {
  parent_dn = aci_any.test.id
  imported_contract_name = "non_existing_tn_vz_cp_if_name"
}
`
