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

	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t, "both", "5.0(1k)-") },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			{
				Config:             testConfigL3extRsLblToProfileDataSourceDependencyWithL3extConsLbl,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("data.aci_relation_from_l3out_consumer_label_to_route_control_profile.test", "direction", "import"),
					resource.TestCheckResourceAttr("data.aci_relation_from_l3out_consumer_label_to_route_control_profile.test", "target_dn", "uni/tn-test_name/prof-rt_ctrl_profile_1"),
					resource.TestCheckResourceAttr("data.aci_relation_from_l3out_consumer_label_to_route_control_profile.test", "annotation", "orchestrator:terraform"),
				),
			},
			{
				Config:      testConfigL3extRsLblToProfileNotExistingL3extConsLbl,
				ExpectError: regexp.MustCompile("Failed to read aci_relation_from_l3out_consumer_label_to_route_control_profile data source"),
			},
		},
	})
}

const testConfigL3extRsLblToProfileDataSourceDependencyWithL3extConsLbl = testConfigL3extRsLblToProfileMinDependencyWithL3extConsLbl + `
data "aci_relation_from_l3out_consumer_label_to_route_control_profile" "test" {
  parent_dn = aci_l3out_consumer_label.test.id
  direction = "import"
  target_dn = "uni/tn-test_name/prof-rt_ctrl_profile_1"
  depends_on = [aci_relation_from_l3out_consumer_label_to_route_control_profile.test]
}
`

const testConfigL3extRsLblToProfileNotExistingL3extConsLbl = testConfigL3extConsLblMinDependencyWithL3extOut + `
data "aci_relation_from_l3out_consumer_label_to_route_control_profile" "test_non_existing" {
  parent_dn = aci_l3out_consumer_label.test.id
  direction = "import"
  target_dn = "uni/tn-test_name/prof-rt_ctrl_profile_1_not_existing"
}
`
