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

	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t, "apic", "1.1(1j)-") },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			{
				Config:             testConfigL3extRsInstPToProfileDataSourceDependencyWithL3extInstP,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("data.aci_relation_from_external_epg_to_route_control_profile.test", "direction", "import"),
					resource.TestCheckResourceAttr("data.aci_relation_from_external_epg_to_route_control_profile.test", "route_control_profile_name", "test_tn_rtctrl_profile_name"),
					resource.TestCheckResourceAttr("data.aci_relation_from_external_epg_to_route_control_profile.test", "annotation", "orchestrator:terraform"),
				),
			},
			{
				Config:      testConfigL3extRsInstPToProfileNotExistingL3extInstP,
				ExpectError: regexp.MustCompile("Failed to read aci_relation_from_external_epg_to_route_control_profile data source"),
			},
		},
	})
}

const testConfigL3extRsInstPToProfileDataSourceDependencyWithL3extInstP = testConfigL3extRsInstPToProfileMinDependencyWithL3extInstP + `
data "aci_relation_from_external_epg_to_route_control_profile" "test" {
  parent_dn = aci_external_epg.test.id
  direction = "import"
  route_control_profile_name = "test_tn_rtctrl_profile_name"
  depends_on = [aci_relation_from_external_epg_to_route_control_profile.test]
}
`

const testConfigL3extRsInstPToProfileNotExistingL3extInstP = testConfigL3extInstPMinDependencyWithL3extOut + `
data "aci_relation_from_external_epg_to_route_control_profile" "test_non_existing" {
  parent_dn = aci_external_epg.test.id
  direction = "import"
  route_control_profile_name = "non_existing_tn_rtctrl_profile_name"
}
`
