From 205d59c1ed3e7ecad8aab1e022f435a688edbed1 Mon Sep 17 00:00:00 2001 From: Sven Merk <33895725+nevskrem@users.noreply.github.com> Date: Fri, 15 Jan 2021 13:55:13 +0100 Subject: [PATCH] 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> --- go.mod | 2 +- go.sum | 4 ++-- pkg/fortify/fortify.go | 3 --- pkg/fortify/fortify_test.go | 8 ++++---- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index 4e9c2a8b6..ff8c72a84 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index 615406937..4dd47947a 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/pkg/fortify/fortify.go b/pkg/fortify/fortify.go index 78e953f30..a923b84d4 100644 --- a/pkg/fortify/fortify.go +++ b/pkg/fortify/fortify.go @@ -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) diff --git a/pkg/fortify/fortify_test.go b/pkg/fortify/fortify_test.go index 0417cbc70..44a49ccea 100644 --- a/pkg/fortify/fortify_test.go +++ b/pkg/fortify/fortify_test.go @@ -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")