github.com/kyma-project/kyma-environment-broker@v0.0.1/internal/avs/config_test.go (about)

     1  package avs_test
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/kyma-project/kyma-environment-broker/internal/avs"
     7  	"github.com/stretchr/testify/assert"
     8  	"github.com/stretchr/testify/require"
     9  )
    10  
    11  const (
    12  	maintenanceModeGAIDsYamlFilePath = "testdata/avs_maintenance_mode_always_disabled_ga_ids.yaml"
    13  )
    14  
    15  func TestConfig_ReadMaintenanceModeDuringUpgradeAlwaysDisabledGAIDsFromYaml(t *testing.T) {
    16  	// given
    17  	avsConfig := avs.Config{}
    18  	expectedGAID1, expectedGAID2 := "test-ga-id-1", "test-ga-id-2"
    19  
    20  	// when
    21  	err := avsConfig.ReadMaintenanceModeDuringUpgradeAlwaysDisabledGAIDsFromYaml(maintenanceModeGAIDsYamlFilePath)
    22  	require.NoError(t, err)
    23  
    24  	// then
    25  	assert.Contains(t, avsConfig.MaintenanceModeDuringUpgradeAlwaysDisabledGAIDs, expectedGAID1)
    26  	assert.Contains(t, avsConfig.MaintenanceModeDuringUpgradeAlwaysDisabledGAIDs, expectedGAID2)
    27  }