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

	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t, "apic", "5.0(1k)-") },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			{
				Config:             testConfigMplsNodeSidPDataSourceDependencyWithL3extLoopBackIfP,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("data.aci_l3out_node_sid_profile.test", "segment_id", "1"),
					resource.TestCheckResourceAttr("data.aci_l3out_node_sid_profile.test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("data.aci_l3out_node_sid_profile.test", "description", ""),
					resource.TestCheckResourceAttr("data.aci_l3out_node_sid_profile.test", "loopback_address", "0.0.0.0"),
					resource.TestCheckResourceAttr("data.aci_l3out_node_sid_profile.test", "name", ""),
					resource.TestCheckResourceAttr("data.aci_l3out_node_sid_profile.test", "name_alias", ""),
				),
			},
			{
				Config:      testConfigMplsNodeSidPNotExistingL3extLoopBackIfP,
				ExpectError: regexp.MustCompile("Failed to read aci_l3out_node_sid_profile data source"),
			},
		},
	})
}

const testConfigMplsNodeSidPDataSourceDependencyWithL3extLoopBackIfP = testConfigMplsNodeSidPMinDependencyWithL3extLoopBackIfP + `
data "aci_l3out_node_sid_profile" "test" {
  parent_dn = aci_l3out_loopback_interface_profile.test.id
  segment_id = "1"
  depends_on = [aci_l3out_node_sid_profile.test]
}
`

const testConfigMplsNodeSidPNotExistingL3extLoopBackIfP = testConfigL3extLoopBackIfPMinDependencyWithL3extRsNodeL3OutAtt + `
data "aci_l3out_node_sid_profile" "test_non_existing" {
  parent_dn = aci_l3out_loopback_interface_profile.test.id
  segment_id = "2"
}
`
