1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-01-30 05:59:39 +02:00

fix(fortifyExecuteScan): fix project versions api call (#4164)

This commit is contained in:
sumeet patil 2022-12-16 15:22:30 +05:30 committed by GitHub
parent d7cf8654f9
commit 8f761ef15b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -197,7 +197,7 @@ func (sys *SystemInstance) GetProjectByName(projectName string, autoCreate bool,
// GetProjectVersionDetailsByProjectIDAndVersionName returns the project version details of the project version identified by the id and project versionname
// projectName parameter is only used if autoCreate=true
func (sys *SystemInstance) GetProjectVersionDetailsByProjectIDAndVersionName(id int64, versionName string, autoCreate bool, projectName string) (*models.ProjectVersion, error) {
nameParam := fmt.Sprintf("name:%v", versionName)
nameParam := fmt.Sprintf(`name:"%v"`, versionName)
params := &project_version_of_project_controller.ListProjectVersionOfProjectParams{ParentID: id, Q: &nameParam}
params.WithTimeout(sys.timeout)
result, err := sys.client.ProjectVersionOfProjectController.ListProjectVersionOfProject(params, sys)

View File

@ -259,7 +259,7 @@ func TestGetProjectVersionDetailsByProjectIDAndVersionName(t *testing.T) {
"first":{"href":"https://fortify/ssc/api/v1/projects/815/versions?start=0"}}}`))
return
}
if req.URL.Path == "/projects/8888/versions" && req.URL.RawQuery == "q=name%3A1" {
if req.URL.Path == "/projects/8888/versions" && req.URL.RawQuery == "q=name%3A%221%22" {
header := rw.Header()
header.Add("Content-type", "application/json")
rw.Write([]byte(`{"data":[{"id":9910,"project":{"id":8888,"name":"test","description":"Created by Go script","creationDate":"2022-06-24T04:44:12.344+0000",