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

package provider

import (
	"testing"

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

func TestAccDataSourceSdwanCiscoNTPFeatureTemplate(t *testing.T) {
	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t) },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			{
				Config: testAccDataSourceSdwanCiscoNTPFeatureTemplateConfig,
				Check: resource.ComposeTestCheckFunc(
					resource.TestCheckResourceAttr("data.sdwan_cisco_ntp_feature_template.test", "master", "true"),
					resource.TestCheckResourceAttr("data.sdwan_cisco_ntp_feature_template.test", "master_stratum", "6"),
					resource.TestCheckResourceAttr("data.sdwan_cisco_ntp_feature_template.test", "master_source_interface", "e1"),
					resource.TestCheckResourceAttr("data.sdwan_cisco_ntp_feature_template.test", "authentication_keys.0.id", "1"),
					resource.TestCheckResourceAttr("data.sdwan_cisco_ntp_feature_template.test", "authentication_keys.0.value", "12345"),
					resource.TestCheckResourceAttr("data.sdwan_cisco_ntp_feature_template.test", "servers.0.hostname_ip", "NTP_SERVER1"),
					resource.TestCheckResourceAttr("data.sdwan_cisco_ntp_feature_template.test", "servers.0.authentication_key_id", "1"),
					resource.TestCheckResourceAttr("data.sdwan_cisco_ntp_feature_template.test", "servers.0.vpn_id", "1"),
					resource.TestCheckResourceAttr("data.sdwan_cisco_ntp_feature_template.test", "servers.0.version", "4"),
					resource.TestCheckResourceAttr("data.sdwan_cisco_ntp_feature_template.test", "servers.0.source_interface", "e1"),
					resource.TestCheckResourceAttr("data.sdwan_cisco_ntp_feature_template.test", "servers.0.prefer", "true"),
				),
			},
		},
	})
}

const testAccDataSourceSdwanCiscoNTPFeatureTemplateConfig = `

resource "sdwan_cisco_ntp_feature_template" "test" {
  name = "TF_TEST_MIN"
  description = "Terraform integration test"
  device_types = ["vedge-C8000V"]
  master = true
  master_stratum = 6
  master_source_interface = "e1"
  trusted_keys = [1]
  authentication_keys = [{
    id = 1
    value = "12345"
  }]
  servers = [{
    hostname_ip = "NTP_SERVER1"
    authentication_key_id = 1
    vpn_id = 1
    version = 4
    source_interface = "e1"
    prefer = true
  }]
}

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