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

	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t, "both", "3.0(1k)-") },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			{
				Config:             testConfigFvRemoteIdDataSourceDependencyWithFvSiteAssociated,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("data.aci_remote_site.test", "site_id", "0"),
					resource.TestCheckResourceAttr("data.aci_remote_site.test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("data.aci_remote_site.test", "description", ""),
					resource.TestCheckResourceAttr("data.aci_remote_site.test", "name", ""),
					resource.TestCheckResourceAttr("data.aci_remote_site.test", "name_alias", ""),
					resource.TestCheckResourceAttr("data.aci_remote_site.test", "owner_key", ""),
					resource.TestCheckResourceAttr("data.aci_remote_site.test", "owner_tag", ""),
					resource.TestCheckResourceAttr("data.aci_remote_site.test", "remote_pc_tag", "16387"),
					resource.TestCheckResourceAttr("data.aci_remote_site.test", "remote_vrf_pc_tag", "any"),
				),
			},
			{
				Config:      testConfigFvRemoteIdNotExistingFvSiteAssociated,
				ExpectError: regexp.MustCompile("Failed to read aci_remote_site data source"),
			},
		},
	})
}

const testConfigFvRemoteIdDataSourceDependencyWithFvSiteAssociated = testConfigFvRemoteIdMinDependencyWithFvSiteAssociated + `
data "aci_remote_site" "test" {
  parent_dn = aci_associated_site.test.id
  site_id = "0"
  depends_on = [aci_remote_site.test]
}
`

const testConfigFvRemoteIdNotExistingFvSiteAssociated = testConfigFvSiteAssociatedMinDependencyWithFvBD + `
data "aci_remote_site" "test_non_existing" {
  parent_dn = aci_associated_site.test.id
  site_id = "2"
}
`
