INFRA-2265 | Ankit Bhardwaj | change getdeploymentPortalurl function arguments
This commit is contained in:
20
main_test.go
20
main_test.go
@@ -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)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user