Skip to content
This repository was archived by the owner on Aug 9, 2021. It is now read-only.

Commit ec99f20

Browse files
committed
trying to fix scm_github_access_token_type mocking.
1 parent 4669973 commit ec99f20

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

pkg/scm/factory_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ func (suite *ScmTestSuite) TestCreate_Invalid() {
4646

4747
func (suite *ScmTestSuite) TestCreate_Github() {
4848
//setup
49+
suite.Config.EXPECT().SetDefault(gomock.Any(), gomock.Any()).MinTimes(1)
4950
suite.Config.EXPECT().GetString("scm_github_access_token").Return("placeholder")
5051
suite.Config.EXPECT().IsSet("scm_github_api_endpoint").Return(false)
5152
suite.Config.EXPECT().IsSet("scm_github_access_token").Return(true)

pkg/scm/scm_bitbucket_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ func (suite *ScmBitbucketTestSuite) TestScmBitbucket_CheckoutPushPayload() {
275275

276276
func (suite *ScmBitbucketTestSuite) TestScmBitbucket_CheckoutPushPayload_WithInvalidPayload() {
277277
//setup
278+
suite.Config.EXPECT().SetDefault(gomock.Any(), gomock.Any()).MinTimes(1)
278279
suite.Config.EXPECT().IsSet("scm_github_access_token").Return(true) //used by the init function
279280
suite.Config.EXPECT().IsSet("scm_github_api_endpoint").Return(false)
280281
suite.Config.EXPECT().IsSet("scm_git_parent_path").Return(false)

pkg/scm/scm_github_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ func TestScmGithub_CheckoutPushPayload(t *testing.T) {
229229
mockConfig.EXPECT().IsSet("scm_github_access_token").Return(true) //used by the init function
230230
mockConfig.EXPECT().IsSet("scm_github_api_endpoint").Return(false)
231231
mockConfig.EXPECT().GetString("scm_github_access_token").Return("") //set the Access Token to empty string before doing checkout
232+
mockConfig.EXPECT().GetString("scm_github_access_token_type").Return("user") //set the Access Token Type
232233
// (so that git doesnt fail on placeholder token)
233234
mockConfig.EXPECT().IsSet("scm_git_parent_path").Return(false)
234235
mockConfig.EXPECT().IsSet("scm_pull_request").Return(false)

0 commit comments

Comments
 (0)