diff --git a/cmd/mtaBuild.go b/cmd/mtaBuild.go index a318641f8..e0c81a017 100644 --- a/cmd/mtaBuild.go +++ b/cmd/mtaBuild.go @@ -228,15 +228,15 @@ func getMtarName(config mtaBuildOptions, mtaYamlFile string, p piperutils.FileUt } if len(mtaID) == 0 { - return "", fmt.Errorf("Invalid mtar name. Was empty") + return "", fmt.Errorf("Invalid mtar ID. Was empty") } log.Entry().Debugf("mtar name extracted from file \"%s\": \"%s\"", mtaYamlFile, mtaID) - mtarName = mtaID + mtarName = mtaID + ".mtar" } - return mtarName + ".mtar", nil + return mtarName, nil } diff --git a/cmd/mtaBuild_test.go b/cmd/mtaBuild_test.go index a770bc03b..5077911eb 100644 --- a/cmd/mtaBuild_test.go +++ b/cmd/mtaBuild_test.go @@ -163,7 +163,7 @@ func TestMarBuild(t *testing.T) { e := mock.ExecMockRunner{} - options := mtaBuildOptions{ApplicationName: "myApp", MtaBuildTool: "classic", BuildTarget: "CF", MtarName: "myName"} + options := mtaBuildOptions{ApplicationName: "myApp", MtaBuildTool: "classic", BuildTarget: "CF", MtarName: "myName.mtar"} cpe.mtarFilePath = "" @@ -210,7 +210,7 @@ func TestMarBuild(t *testing.T) { e := mock.ExecMockRunner{} - options := mtaBuildOptions{ApplicationName: "myApp", MtaBuildTool: "classic", BuildTarget: "CF", MtaJarLocation: "/opt/sap/mta/lib/mta.jar", MtarName: "myName"} + options := mtaBuildOptions{ApplicationName: "myApp", MtaBuildTool: "classic", BuildTarget: "CF", MtaJarLocation: "/opt/sap/mta/lib/mta.jar", MtarName: "myName.mtar"} existingFiles := make(map[string]string) existingFiles["package.json"] = "{\"name\": \"myName\", \"version\": \"1.2.3\"}" @@ -232,7 +232,7 @@ func TestMarBuild(t *testing.T) { cpe.mtarFilePath = "" - options := mtaBuildOptions{ApplicationName: "myApp", MtaBuildTool: "cloudMbt", Platform: "CF", MtarName: "myName"} + options := mtaBuildOptions{ApplicationName: "myApp", MtaBuildTool: "cloudMbt", Platform: "CF", MtarName: "myName.mtar"} existingFiles := make(map[string]string) existingFiles["package.json"] = "{\"name\": \"myName\", \"version\": \"1.2.3\"}"