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

package provider

import (
	"testing"

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

func TestAccSdwanDeviceACLPolicyDefinition(t *testing.T) {
	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t) },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			{
				Config: testAccSdwanDeviceACLPolicyDefinitionConfig_all(),
				Check: resource.ComposeTestCheckFunc(
					resource.TestCheckResourceAttr("sdwan_device_acl_policy_definition.test", "default_action", "drop"),
					resource.TestCheckResourceAttr("sdwan_device_acl_policy_definition.test", "sequences.0.id", "10"),
					resource.TestCheckResourceAttr("sdwan_device_acl_policy_definition.test", "sequences.0.ip_type", "ipv4"),
					resource.TestCheckResourceAttr("sdwan_device_acl_policy_definition.test", "sequences.0.name", "Sequence 10"),
					resource.TestCheckResourceAttr("sdwan_device_acl_policy_definition.test", "sequences.0.base_action", "accept"),
					resource.TestCheckResourceAttr("sdwan_device_acl_policy_definition.test", "sequences.0.match_entries.0.type", "destinationPort"),
					resource.TestCheckResourceAttr("sdwan_device_acl_policy_definition.test", "sequences.0.match_entries.0.destination_port", "22"),
					resource.TestCheckResourceAttr("sdwan_device_acl_policy_definition.test", "sequences.0.action_entries.0.type", "count"),
					resource.TestCheckResourceAttr("sdwan_device_acl_policy_definition.test", "sequences.0.action_entries.0.counter_name", "count1"),
				),
			},
		},
	})
}

func testAccSdwanDeviceACLPolicyDefinitionConfig_all() string {
	return `
	resource "sdwan_device_acl_policy_definition" "test" {
		name = "TF_TEST_ALL"
		description = "Terraform integration test"
		default_action = "drop"
		sequences = [{
			id = 10
			ip_type = "ipv4"
			name = "Sequence 10"
			base_action = "accept"
			match_entries = [{
				type = "destinationPort"
				destination_port = 22
			}]
			action_entries = [{
				type = "count"
				counter_name = "count1"
			}]
		}]
	}
	`
}
