diff --git a/cmd/abapEnvironmentCheckoutBranch_test.go b/cmd/abapEnvironmentCheckoutBranch_test.go index 5ba5334a8a..87bf02fe43 100644 --- a/cmd/abapEnvironmentCheckoutBranch_test.go +++ b/cmd/abapEnvironmentCheckoutBranch_test.go @@ -67,7 +67,7 @@ func TestCheckoutBranchStep(t *testing.T) { StatusCode: 200, } - apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond} + apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond, Force0510: true} err := runAbapEnvironmentCheckoutBranch(&config, &autils, apiManager) assert.NoError(t, err, "Did not expect error") }) @@ -96,7 +96,7 @@ func TestCheckoutBranchStep(t *testing.T) { StatusCode: 200, } - apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond} + apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond, Force0510: true} err := runAbapEnvironmentCheckoutBranch(&config, &autils, apiManager) assert.EqualError(t, err, expectedErrorMessage) }) @@ -135,7 +135,7 @@ func TestCheckoutBranchStep(t *testing.T) { StatusCode: 200, } - apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond} + apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond, Force0510: true} err := runAbapEnvironmentCheckoutBranch(&config, &autils, apiManager) assert.EqualError(t, err, expectedErrorMessage) }) @@ -184,7 +184,7 @@ repositories: Password: "testPassword", Repositories: "repositoriesTest.yml", } - apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond} + apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond, Force0510: true} err = runAbapEnvironmentCheckoutBranch(&config, &autils, apiManager) assert.NoError(t, err) }) @@ -228,7 +228,7 @@ repositories: Password: "testPassword", Repositories: "repositoriesTest.yml", } - apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond} + apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond, Force0510: true} err = runAbapEnvironmentCheckoutBranch(&config, &autils, apiManager) assert.EqualError(t, err, expectedErrorMessage) }) @@ -277,7 +277,7 @@ repositories: Password: "testPassword", Repositories: "repositoriesTest.yml", } - apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond} + apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond, Force0510: true} err = runAbapEnvironmentCheckoutBranch(&config, &autils, apiManager) assert.EqualError(t, err, expectedErrorMessage) }) diff --git a/cmd/abapEnvironmentCloneGitRepo_test.go b/cmd/abapEnvironmentCloneGitRepo_test.go index f009b831f4..ae6f47f75f 100644 --- a/cmd/abapEnvironmentCloneGitRepo_test.go +++ b/cmd/abapEnvironmentCloneGitRepo_test.go @@ -100,7 +100,7 @@ repositories: Token: "myToken", } - apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond} + apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond, Force0510: true} err = runAbapEnvironmentCloneGitRepo(&config, &autils, apiManager) assert.NoError(t, err, "Did not expect error") assert.Equal(t, 0, len(client.BodyList), "Not all requests were done") @@ -140,7 +140,7 @@ repositories: StatusCode: 200, } - apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond} + apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond, Force0510: true} err := runAbapEnvironmentCloneGitRepo(&config, &autils, apiManager) assert.NoError(t, err, "Did not expect error") assert.Equal(t, 0, len(client.BodyList), "Not all requests were done") @@ -177,7 +177,7 @@ repositories: StatusCode: 200, } - apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond} + apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond, Force0510: true} err := runAbapEnvironmentCloneGitRepo(&config, &autils, apiManager) if assert.Error(t, err, "Expected error") { assert.Equal(t, "Clone of repository / software component 'testRepo1', branch 'testBranch1' failed on the ABAP system: Request to ABAP System not successful", err.Error(), "Expected different error message") @@ -239,7 +239,7 @@ repositories: Token: "myToken", StatusCode: 200, } - apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond} + apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond, Force0510: true} err = runAbapEnvironmentCloneGitRepo(&config, &autils, apiManager) if assert.Error(t, err, "Expected error") { assert.Equal(t, "Clone of repository / software component '/DMO/REPO_A', branch 'branchA', commit 'ABCD1234' failed on the ABAP system: Request to ABAP System not successful", err.Error(), "Expected different error message") @@ -275,7 +275,7 @@ repositories: Token: "myToken", StatusCode: 200, } - apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond} + apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond, Force0510: true} err := runAbapEnvironmentCloneGitRepo(&config, &autils, apiManager) if assert.Error(t, err, "Expected error") { assert.Equal(t, "Clone of repository / software component 'testRepo1', branch 'testBranch1' failed on the ABAP system: Request to ABAP System not successful", err.Error(), "Expected different error message") @@ -310,7 +310,7 @@ repositories: Token: "myToken", StatusCode: 200, } - apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond} + apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond, Force0510: true} err := runAbapEnvironmentCloneGitRepo(&config, &autils, apiManager) if assert.Error(t, err, "Expected error") { assert.Equal(t, "Clone of repository / software component 'testRepo1', branch 'testBranch1' failed on the ABAP system: Request to ABAP System not successful", err.Error(), "Expected different error message") @@ -344,7 +344,7 @@ repositories: Token: "myToken", StatusCode: 200, } - apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond} + apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond, Force0510: true} err := runAbapEnvironmentCloneGitRepo(&config, &autils, apiManager) if assert.Error(t, err, "Expected error") { assert.Equal(t, "Could not read repositories: Could not find filename.yaml", err.Error(), "Expected different error message") @@ -385,7 +385,7 @@ repositories: Token: "myToken", StatusCode: 200, } - apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond} + apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond, Force0510: true} err := runAbapEnvironmentCloneGitRepo(&config, &autils, apiManager) if assert.Error(t, err, "Expected error") { assert.Equal(t, "The provided configuration is not allowed: It is not allowed to configure the parameters `repositories`and `repositoryName` at the same time", err.Error(), "Expected different error message") @@ -441,7 +441,7 @@ func TestALreadyCloned(t *testing.T) { CommitID: "abcd1234", } - apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond} + apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond, Force0510: true} err := cloneSingleRepo(apiManager, autils.ReturnedConnectionDetailsHTTP, repo, &config, &autils) assert.NoError(t, err, "Did not expect error") }) @@ -487,7 +487,7 @@ func TestALreadyCloned(t *testing.T) { CommitID: "abcd1234", } - apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond} + apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond, Force0510: true} err := cloneSingleRepo(apiManager, autils.ReturnedConnectionDetailsHTTP, repo, &config, &autils) assert.NoError(t, err, "Did not expect error") }) diff --git a/cmd/abapEnvironmentCreateTag_test.go b/cmd/abapEnvironmentCreateTag_test.go index 996cafd2bf..732f93bcc2 100644 --- a/cmd/abapEnvironmentCreateTag_test.go +++ b/cmd/abapEnvironmentCreateTag_test.go @@ -101,7 +101,7 @@ repositories: _, hook := test.NewNullLogger() log.RegisterHook(hook) - apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond} + apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond, Force0510: true} err = runAbapEnvironmentCreateTag(config, autils, apiManager) assert.NoError(t, err, "Did not expect error") @@ -176,7 +176,7 @@ repositories: _, hook := test.NewNullLogger() log.RegisterHook(hook) - apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond} + apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond, Force0510: true} err = runAbapEnvironmentCreateTag(config, autils, apiManager) assert.Error(t, err, "Did expect error") @@ -228,7 +228,7 @@ func TestRunAbapEnvironmentCreateTagConfigurations(t *testing.T) { _, hook := test.NewNullLogger() log.RegisterHook(hook) - apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond} + apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond, Force0510: true} err := runAbapEnvironmentCreateTag(config, autils, apiManager) assert.NoError(t, err, "Did not expect error") @@ -296,7 +296,7 @@ repositories: StatusCode: 200, } - apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond} + apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond, Force0510: true} err = runAbapEnvironmentCreateTag(config, autils, apiManager) assert.Error(t, err, "Did expect error") @@ -359,7 +359,7 @@ repositories: _, hook := test.NewNullLogger() log.RegisterHook(hook) - apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond} + apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond, Force0510: true} err = runAbapEnvironmentCreateTag(config, autils, apiManager) assert.NoError(t, err, "Did not expect error") diff --git a/cmd/abapEnvironmentPullGitRepo_test.go b/cmd/abapEnvironmentPullGitRepo_test.go index 50e0c5e223..cd805f37d5 100644 --- a/cmd/abapEnvironmentPullGitRepo_test.go +++ b/cmd/abapEnvironmentPullGitRepo_test.go @@ -69,7 +69,7 @@ func TestPullStep(t *testing.T) { StatusCode: 200, } - apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond} + apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond, Force0510: true} err := runAbapEnvironmentPullGitRepo(&config, &autils, apiManager) assert.NoError(t, err, "Did not expect error") assert.Equal(t, 0, len(client.BodyList), "Not all requests were done") @@ -96,7 +96,7 @@ func TestPullStep(t *testing.T) { config := abapEnvironmentPullGitRepoOptions{} - apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond} + apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond, Force0510: true} err := runAbapEnvironmentPullGitRepo(&config, &autils, apiManager) assert.Equal(t, expectedErrorMessage, err.Error(), "Different error message expected") }) @@ -147,7 +147,7 @@ repositories: Password: "testPassword", Repositories: "repositoriesTest.yml", } - apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond} + apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond, Force0510: true} err = runAbapEnvironmentPullGitRepo(&config, &autils, apiManager) assert.NoError(t, err) }) @@ -203,7 +203,7 @@ repositories: StatusCode: 200, } - apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond} + apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond, Force0510: true} err = runAbapEnvironmentPullGitRepo(&config, &autils, apiManager) if assert.Error(t, err, "Expected error") { assert.Equal(t, "Pull of the repository / software component '/DMO/REPO_A', commit 'ABCD1234' failed on the ABAP system", err.Error(), "Expected different error message") @@ -262,7 +262,7 @@ repositories: StatusCode: 200, } - apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond} + apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond, Force0510: true} err = runAbapEnvironmentPullGitRepo(&config, &autils, apiManager) if assert.Error(t, err, "Expected error") { assert.Equal(t, "Pull of the repository / software component '/DMO/REPO_A', tag 'v-1.0.1-build-0001' failed on the ABAP system", err.Error(), "Expected different error message") @@ -302,7 +302,7 @@ repositories: StatusCode: 200, } - apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond} + apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond, Force0510: true} err := runAbapEnvironmentPullGitRepo(&config, &autils, apiManager) if assert.Error(t, err, "Expected error") { assert.Equal(t, "Pull of the repository / software component '/DMO/SWC', commit '123456' failed on the ABAP system", err.Error(), "Expected different error message") @@ -341,7 +341,7 @@ repositories: StatusCode: 200, } - apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond} + apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond, Force0510: true} err := runAbapEnvironmentPullGitRepo(&config, &autils, apiManager) if assert.Error(t, err, "Expected error") { assert.Equal(t, "Pull of the repository / software component '/DMO/SWC' failed on the ABAP system", err.Error(), "Expected different error message") @@ -388,7 +388,7 @@ repositories: Password: "testPassword", Repositories: "repositoriesTest.yml", } - apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond} + apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond, Force0510: true} err = runAbapEnvironmentPullGitRepo(&config, &autils, apiManager) assert.EqualError(t, err, expectedErrorMessage) }) @@ -438,7 +438,7 @@ repositories: Password: "testPassword", Repositories: "repositoriesTest.yml", } - apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond} + apiManager = &abaputils.SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Nanosecond, Force0510: true} err = runAbapEnvironmentPullGitRepo(&config, &autils, apiManager) assert.EqualError(t, err, expectedErrorMessage) }) diff --git a/pkg/abaputils/manageGitRepositoryUtils_test.go b/pkg/abaputils/manageGitRepositoryUtils_test.go index 58a37cb92d..9b6cf3ca3f 100644 --- a/pkg/abaputils/manageGitRepositoryUtils_test.go +++ b/pkg/abaputils/manageGitRepositoryUtils_test.go @@ -59,7 +59,7 @@ func TestPollEntity(t *testing.T) { XCsrfToken: "MY_TOKEN", } - swcManager := SoftwareComponentApiManager{Client: client} + swcManager := SoftwareComponentApiManager{Client: client, Force0510: true} repo := Repository{Name: "testRepo1"} api, _ := swcManager.GetAPI(con, repo) @@ -91,7 +91,7 @@ func TestPollEntity(t *testing.T) { XCsrfToken: "MY_TOKEN", } - swcManager := SoftwareComponentApiManager{Client: client} + swcManager := SoftwareComponentApiManager{Client: client, Force0510: true} repo := Repository{Name: "testRepo1"} api, _ := swcManager.GetAPI(con, repo) diff --git a/pkg/abaputils/sap_com_0510_test.go b/pkg/abaputils/sap_com_0510_test.go index 457751798d..a8b4a5e82a 100644 --- a/pkg/abaputils/sap_com_0510_test.go +++ b/pkg/abaputils/sap_com_0510_test.go @@ -40,7 +40,7 @@ func TestRetry(t *testing.T) { }, } - apiManager := &SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond} + apiManager := &SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond, Force0510: true} api, err := apiManager.GetAPI(con, repo) api.setSleepTimeConfig(time.Nanosecond, 120*time.Nanosecond) @@ -70,7 +70,7 @@ func TestRetry(t *testing.T) { }, } - apiManager := &SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond} + apiManager := &SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond, Force0510: true} api, err := apiManager.GetAPI(con, repo) api.setSleepTimeConfig(time.Nanosecond, 120*time.Nanosecond) @@ -114,7 +114,7 @@ func TestRetry(t *testing.T) { }, } - apiManager := &SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond} + apiManager := &SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond, Force0510: true} api, err := apiManager.GetAPI(con, repo) api.setSleepTimeConfig(time.Nanosecond, 20*time.Nanosecond) @@ -161,7 +161,7 @@ func TestRetry(t *testing.T) { }, } - apiManager := &SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond} + apiManager := &SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond, Force0510: true} api, err := apiManager.GetAPI(con, repo) api.setSleepTimeConfig(time.Nanosecond, 999*time.Nanosecond) @@ -190,7 +190,7 @@ func TestClone(t *testing.T) { StatusCode: 200, } - apiManager := &SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond} + apiManager := &SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond, Force0510: true} api, err := apiManager.GetAPI(con, repo) assert.NoError(t, err) @@ -213,7 +213,7 @@ func TestClone(t *testing.T) { StatusCode: 200, } - apiManager := &SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond} + apiManager := &SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond, Force0510: true} api, err := apiManager.GetAPI(con, repo) api.setSleepTimeConfig(time.Nanosecond, 120*time.Nanosecond) @@ -242,7 +242,7 @@ func TestClone(t *testing.T) { }, } - apiManager := &SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond} + apiManager := &SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond, Force0510: true} api, err := apiManager.GetAPI(con, repo) api.setSleepTimeConfig(time.Nanosecond, 120*time.Nanosecond) @@ -267,7 +267,7 @@ func TestPull(t *testing.T) { StatusCode: 200, } - apiManager := &SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond} + apiManager := &SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond, Force0510: true} api, err := apiManager.GetAPI(con, repo) assert.NoError(t, err) @@ -289,7 +289,7 @@ func TestPull(t *testing.T) { StatusCode: 200, } - apiManager := &SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond} + apiManager := &SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond, Force0510: true} api, err := apiManager.GetAPI(con, repo) assert.NoError(t, err) @@ -313,7 +313,7 @@ func TestCheckout(t *testing.T) { StatusCode: 200, } - apiManager := &SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond} + apiManager := &SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond, Force0510: true} api, err := apiManager.GetAPI(con, repo) assert.NoError(t, err) @@ -335,7 +335,7 @@ func TestCheckout(t *testing.T) { StatusCode: 200, } - apiManager := &SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond} + apiManager := &SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond, Force0510: true} api, err := apiManager.GetAPI(con, repo) assert.NoError(t, err) @@ -359,7 +359,7 @@ func TestGetRepo(t *testing.T) { StatusCode: 200, } - apiManager := &SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond} + apiManager := &SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond, Force0510: true} api, err := apiManager.GetAPI(con, repo) assert.NoError(t, err) @@ -384,7 +384,7 @@ func TestCreateTag(t *testing.T) { StatusCode: 200, } - apiManager := &SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond} + apiManager := &SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond, Force0510: true} api, err := apiManager.GetAPI(con, repo) assert.NoError(t, err) @@ -406,7 +406,7 @@ func TestCreateTag(t *testing.T) { StatusCode: 200, } - apiManager := &SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond} + apiManager := &SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond, Force0510: true} api, err := apiManager.GetAPI(con, repo) assert.NoError(t, err) @@ -428,7 +428,7 @@ func TestCreateTag(t *testing.T) { StatusCode: 200, } - apiManager := &SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond} + apiManager := &SoftwareComponentApiManager{Client: client, PollIntervall: 1 * time.Microsecond, Force0510: true} api, err := apiManager.GetAPI(con, repo) assert.NoError(t, err) diff --git a/pkg/abaputils/softwareComponentApiManager.go b/pkg/abaputils/softwareComponentApiManager.go index efef276f19..56fb9e7a29 100644 --- a/pkg/abaputils/softwareComponentApiManager.go +++ b/pkg/abaputils/softwareComponentApiManager.go @@ -16,17 +16,20 @@ type SoftwareComponentApiManagerInterface interface { type SoftwareComponentApiManager struct { Client piperhttp.Sender PollIntervall time.Duration + Force0510 bool } func (manager *SoftwareComponentApiManager) GetAPI(con ConnectionDetailsHTTP, repo Repository) (SoftwareComponentApiInterface, error) { - // Initialize all APIs, use the one that returns a response - // Currently SAP_COM_0510, later SAP_COM_0948 - sap_com_0948 := SAP_COM_0948{} - sap_com_0948.init(con, manager.Client, repo) - err0948 := sap_com_0948.initialRequest() - if err0948 == nil { - return &sap_com_0948, nil + var err0948 error + if !manager.Force0510 { + // Initialize SAP_COM_0948, if it does not work, use SAP_COM_0510 + sap_com_0948 := SAP_COM_0948{} + sap_com_0948.init(con, manager.Client, repo) + err0948 = sap_com_0948.initialRequest() + if err0948 == nil { + return &sap_com_0948, nil + } } sap_com_0510 := SAP_COM_0510{}