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

package provider

import (
	"testing"

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

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

const testAccDataSourceSdwanQoSMapPolicyDefinitionConfig = `
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"
	}]
}

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