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

package provider

import (
	"testing"

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

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

func testAccSdwanCiscoNTPFeatureTemplateConfig_minimum() string {
	return `
	resource "sdwan_cisco_ntp_feature_template" "test" {
		name = "TF_TEST_MIN"
		description = "Terraform integration test"
		device_types = ["vedge-C8000V"]
	}
	`
}

func testAccSdwanCiscoNTPFeatureTemplateConfig_all() string {
	return `
	resource "sdwan_cisco_ntp_feature_template" "test" {
		name = "TF_TEST_ALL"
		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
		}]
	}
	`
}
