1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-12 10:55:20 +02:00

Remove obsolete parameter (#2515)

* Remove obsolete parameter

* Update pkg/fortify/fortify_test.go

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>

* Update fortify_test.go

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
This commit is contained in:
Sven Merk 2021-01-15 13:55:13 +01:00 committed by GitHub
parent f22ff9a4d5
commit 205d59c1ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 10 deletions

2
go.mod
View File

@ -44,7 +44,7 @@ require (
github.com/motemen/go-nuts v0.0.0-20200601065735-3df31f16cb2f
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/pierrec/lz4 v2.5.2+incompatible // indirect
github.com/piper-validation/fortify-client-go v0.0.0-20200206215926-532b5b150d22
github.com/piper-validation/fortify-client-go v0.0.0-20210114140201-1261216783c6
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.7.0
github.com/smartystreets/assertions v1.0.0 // indirect

4
go.sum
View File

@ -700,8 +700,8 @@ github.com/pierrec/lz4 v2.5.2+incompatible h1:WCjObylUIOlKy/+7Abdn34TLIkXiA4UWUM
github.com/pierrec/lz4 v2.5.2+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4=
github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8=
github.com/piper-validation/fortify-client-go v0.0.0-20200206215926-532b5b150d22 h1:xSbcGENeXvuG+tu4suCmsr+Vm+p3peYNgJDDxUBeJa8=
github.com/piper-validation/fortify-client-go v0.0.0-20200206215926-532b5b150d22/go.mod h1:EZkdCgngw/tInYdidqDQlRIXvyM1fSbqn/vx83YNCcw=
github.com/piper-validation/fortify-client-go v0.0.0-20210114140201-1261216783c6 h1:OjKQAKjXxa9qV9ZB/fhUEUhfo0H3RSBMg7uE1c9Func=
github.com/piper-validation/fortify-client-go v0.0.0-20210114140201-1261216783c6/go.mod h1:EZkdCgngw/tInYdidqDQlRIXvyM1fSbqn/vx83YNCcw=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=

View File

@ -343,7 +343,6 @@ func (sys *SystemInstance) ProjectVersionCopyFromPartial(sourceID, targetID int6
PreviousProjectVersionID: &sourceID,
CopyAnalysisProcessingRules: &enable,
CopyBugTrackerConfiguration: &enable,
CopyCurrentStateFpr: &enable,
CopyCustomTags: &enable,
}
params := &project_version_controller.CopyProjectVersionParams{Resource: &settings}
@ -357,11 +356,9 @@ func (sys *SystemInstance) ProjectVersionCopyFromPartial(sourceID, targetID int6
// ProjectVersionCopyCurrentState copies the project version state of sourceID into the new project version addressed by targetID
func (sys *SystemInstance) ProjectVersionCopyCurrentState(sourceID, targetID int64) error {
enable := true
settings := models.ProjectVersionCopyCurrentStateRequest{
ProjectVersionID: &targetID,
PreviousProjectVersionID: &sourceID,
CopyCurrentStateFpr: &enable,
}
params := &project_version_controller.CopyCurrentStateForProjectVersionParams{Resource: &settings}
params.WithTimeout(sys.timeout)

View File

@ -3,6 +3,8 @@ package fortify
import (
"fmt"
"io/ioutil"
"net/http"
"net/http/httptest"
"os"
"strings"
"testing"
@ -13,8 +15,6 @@ import (
"github.com/piper-validation/fortify-client-go/models"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"net/http"
"net/http/httptest"
piperHttp "github.com/SAP/jenkins-library/pkg/http"
)
@ -434,7 +434,7 @@ func TestProjectVersionCopyFromPartial(t *testing.T) {
defer server.Close()
t.Run("test success", func(t *testing.T) {
expected := `{"copyAnalysisProcessingRules":true,"copyBugTrackerConfiguration":true,"copyCurrentStateFpr":true,"copyCustomTags":true,"previousProjectVersionId":10172,"projectVersionId":10173}
expected := `{"copyAnalysisProcessingRules":true,"copyBugTrackerConfiguration":true,"copyCustomTags":true,"previousProjectVersionId":10172,"projectVersionId":10173}
`
err := sys.ProjectVersionCopyFromPartial(10172, 10173)
assert.NoError(t, err, "ProjectVersionCopyFromPartial call not successful")
@ -473,7 +473,7 @@ func TestProjectVersionCopyCurrentState(t *testing.T) {
defer server.Close()
t.Run("test success", func(t *testing.T) {
expected := `{"copyCurrentStateFpr":true,"previousProjectVersionId":10172,"projectVersionId":10173}
expected := `{"previousProjectVersionId":10172,"projectVersionId":10173}
`
err := sys.ProjectVersionCopyCurrentState(10172, 10173)
assert.NoError(t, err, "ProjectVersionCopyCurrentState call not successful")