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

	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t, "both", "4.1(1i)-") },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			{
				Config:             testConfigFvRsOtmListMemberDataSourceDependencyWithFvTrackList,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("data.aci_relation_to_ip_sla_track_member.test", "target_dn", "uni/tn-test_tenant/trackmember-track_member_name_1"),
					resource.TestCheckResourceAttr("data.aci_relation_to_ip_sla_track_member.test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("data.aci_relation_to_ip_sla_track_member.test", "weight", "10"),
				),
			},
			{
				Config:      testConfigFvRsOtmListMemberNotExistingFvTrackList,
				ExpectError: regexp.MustCompile("Failed to read aci_relation_to_ip_sla_track_member data source"),
			},
		},
	})
}

const testConfigFvRsOtmListMemberDataSourceDependencyWithFvTrackList = testConfigFvRsOtmListMemberMinDependencyWithFvTrackList + `
data "aci_relation_to_ip_sla_track_member" "test" {
  parent_dn = aci_ip_sla_track_list.test.id
  target_dn = "uni/tn-test_tenant/trackmember-track_member_name_1"
  depends_on = [aci_relation_to_ip_sla_track_member.test]
}
`

const testConfigFvRsOtmListMemberNotExistingFvTrackList = testConfigFvTrackListMinDependencyWithFvTenant + `
data "aci_relation_to_ip_sla_track_member" "test_non_existing" {
  parent_dn = aci_ip_sla_track_list.test.id
  target_dn = "uni/tn-test_tenant/trackmember-track_member_name_1_not_existing"
}
`
