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

	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t, "both", "1.0(1e)-") },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			{
				Config:             testConfigQosDot1PClassDataSourceDependencyWithQosCustomPol,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("data.aci_dot1p_classifier.test", "from", "1"),
					resource.TestCheckResourceAttr("data.aci_dot1p_classifier.test", "to", "2"),
					resource.TestCheckResourceAttr("data.aci_dot1p_classifier.test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("data.aci_dot1p_classifier.test", "description", ""),
					resource.TestCheckResourceAttr("data.aci_dot1p_classifier.test", "name", ""),
					resource.TestCheckResourceAttr("data.aci_dot1p_classifier.test", "name_alias", ""),
					resource.TestCheckResourceAttr("data.aci_dot1p_classifier.test", "priority", "unspecified"),
					resource.TestCheckResourceAttr("data.aci_dot1p_classifier.test", "target", "unspecified"),
					resource.TestCheckResourceAttr("data.aci_dot1p_classifier.test", "target_cos", "unspecified"),
				),
			},
			{
				Config:      testConfigQosDot1PClassNotExistingQosCustomPol,
				ExpectError: regexp.MustCompile("Failed to read aci_dot1p_classifier data source"),
			},
		},
	})
}

const testConfigQosDot1PClassDataSourceDependencyWithQosCustomPol = testConfigQosDot1PClassMinDependencyWithQosCustomPol + `
data "aci_dot1p_classifier" "test" {
  parent_dn = aci_custom_qos_policy.test.id
  from = "1"
  to = "2"
  depends_on = [aci_dot1p_classifier.test]
}
`

const testConfigQosDot1PClassNotExistingQosCustomPol = testConfigQosCustomPolMinDependencyWithFvTenant + `
data "aci_dot1p_classifier" "test_non_existing" {
  parent_dn = aci_custom_qos_policy.test.id
  from = "6"
  to = "7"
}
`
