INFRA-2265 | Ankit Bhardwaj | change getdeploymentPortalurl function arguments

This commit is contained in:
Ankit Bhardwaj
2023-11-08 15:24:00 +05:30
parent e4578c6fb5
commit 5b87189897
2 changed files with 13 additions and 17 deletions

View File

@@ -25,6 +25,9 @@ const elasticCacheTfPath = "elastic-cache-tf"
const dynamoDbTfPath = "dynamo-db-tf"
const documentDbTfPath = "document-db-tf"
const environment = "dev"
const manifestName = "foo"
var manifestFiles = [3]string{"sample_infra_manifest", "sample_infra_manifest_2", "sample_infra_manifest_flink"}
func textDiff(text1, text2 string) string {
@@ -178,11 +181,10 @@ func TestTemplates_AuroraDb_CompareWithOutput(t *testing.T) {
func Test_getDeploymentPortalUrl(t *testing.T) {
testCases := []struct {
name string
manifestFile string
vertical string
expectedURL string
setEnv bool
name string
vertical string
expectedURL string
setEnv bool
}{
{
name: "Correct Lending Vertical URL should be generated",
@@ -223,13 +225,7 @@ func Test_getDeploymentPortalUrl(t *testing.T) {
defer func() {
_ = os.Unsetenv("TESTING_ENV")
}()
testActions, err := setActions(true, false, false)
assert.NoError(t, err)
manifestFile := "sample_infra_manifest.json"
manifest, err := parseManifest(filepath.Join(testDataDir, manifestFile), testActions)
assert.NoError(t, err)
manifest.InfraVertical = testCase.vertical
actualURL := getDeploymentPortalUrl(manifest)
actualURL := getDeploymentPortalUrl(testCase.vertical, environment, manifestName)
assert.Equal(t, testCase.expectedURL, actualURL)
})
}