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

	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t, "both", "3.2(10e)-3.2(10g),3.2(7f)-") },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			{
				Config:             testConfigLacpEnhancedLagPolDataSourceDependencyWithVmmVSwitchPolicyCont,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("data.aci_lacp_enhanced_lag_policy.test", "name", "test_name"),
					resource.TestCheckResourceAttr("data.aci_lacp_enhanced_lag_policy.test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("data.aci_lacp_enhanced_lag_policy.test", "load_balancing_mode", "src-dst-ip"),
					resource.TestCheckResourceAttr("data.aci_lacp_enhanced_lag_policy.test", "mode", "active"),
					resource.TestCheckResourceAttr("data.aci_lacp_enhanced_lag_policy.test", "name_alias", ""),
					resource.TestCheckResourceAttr("data.aci_lacp_enhanced_lag_policy.test", "number_of_links", "2"),
				),
			},
			{
				Config:      testConfigLacpEnhancedLagPolNotExistingVmmVSwitchPolicyCont,
				ExpectError: regexp.MustCompile("Failed to read aci_lacp_enhanced_lag_policy data source"),
			},
		},
	})
}

const testConfigLacpEnhancedLagPolDataSourceDependencyWithVmmVSwitchPolicyCont = testConfigLacpEnhancedLagPolMinDependencyWithVmmVSwitchPolicyCont + `
data "aci_lacp_enhanced_lag_policy" "test" {
  parent_dn = aci_vswitch_policy.test.id
  name = "test_name"
  depends_on = [aci_lacp_enhanced_lag_policy.test]
}
`

const testConfigLacpEnhancedLagPolNotExistingVmmVSwitchPolicyCont = testConfigVmmVSwitchPolicyContMinDependencyWithVmmDomP + `
data "aci_lacp_enhanced_lag_policy" "test_non_existing" {
  parent_dn = aci_vswitch_policy.test.id
  name = "non_existing_name"
}
`
