package config

import (
	"testing"

	"github.com/stretchr/testify/assert"
)

func TestHepler(t *testing.T) {
	mockConfig := ServiceConfig{
		Env:      "test",
		LogLevel: "debug",
		InstanceMeteringConfig: &InstanceMeteringConfig{
			TenantWithSwitchTimes: []TenantFilter{
				{
					TenantId:   "111",
					SwitchTime: 123123,
				},
			},
			FeatureGateFilter: map[string]FeatureGateFilter{
				"test": {
					FullSwitchTime: 123123,
					Tenants: []TenantFilter{
						{
							TenantId:   "111",
							SwitchTime: 123123,
						},
					},
					Projects: []ProjectFilter{
						{
							ProjectId:  "111",
							SwitchTime: 123123,
						},
					},
					Clusters: []ClusterFilter{
						{
							ClusterId:  "111",
							SwitchTime: 123123,
						},
					},
				},
			},
		},
	}
	Init(mockConfig)
	assert.Equal(t, mockConfig, cache)
	config := GetConfig()
	assert.Equal(t, mockConfig, config)
}
