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

package provider

import (
	"testing"

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

func TestAccDataSourceSdwanACLPolicyDefinition(t *testing.T) {
	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t) },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			{
				Config: testAccDataSourceSdwanACLPolicyDefinitionConfig,
				Check: resource.ComposeTestCheckFunc(
					resource.TestCheckResourceAttr("data.sdwan_acl_policy_definition.test", "default_action", "drop"),
					resource.TestCheckResourceAttr("data.sdwan_acl_policy_definition.test", "sequences.0.id", "10"),
					resource.TestCheckResourceAttr("data.sdwan_acl_policy_definition.test", "sequences.0.ip_type", "ipv4"),
					resource.TestCheckResourceAttr("data.sdwan_acl_policy_definition.test", "sequences.0.name", "Sequence 10"),
					resource.TestCheckResourceAttr("data.sdwan_acl_policy_definition.test", "sequences.0.base_action", "accept"),
					resource.TestCheckResourceAttr("data.sdwan_acl_policy_definition.test", "sequences.0.match_entries.0.type", "dscp"),
					resource.TestCheckResourceAttr("data.sdwan_acl_policy_definition.test", "sequences.0.match_entries.0.dscp", "16"),
					resource.TestCheckResourceAttr("data.sdwan_acl_policy_definition.test", "sequences.0.action_entries.0.type", "set"),
					resource.TestCheckResourceAttr("data.sdwan_acl_policy_definition.test", "sequences.0.action_entries.0.next_hop", "10.1.1.2"),
				),
			},
		},
	})
}

const testAccDataSourceSdwanACLPolicyDefinitionConfig = `

resource "sdwan_acl_policy_definition" "test" {
  name = "TF_TEST_MIN"
  description = "Terraform integration test"
  default_action = "drop"
  sequences = [{
    id = 10
    ip_type = "ipv4"
    name = "Sequence 10"
    base_action = "accept"
	match_entries = [{
		type = "dscp"
		dscp = 16
	}]
	action_entries = [{
		type = "set"
		next_hop = "10.1.1.2"
	}]
  }]
}

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