func TestGetConfigWithGroupOverrideAndDependency(t *testing.T) {
	m := getTestProperties()
	templ := getTestTemplate(t)
	config := newConfig("test", "testproject", templ, m, testManagementZoneApi, "")
	productionResult, err := getConfigForEnvironmentAsMap(config, testProductionEnvironment, make(map[string]api.DynatraceEntity))
	assert.NilError(t, err)
	assert.Equal(t, "Follow the brown dog", productionResult["msg"])
}
test GetConfigForEnvironment if environment group is defined
it should return `test.production` group values of getTestProperties
package config
import (
	"encoding/json"
	"fmt"
	"os"
	"reflect"
	"testing"
	"github.com/dynatrace-oss/dynatrace-monitoring-as-code/pkg/api"
	"github.com/dynatrace-oss/dynatrace-monitoring-as-code/pkg/environment"
	"github.com/dynatrace-oss/dynatrace-monitoring-as-code/pkg/util"
	"gotest.tools/assert"
)
const testTemplate = `{"msg": "Follow the {{.color}} {{.animalType}}"}`
const testTemplateWithDependency = `{"msg": "Follow the {{.color}} {{.animalType}} with {{ .dep }}"}`
const testTemplateWithEnvVar = `{"msg": "Follow the {{.color}} {{ .Env.ANIMAL }}"}`
var testDevEnvironment = environment.NewEnvironment("development", "Dev", "", "https://url/to/dev/environment", "DEV")
var testHardeningEnvironment = environment.NewEnvironment("hardening", "Hardening", "", "https://url/to/hardening/environment", "HARDENING")
var testProductionEnvironment = environment.NewEnvironment("prod-environment", "prod-environment", "production", "https://url/to/production/environment", "PRODUCTION")
var testManagementZoneApi = api.NewStandardApi("management-zone", "/api/config/v1/managementZones")
func createConfigForTest(id string, project string, template util.Template, properties map[string]map[string]string, api api.Api, fileName string) configImpl {
	return configImpl{
		id:         id,
		project:    project,
		template:   template,
		properties: properties,
		api:        api,
		fileName:   fileName,
	}
}
func TestFilterProperties(t *testing.T) {
	m := make(map[string]map[string]string)
	m["Captains"] = make(map[string]string)
	m["Commanders"] = make(map[string]string)
	m["Captains"]["Kirk"] = "James T."
	m["Captains"]["Picard"] = "Jean Luc"
	m["Commanders"]["Bonaparte"] = "Napoleon"
	properties := filterProperties("Captains", m)
	assert.Check(t, len(properties) == 1)
	assert.Check(t, properties["Captains"] != nil)
}
func TestFilterPropertiesToReturnExactMatchOnlyForConfigName(t *testing.T) {
	m := make(map[string]map[string]string)
	m["dashboard"] = make(map[string]string)
	m["dashboard-availability"] = make(map[string]string)
	properties := filterProperties("dashboard", m)
	assert.Check(t, len(properties) == 1)
	assert.Check(t, properties["dashboard"] != nil)
}
func TestFilterPropertiesToReturnExactMatchOnlyForConfigNameAndEnvironment(t *testing.T) {
	m := make(map[string]map[string]string)
	m["dashboard"] = make(map[string]string)
	m["dashboard-availability"] = make(map[string]string)
	m["dashboard.dev"] = make(map[string]string)
	m["dashboard-availability.dev"] = make(map[string]string)
	m["dashboard"]["prop1"] = "A"
	m["dashboard"]["prop2"] = "A"
	m["dashboard-availability"]["prop1"] = "A"
	m["dashboard-availability"]["prop2"] = "A"
	m["dashboard.dev"]["prop1"] = "B"
	m["dashboard.dev"]["prop2"] = "C"
	m["dashboard-availability.dev"]["prop1"] = "E"
	m["dashboard-availability.dev"]["prop2"] = "F"
	properties := filterProperties("dashboard.dev", m)
	assert.Check(t, len(properties) == 1)
	assert.Check(t, properties["dashboard.dev"] != nil)
	assert.Check(t, len(properties["dashboard.dev"]) == 2)
}
func TestFilterPropertiesToReturnMoreSpecificProperties(t *testing.T) {
	m := make(map[string]map[string]string)
	m["dashboard"] = make(map[string]string)
	m["dashboard.dev"] = make(map[string]string)
	m["dashboard"]["prop1"] = "A"
	m["dashboard"]["prop2"] = "A"
	m["dashboard.dev"]["prop1"] = "B"
	m["dashboard.dev"]["prop2"] = "C"
	properties := filterProperties("dashboard.dev", m)
	assert.Check(t, properties["dashboard.dev"]["prop1"] == "B")
	assert.Check(t, properties["dashboard.dev"]["prop2"] == "C")
}
func TestFilterPropertiesToReturnNoGeneralPropertiesForMissingSpecificOnes(t *testing.T) {
	m := make(map[string]map[string]string)
	m["dashboard"] = make(map[string]string)
	m["dashboard.dev"] = make(map[string]string)
	m["dashboard"]["prop1"] = "A"
	m["dashboard"]["prop2"] = "A"
	m["dashboard.dev"]["prop1"] = "B"
	properties := filterProperties("dashboard.dev", m)
	fmt.Println(properties)
	assert.Check(t, properties["dashboard.dev"]["prop1"] == "B")
	assert.Check(t, len(properties["dashboard.dev"]) == 1)
}
func TestGetConfigStringWithEnvironmentOverride(t *testing.T) {
	m := getTestProperties()
	templ := getTestTemplate(t)
	config := newConfig("test", "testproject", templ, m, testManagementZoneApi, "")
	devResult, err := getConfigForEnvironmentAsMap(config, testDevEnvironment, make(map[string]api.DynatraceEntity))
	assert.NilError(t, err)
	assert.Equal(t, "Follow the black squid", devResult["msg"])
}
func TestGetConfigStringNoEnvironmentOverride(t *testing.T) {
	m := getTestProperties()
	templ := getTestTemplate(t)
	config := newConfig("test", "testproject", templ, m, testManagementZoneApi, "")
	hardeningResult, err := getConfigForEnvironmentAsMap(config, testHardeningEnvironment, make(map[string]api.DynatraceEntity))
	assert.NilError(t, err)
	assert.Equal(t, "Follow the white rabbit", hardeningResult["msg"])
}
func TestGetConfigString(t *testing.T) {
	m := getTestProperties()
	templ := getTestTemplate(t)
	config := newConfig("test", "testproject", templ, m, testManagementZoneApi, "")
	devResult, devErr := getConfigForEnvironmentAsMap(config, testDevEnvironment, make(map[string]api.DynatraceEntity))
	hardeningResult, hardeningErr := getConfigForEnvironmentAsMap(config, testHardeningEnvironment, make(map[string]api.DynatraceEntity))
	assert.NilError(t, devErr)
	assert.NilError(t, hardeningErr)
	assert.Equal(t, "Follow the black squid", devResult["msg"])
	assert.Equal(t, "Follow the white rabbit", hardeningResult["msg"])
}
func TestGetConfigWithGroupOverride(t *testing.T) {
	m := getTestProperties()
	templ := getTestTemplate(t)
	config := newConfig("test", "testproject", templ, m, testManagementZoneApi, "")
	productionResult, err := getConfigForEnvironmentAsMap(config, testProductionEnvironment, make(map[string]api.DynatraceEntity))
	assert.NilError(t, err)
	assert.Equal(t, "Follow the brown dog", productionResult["msg"])
}