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

package provider

import (
	"testing"

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

func TestAccSdwanQoSMapPolicyDefinition(t *testing.T) {
	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t) },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			{
				Config: testAccSdwanQoSMapPolicyDefinitionConfig_all(),
				Check: resource.ComposeTestCheckFunc(
					resource.TestCheckResourceAttr("sdwan_qos_map_policy_definition.test", "qos_schedulers.0.bandwidth_percent", "10"),
					resource.TestCheckResourceAttr("sdwan_qos_map_policy_definition.test", "qos_schedulers.0.buffer_percent", "10"),
					resource.TestCheckResourceAttr("sdwan_qos_map_policy_definition.test", "qos_schedulers.0.burst", "100000"),
					resource.TestCheckResourceAttr("sdwan_qos_map_policy_definition.test", "qos_schedulers.0.drop_type", "red-drop"),
					resource.TestCheckResourceAttr("sdwan_qos_map_policy_definition.test", "qos_schedulers.0.queue", "6"),
					resource.TestCheckResourceAttr("sdwan_qos_map_policy_definition.test", "qos_schedulers.0.scheduling_type", "wrr"),
				),
			},
		},
	})
}

func testAccSdwanQoSMapPolicyDefinitionConfig_all() string {
	return `
	resource "sdwan_class_map_policy_object" "test" {
		name = "TF_TEST_ALL"
		entries = [{
			queue = 6
		}]
	}

	resource "sdwan_qos_map_policy_definition" "test" {
		name = "TF_TEST_ALL"
		description = "Terraform integration test"
		qos_schedulers = [{
			bandwidth_percent = 10
			buffer_percent = 10
			burst = 100000
			class_map_id = sdwan_class_map_policy_object.test.id
			drop_type = "red-drop"
			queue = 6
			scheduling_type = "wrr"
		}]
	}
	`
}
