// Code generated by "gen/generator.go"; DO NOT EDIT.

package provider

import (
	"testing"

	"github.com/hashicorp/terraform-plugin-testing/helper/resource"
)

func TestAccDataSourceSdwanRewriteRulePolicyDefinition(t *testing.T) {
	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t) },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			{
				Config: testAccDataSourceSdwanRewriteRulePolicyDefinitionConfig,
				Check: resource.ComposeTestCheckFunc(
					resource.TestCheckResourceAttr("data.sdwan_rewrite_rule_policy_definition.test", "rules.0.priority", "low"),
					resource.TestCheckResourceAttr("data.sdwan_rewrite_rule_policy_definition.test", "rules.0.dscp", "16"),
					resource.TestCheckResourceAttr("data.sdwan_rewrite_rule_policy_definition.test", "rules.0.layer2cos", "1"),
				),
			},
		},
	})
}

const testAccDataSourceSdwanRewriteRulePolicyDefinitionConfig = `

resource "sdwan_class_map_policy_object" "test" {
	name = "TF_TEST_ALL"
	entries = [{
		queue = 6
	}]
}

resource "sdwan_rewrite_rule_policy_definition" "test" {
  name = "TF_TEST_MIN"
  description = "Terraform integration test"
  rules = [{
    class_map_id = sdwan_class_map_policy_object.test.id
    priority = "low"
    dscp = 16
    layer2cos = 1
  }]
}

data "sdwan_rewrite_rule_policy_definition" "test" {
  id = sdwan_rewrite_rule_policy_definition.test.id
}
`
