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

	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t, "apic", "2.0(1m)-") },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			{
				Config:             testConfigFvRsFcPathAttDataSourceDependencyWithFvAEPg,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("data.aci_relation_to_fibre_channel_path.test", "target_dn", "topology/pod-1/paths-101/pathep-[eth1/1]"),
					resource.TestCheckResourceAttr("data.aci_relation_to_fibre_channel_path.test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("data.aci_relation_to_fibre_channel_path.test", "description", ""),
					resource.TestCheckResourceAttr("data.aci_relation_to_fibre_channel_path.test", "vsan", "unknown"),
					resource.TestCheckResourceAttr("data.aci_relation_to_fibre_channel_path.test", "vsan_mode", "regular"),
				),
			},
			{
				Config:      testConfigFvRsFcPathAttNotExistingFvAEPg,
				ExpectError: regexp.MustCompile("Failed to read aci_relation_to_fibre_channel_path data source"),
			},
		},
	})
}

const testConfigFvRsFcPathAttDataSourceDependencyWithFvAEPg = testConfigFvRsFcPathAttMinDependencyWithFvAEPg + `
data "aci_relation_to_fibre_channel_path" "test" {
  parent_dn = aci_application_epg.test.id
  target_dn = "topology/pod-1/paths-101/pathep-[eth1/1]"
  depends_on = [aci_relation_to_fibre_channel_path.test]
}
`

const testConfigFvRsFcPathAttNotExistingFvAEPg = testConfigFvAEPgMinDependencyWithFvAp + `
data "aci_relation_to_fibre_channel_path" "test_non_existing" {
  parent_dn = aci_application_epg.test.id
  target_dn = "topology/pod-2/paths-201/pathep-[eth1/1]"
}
`
