// 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 (
	"testing"

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

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

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

func TestAccDataSourceIosxeStaticRoutesVRF(t *testing.T) {
	var checks []resource.TestCheckFunc
	checks = append(checks, resource.TestCheckResourceAttr("data.iosxe_static_routes_vrf.test", "routes.0.prefix", "6.6.6.6"))
	checks = append(checks, resource.TestCheckResourceAttr("data.iosxe_static_routes_vrf.test", "routes.0.mask", "255.255.255.255"))
	checks = append(checks, resource.TestCheckResourceAttr("data.iosxe_static_routes_vrf.test", "routes.0.next_hops.0.next_hop", "7.7.7.7"))
	checks = append(checks, resource.TestCheckResourceAttr("data.iosxe_static_routes_vrf.test", "routes.0.next_hops.0.distance", "10"))
	checks = append(checks, resource.TestCheckResourceAttr("data.iosxe_static_routes_vrf.test", "routes.0.next_hops.0.global", "false"))
	checks = append(checks, resource.TestCheckResourceAttr("data.iosxe_static_routes_vrf.test", "routes.0.next_hops.0.name", "Route1"))
	checks = append(checks, resource.TestCheckResourceAttr("data.iosxe_static_routes_vrf.test", "routes.0.next_hops.0.permanent", "true"))
	checks = append(checks, resource.TestCheckResourceAttr("data.iosxe_static_routes_vrf.test", "routes.0.next_hops.0.tag", "100"))
	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t) },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			{
				Config: testAccDataSourceIosxeStaticRoutesVRFPrerequisitesConfig + testAccDataSourceIosxeStaticRoutesVRFConfig(),
				Check:  resource.ComposeTestCheckFunc(checks...),
			},
		},
	})
}

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

// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
const testAccDataSourceIosxeStaticRoutesVRFPrerequisitesConfig = `
resource "iosxe_restconf" "PreReq0" {
	path = "Cisco-IOS-XE-native:native/vrf/definition=VRF1"
	delete = false
	attributes = {
		"name" = "VRF1"
		"address-family/ipv4" = ""
	}
}

`

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

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

func testAccDataSourceIosxeStaticRoutesVRFConfig() string {
	config := `resource "iosxe_static_routes_vrf" "test" {` + "\n"
	config += `	vrf = "VRF1"` + "\n"
	config += `	routes = [{` + "\n"
	config += `		prefix = "6.6.6.6"` + "\n"
	config += `		mask = "255.255.255.255"` + "\n"
	config += `		next_hops = [{` + "\n"
	config += `			next_hop = "7.7.7.7"` + "\n"
	config += `			distance = 10` + "\n"
	config += `			global = false` + "\n"
	config += `			name = "Route1"` + "\n"
	config += `			permanent = true` + "\n"
	config += `			tag = 100` + "\n"
	config += `		}]` + "\n"
	config += `	}]` + "\n"
	config += `	depends_on = [iosxe_restconf.PreReq0, ]` + "\n"
	config += `}` + "\n"

	config += `
		data "iosxe_static_routes_vrf" "test" {
			vrf = "VRF1"
			depends_on = [iosxe_static_routes_vrf.test]
		}
	`
	return config
}

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