// Copyright © 2023 Cisco Systems, Inc. and its affiliates.
// All rights reserved.
//
// Licensed under the Mozilla Public License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://mozilla.org/MPL/2.0/
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// SPDX-License-Identifier: MPL-2.0

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

package provider

// Section below is generated&owned by "gen/generator.go". //template:begin imports
import (
	"fmt"
	"os"
	"testing"

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

// End of section. //template:end imports

// Section below is generated&owned by "gen/generator.go". //template:begin testAcc

func TestAccIosxeAAAAuthentication(t *testing.T) {
	if os.Getenv("AAA") == "" {
		t.Skip("skipping test, set environment variable AAA")
	}
	var checks []resource.TestCheckFunc
	checks = append(checks, resource.TestCheckResourceAttr("iosxe_aaa_authentication.test", "logins.0.name", "test"))
	checks = append(checks, resource.TestCheckResourceAttr("iosxe_aaa_authentication.test", "logins.0.a1_group", "Radius-GROUP"))
	checks = append(checks, resource.TestCheckResourceAttr("iosxe_aaa_authentication.test", "logins.0.a2_none", "true"))
	checks = append(checks, resource.TestCheckResourceAttr("iosxe_aaa_authentication.test", "dot1x.0.name", "test"))
	checks = append(checks, resource.TestCheckResourceAttr("iosxe_aaa_authentication.test", "dot1x.0.a1_group", "GROUP1"))
	checks = append(checks, resource.TestCheckResourceAttr("iosxe_aaa_authentication.test", "dot1x.0.a2_cache", "GROUP2"))
	checks = append(checks, resource.TestCheckResourceAttr("iosxe_aaa_authentication.test", "dot1x.0.a3_radius", "true"))
	checks = append(checks, resource.TestCheckResourceAttr("iosxe_aaa_authentication.test", "dot1x.0.a4_local", "true"))
	checks = append(checks, resource.TestCheckResourceAttr("iosxe_aaa_authentication.test", "dot1x_default_a1_group", "Radius-GROUP"))
	checks = append(checks, resource.TestCheckResourceAttr("iosxe_aaa_authentication.test", "dot1x_default_a2_group", "Radius-GROUP2"))
	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t) },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			{
				Config: testAccIosxeAAAAuthenticationConfig_minimum(),
			},
			{
				Config: testAccIosxeAAAAuthenticationConfig_all(),
				Check:  resource.ComposeTestCheckFunc(checks...),
			},
			{
				ResourceName:            "iosxe_aaa_authentication.test",
				ImportState:             true,
				ImportStateVerify:       true,
				ImportStateIdFunc:       iosxeAAAAuthenticationImportStateIdFunc("iosxe_aaa_authentication.test"),
				ImportStateVerifyIgnore: []string{"logins.0.a1_none", "logins.0.a1_line", "logins.0.a1_enable", "logins.0.a1_local", "logins.0.a2_line", "logins.0.a2_enable", "logins.0.a2_local", "logins.0.a3_none", "logins.0.a3_line", "logins.0.a3_enable", "logins.0.a3_local", "logins.0.a4_none", "logins.0.a4_line", "logins.0.a4_enable", "logins.0.a4_local", "dot1x.0.a1_local", "dot1x.0.a1_radius", "dot1x.0.a2_local", "dot1x.0.a2_radius", "dot1x.0.a3_local", "dot1x.0.a4_radius", "dot1x_default_a1_local", "dot1x_default_a2_local", "dot1x_default_a3_local", "dot1x_default_a4_local", "enable_default_group1_enable", "enable_default_group1_line", "enable_default_group1_none", "enable_default_group2_enable", "enable_default_group2_line", "enable_default_group2_none", "enable_default_group3_enable", "enable_default_group3_line", "enable_default_group3_none", "enable_default_group4_enable", "enable_default_group4_line", "enable_default_group4_none"},
				Check:                   resource.ComposeTestCheckFunc(checks...),
			},
		},
	})
}

// End of section. //template:end testAcc

// Section below is generated&owned by "gen/generator.go". //template:begin importStateIdFunc

func iosxeAAAAuthenticationImportStateIdFunc(resourceName string) resource.ImportStateIdFunc {
	return func(s *terraform.State) (string, error) {

		return fmt.Sprintf(""), nil
	}
}

// End of section. //template:end importStateIdFunc

// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
// End of section. //template:end testPrerequisites

// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimal

func testAccIosxeAAAAuthenticationConfig_minimum() string {
	config := `resource "iosxe_aaa_authentication" "test" {` + "\n"
	config += `}` + "\n"
	return config
}

// End of section. //template:end testAccConfigMinimal

// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll

func testAccIosxeAAAAuthenticationConfig_all() string {
	config := `resource "iosxe_aaa_authentication" "test" {` + "\n"
	config += `	logins = [{` + "\n"
	config += `		name = "test"` + "\n"
	config += `		a1_group = "Radius-GROUP"` + "\n"
	config += `		a2_none = true` + "\n"
	config += `	}]` + "\n"
	config += `	dot1x = [{` + "\n"
	config += `		name = "test"` + "\n"
	config += `		a1_group = "GROUP1"` + "\n"
	config += `		a2_cache = "GROUP2"` + "\n"
	config += `		a3_radius = true` + "\n"
	config += `		a4_local = true` + "\n"
	config += `	}]` + "\n"
	config += `	dot1x_default_a1_group = "Radius-GROUP"` + "\n"
	config += `	dot1x_default_a2_group = "Radius-GROUP2"` + "\n"
	config += `}` + "\n"
	return config
}

// End of section. //template:end testAccConfigAll
