github.com/loafoe/cli@v7.1.0+incompatible/actor/sharedaction/sharedactionfakes/fake_config.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package sharedactionfakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"code.cloudfoundry.org/cli/actor/sharedaction"
     8  )
     9  
    10  type FakeConfig struct {
    11  	AccessTokenStub        func() string
    12  	accessTokenMutex       sync.RWMutex
    13  	accessTokenArgsForCall []struct {
    14  	}
    15  	accessTokenReturns struct {
    16  		result1 string
    17  	}
    18  	accessTokenReturnsOnCall map[int]struct {
    19  		result1 string
    20  	}
    21  	BinaryNameStub        func() string
    22  	binaryNameMutex       sync.RWMutex
    23  	binaryNameArgsForCall []struct {
    24  	}
    25  	binaryNameReturns struct {
    26  		result1 string
    27  	}
    28  	binaryNameReturnsOnCall map[int]struct {
    29  		result1 string
    30  	}
    31  	CurrentUserNameStub        func() (string, error)
    32  	currentUserNameMutex       sync.RWMutex
    33  	currentUserNameArgsForCall []struct {
    34  	}
    35  	currentUserNameReturns struct {
    36  		result1 string
    37  		result2 error
    38  	}
    39  	currentUserNameReturnsOnCall map[int]struct {
    40  		result1 string
    41  		result2 error
    42  	}
    43  	HasTargetedOrganizationStub        func() bool
    44  	hasTargetedOrganizationMutex       sync.RWMutex
    45  	hasTargetedOrganizationArgsForCall []struct {
    46  	}
    47  	hasTargetedOrganizationReturns struct {
    48  		result1 bool
    49  	}
    50  	hasTargetedOrganizationReturnsOnCall map[int]struct {
    51  		result1 bool
    52  	}
    53  	HasTargetedSpaceStub        func() bool
    54  	hasTargetedSpaceMutex       sync.RWMutex
    55  	hasTargetedSpaceArgsForCall []struct {
    56  	}
    57  	hasTargetedSpaceReturns struct {
    58  		result1 bool
    59  	}
    60  	hasTargetedSpaceReturnsOnCall map[int]struct {
    61  		result1 bool
    62  	}
    63  	RefreshTokenStub        func() string
    64  	refreshTokenMutex       sync.RWMutex
    65  	refreshTokenArgsForCall []struct {
    66  	}
    67  	refreshTokenReturns struct {
    68  		result1 string
    69  	}
    70  	refreshTokenReturnsOnCall map[int]struct {
    71  		result1 string
    72  	}
    73  	TargetedOrganizationNameStub        func() string
    74  	targetedOrganizationNameMutex       sync.RWMutex
    75  	targetedOrganizationNameArgsForCall []struct {
    76  	}
    77  	targetedOrganizationNameReturns struct {
    78  		result1 string
    79  	}
    80  	targetedOrganizationNameReturnsOnCall map[int]struct {
    81  		result1 string
    82  	}
    83  	VerboseStub        func() (bool, []string)
    84  	verboseMutex       sync.RWMutex
    85  	verboseArgsForCall []struct {
    86  	}
    87  	verboseReturns struct {
    88  		result1 bool
    89  		result2 []string
    90  	}
    91  	verboseReturnsOnCall map[int]struct {
    92  		result1 bool
    93  		result2 []string
    94  	}
    95  	invocations      map[string][][]interface{}
    96  	invocationsMutex sync.RWMutex
    97  }
    98  
    99  func (fake *FakeConfig) AccessToken() string {
   100  	fake.accessTokenMutex.Lock()
   101  	ret, specificReturn := fake.accessTokenReturnsOnCall[len(fake.accessTokenArgsForCall)]
   102  	fake.accessTokenArgsForCall = append(fake.accessTokenArgsForCall, struct {
   103  	}{})
   104  	fake.recordInvocation("AccessToken", []interface{}{})
   105  	fake.accessTokenMutex.Unlock()
   106  	if fake.AccessTokenStub != nil {
   107  		return fake.AccessTokenStub()
   108  	}
   109  	if specificReturn {
   110  		return ret.result1
   111  	}
   112  	fakeReturns := fake.accessTokenReturns
   113  	return fakeReturns.result1
   114  }
   115  
   116  func (fake *FakeConfig) AccessTokenCallCount() int {
   117  	fake.accessTokenMutex.RLock()
   118  	defer fake.accessTokenMutex.RUnlock()
   119  	return len(fake.accessTokenArgsForCall)
   120  }
   121  
   122  func (fake *FakeConfig) AccessTokenCalls(stub func() string) {
   123  	fake.accessTokenMutex.Lock()
   124  	defer fake.accessTokenMutex.Unlock()
   125  	fake.AccessTokenStub = stub
   126  }
   127  
   128  func (fake *FakeConfig) AccessTokenReturns(result1 string) {
   129  	fake.accessTokenMutex.Lock()
   130  	defer fake.accessTokenMutex.Unlock()
   131  	fake.AccessTokenStub = nil
   132  	fake.accessTokenReturns = struct {
   133  		result1 string
   134  	}{result1}
   135  }
   136  
   137  func (fake *FakeConfig) AccessTokenReturnsOnCall(i int, result1 string) {
   138  	fake.accessTokenMutex.Lock()
   139  	defer fake.accessTokenMutex.Unlock()
   140  	fake.AccessTokenStub = nil
   141  	if fake.accessTokenReturnsOnCall == nil {
   142  		fake.accessTokenReturnsOnCall = make(map[int]struct {
   143  			result1 string
   144  		})
   145  	}
   146  	fake.accessTokenReturnsOnCall[i] = struct {
   147  		result1 string
   148  	}{result1}
   149  }
   150  
   151  func (fake *FakeConfig) BinaryName() string {
   152  	fake.binaryNameMutex.Lock()
   153  	ret, specificReturn := fake.binaryNameReturnsOnCall[len(fake.binaryNameArgsForCall)]
   154  	fake.binaryNameArgsForCall = append(fake.binaryNameArgsForCall, struct {
   155  	}{})
   156  	fake.recordInvocation("BinaryName", []interface{}{})
   157  	fake.binaryNameMutex.Unlock()
   158  	if fake.BinaryNameStub != nil {
   159  		return fake.BinaryNameStub()
   160  	}
   161  	if specificReturn {
   162  		return ret.result1
   163  	}
   164  	fakeReturns := fake.binaryNameReturns
   165  	return fakeReturns.result1
   166  }
   167  
   168  func (fake *FakeConfig) BinaryNameCallCount() int {
   169  	fake.binaryNameMutex.RLock()
   170  	defer fake.binaryNameMutex.RUnlock()
   171  	return len(fake.binaryNameArgsForCall)
   172  }
   173  
   174  func (fake *FakeConfig) BinaryNameCalls(stub func() string) {
   175  	fake.binaryNameMutex.Lock()
   176  	defer fake.binaryNameMutex.Unlock()
   177  	fake.BinaryNameStub = stub
   178  }
   179  
   180  func (fake *FakeConfig) BinaryNameReturns(result1 string) {
   181  	fake.binaryNameMutex.Lock()
   182  	defer fake.binaryNameMutex.Unlock()
   183  	fake.BinaryNameStub = nil
   184  	fake.binaryNameReturns = struct {
   185  		result1 string
   186  	}{result1}
   187  }
   188  
   189  func (fake *FakeConfig) BinaryNameReturnsOnCall(i int, result1 string) {
   190  	fake.binaryNameMutex.Lock()
   191  	defer fake.binaryNameMutex.Unlock()
   192  	fake.BinaryNameStub = nil
   193  	if fake.binaryNameReturnsOnCall == nil {
   194  		fake.binaryNameReturnsOnCall = make(map[int]struct {
   195  			result1 string
   196  		})
   197  	}
   198  	fake.binaryNameReturnsOnCall[i] = struct {
   199  		result1 string
   200  	}{result1}
   201  }
   202  
   203  func (fake *FakeConfig) CurrentUserName() (string, error) {
   204  	fake.currentUserNameMutex.Lock()
   205  	ret, specificReturn := fake.currentUserNameReturnsOnCall[len(fake.currentUserNameArgsForCall)]
   206  	fake.currentUserNameArgsForCall = append(fake.currentUserNameArgsForCall, struct {
   207  	}{})
   208  	fake.recordInvocation("CurrentUserName", []interface{}{})
   209  	fake.currentUserNameMutex.Unlock()
   210  	if fake.CurrentUserNameStub != nil {
   211  		return fake.CurrentUserNameStub()
   212  	}
   213  	if specificReturn {
   214  		return ret.result1, ret.result2
   215  	}
   216  	fakeReturns := fake.currentUserNameReturns
   217  	return fakeReturns.result1, fakeReturns.result2
   218  }
   219  
   220  func (fake *FakeConfig) CurrentUserNameCallCount() int {
   221  	fake.currentUserNameMutex.RLock()
   222  	defer fake.currentUserNameMutex.RUnlock()
   223  	return len(fake.currentUserNameArgsForCall)
   224  }
   225  
   226  func (fake *FakeConfig) CurrentUserNameCalls(stub func() (string, error)) {
   227  	fake.currentUserNameMutex.Lock()
   228  	defer fake.currentUserNameMutex.Unlock()
   229  	fake.CurrentUserNameStub = stub
   230  }
   231  
   232  func (fake *FakeConfig) CurrentUserNameReturns(result1 string, result2 error) {
   233  	fake.currentUserNameMutex.Lock()
   234  	defer fake.currentUserNameMutex.Unlock()
   235  	fake.CurrentUserNameStub = nil
   236  	fake.currentUserNameReturns = struct {
   237  		result1 string
   238  		result2 error
   239  	}{result1, result2}
   240  }
   241  
   242  func (fake *FakeConfig) CurrentUserNameReturnsOnCall(i int, result1 string, result2 error) {
   243  	fake.currentUserNameMutex.Lock()
   244  	defer fake.currentUserNameMutex.Unlock()
   245  	fake.CurrentUserNameStub = nil
   246  	if fake.currentUserNameReturnsOnCall == nil {
   247  		fake.currentUserNameReturnsOnCall = make(map[int]struct {
   248  			result1 string
   249  			result2 error
   250  		})
   251  	}
   252  	fake.currentUserNameReturnsOnCall[i] = struct {
   253  		result1 string
   254  		result2 error
   255  	}{result1, result2}
   256  }
   257  
   258  func (fake *FakeConfig) HasTargetedOrganization() bool {
   259  	fake.hasTargetedOrganizationMutex.Lock()
   260  	ret, specificReturn := fake.hasTargetedOrganizationReturnsOnCall[len(fake.hasTargetedOrganizationArgsForCall)]
   261  	fake.hasTargetedOrganizationArgsForCall = append(fake.hasTargetedOrganizationArgsForCall, struct {
   262  	}{})
   263  	fake.recordInvocation("HasTargetedOrganization", []interface{}{})
   264  	fake.hasTargetedOrganizationMutex.Unlock()
   265  	if fake.HasTargetedOrganizationStub != nil {
   266  		return fake.HasTargetedOrganizationStub()
   267  	}
   268  	if specificReturn {
   269  		return ret.result1
   270  	}
   271  	fakeReturns := fake.hasTargetedOrganizationReturns
   272  	return fakeReturns.result1
   273  }
   274  
   275  func (fake *FakeConfig) HasTargetedOrganizationCallCount() int {
   276  	fake.hasTargetedOrganizationMutex.RLock()
   277  	defer fake.hasTargetedOrganizationMutex.RUnlock()
   278  	return len(fake.hasTargetedOrganizationArgsForCall)
   279  }
   280  
   281  func (fake *FakeConfig) HasTargetedOrganizationCalls(stub func() bool) {
   282  	fake.hasTargetedOrganizationMutex.Lock()
   283  	defer fake.hasTargetedOrganizationMutex.Unlock()
   284  	fake.HasTargetedOrganizationStub = stub
   285  }
   286  
   287  func (fake *FakeConfig) HasTargetedOrganizationReturns(result1 bool) {
   288  	fake.hasTargetedOrganizationMutex.Lock()
   289  	defer fake.hasTargetedOrganizationMutex.Unlock()
   290  	fake.HasTargetedOrganizationStub = nil
   291  	fake.hasTargetedOrganizationReturns = struct {
   292  		result1 bool
   293  	}{result1}
   294  }
   295  
   296  func (fake *FakeConfig) HasTargetedOrganizationReturnsOnCall(i int, result1 bool) {
   297  	fake.hasTargetedOrganizationMutex.Lock()
   298  	defer fake.hasTargetedOrganizationMutex.Unlock()
   299  	fake.HasTargetedOrganizationStub = nil
   300  	if fake.hasTargetedOrganizationReturnsOnCall == nil {
   301  		fake.hasTargetedOrganizationReturnsOnCall = make(map[int]struct {
   302  			result1 bool
   303  		})
   304  	}
   305  	fake.hasTargetedOrganizationReturnsOnCall[i] = struct {
   306  		result1 bool
   307  	}{result1}
   308  }
   309  
   310  func (fake *FakeConfig) HasTargetedSpace() bool {
   311  	fake.hasTargetedSpaceMutex.Lock()
   312  	ret, specificReturn := fake.hasTargetedSpaceReturnsOnCall[len(fake.hasTargetedSpaceArgsForCall)]
   313  	fake.hasTargetedSpaceArgsForCall = append(fake.hasTargetedSpaceArgsForCall, struct {
   314  	}{})
   315  	fake.recordInvocation("HasTargetedSpace", []interface{}{})
   316  	fake.hasTargetedSpaceMutex.Unlock()
   317  	if fake.HasTargetedSpaceStub != nil {
   318  		return fake.HasTargetedSpaceStub()
   319  	}
   320  	if specificReturn {
   321  		return ret.result1
   322  	}
   323  	fakeReturns := fake.hasTargetedSpaceReturns
   324  	return fakeReturns.result1
   325  }
   326  
   327  func (fake *FakeConfig) HasTargetedSpaceCallCount() int {
   328  	fake.hasTargetedSpaceMutex.RLock()
   329  	defer fake.hasTargetedSpaceMutex.RUnlock()
   330  	return len(fake.hasTargetedSpaceArgsForCall)
   331  }
   332  
   333  func (fake *FakeConfig) HasTargetedSpaceCalls(stub func() bool) {
   334  	fake.hasTargetedSpaceMutex.Lock()
   335  	defer fake.hasTargetedSpaceMutex.Unlock()
   336  	fake.HasTargetedSpaceStub = stub
   337  }
   338  
   339  func (fake *FakeConfig) HasTargetedSpaceReturns(result1 bool) {
   340  	fake.hasTargetedSpaceMutex.Lock()
   341  	defer fake.hasTargetedSpaceMutex.Unlock()
   342  	fake.HasTargetedSpaceStub = nil
   343  	fake.hasTargetedSpaceReturns = struct {
   344  		result1 bool
   345  	}{result1}
   346  }
   347  
   348  func (fake *FakeConfig) HasTargetedSpaceReturnsOnCall(i int, result1 bool) {
   349  	fake.hasTargetedSpaceMutex.Lock()
   350  	defer fake.hasTargetedSpaceMutex.Unlock()
   351  	fake.HasTargetedSpaceStub = nil
   352  	if fake.hasTargetedSpaceReturnsOnCall == nil {
   353  		fake.hasTargetedSpaceReturnsOnCall = make(map[int]struct {
   354  			result1 bool
   355  		})
   356  	}
   357  	fake.hasTargetedSpaceReturnsOnCall[i] = struct {
   358  		result1 bool
   359  	}{result1}
   360  }
   361  
   362  func (fake *FakeConfig) RefreshToken() string {
   363  	fake.refreshTokenMutex.Lock()
   364  	ret, specificReturn := fake.refreshTokenReturnsOnCall[len(fake.refreshTokenArgsForCall)]
   365  	fake.refreshTokenArgsForCall = append(fake.refreshTokenArgsForCall, struct {
   366  	}{})
   367  	fake.recordInvocation("RefreshToken", []interface{}{})
   368  	fake.refreshTokenMutex.Unlock()
   369  	if fake.RefreshTokenStub != nil {
   370  		return fake.RefreshTokenStub()
   371  	}
   372  	if specificReturn {
   373  		return ret.result1
   374  	}
   375  	fakeReturns := fake.refreshTokenReturns
   376  	return fakeReturns.result1
   377  }
   378  
   379  func (fake *FakeConfig) RefreshTokenCallCount() int {
   380  	fake.refreshTokenMutex.RLock()
   381  	defer fake.refreshTokenMutex.RUnlock()
   382  	return len(fake.refreshTokenArgsForCall)
   383  }
   384  
   385  func (fake *FakeConfig) RefreshTokenCalls(stub func() string) {
   386  	fake.refreshTokenMutex.Lock()
   387  	defer fake.refreshTokenMutex.Unlock()
   388  	fake.RefreshTokenStub = stub
   389  }
   390  
   391  func (fake *FakeConfig) RefreshTokenReturns(result1 string) {
   392  	fake.refreshTokenMutex.Lock()
   393  	defer fake.refreshTokenMutex.Unlock()
   394  	fake.RefreshTokenStub = nil
   395  	fake.refreshTokenReturns = struct {
   396  		result1 string
   397  	}{result1}
   398  }
   399  
   400  func (fake *FakeConfig) RefreshTokenReturnsOnCall(i int, result1 string) {
   401  	fake.refreshTokenMutex.Lock()
   402  	defer fake.refreshTokenMutex.Unlock()
   403  	fake.RefreshTokenStub = nil
   404  	if fake.refreshTokenReturnsOnCall == nil {
   405  		fake.refreshTokenReturnsOnCall = make(map[int]struct {
   406  			result1 string
   407  		})
   408  	}
   409  	fake.refreshTokenReturnsOnCall[i] = struct {
   410  		result1 string
   411  	}{result1}
   412  }
   413  
   414  func (fake *FakeConfig) TargetedOrganizationName() string {
   415  	fake.targetedOrganizationNameMutex.Lock()
   416  	ret, specificReturn := fake.targetedOrganizationNameReturnsOnCall[len(fake.targetedOrganizationNameArgsForCall)]
   417  	fake.targetedOrganizationNameArgsForCall = append(fake.targetedOrganizationNameArgsForCall, struct {
   418  	}{})
   419  	fake.recordInvocation("TargetedOrganizationName", []interface{}{})
   420  	fake.targetedOrganizationNameMutex.Unlock()
   421  	if fake.TargetedOrganizationNameStub != nil {
   422  		return fake.TargetedOrganizationNameStub()
   423  	}
   424  	if specificReturn {
   425  		return ret.result1
   426  	}
   427  	fakeReturns := fake.targetedOrganizationNameReturns
   428  	return fakeReturns.result1
   429  }
   430  
   431  func (fake *FakeConfig) TargetedOrganizationNameCallCount() int {
   432  	fake.targetedOrganizationNameMutex.RLock()
   433  	defer fake.targetedOrganizationNameMutex.RUnlock()
   434  	return len(fake.targetedOrganizationNameArgsForCall)
   435  }
   436  
   437  func (fake *FakeConfig) TargetedOrganizationNameCalls(stub func() string) {
   438  	fake.targetedOrganizationNameMutex.Lock()
   439  	defer fake.targetedOrganizationNameMutex.Unlock()
   440  	fake.TargetedOrganizationNameStub = stub
   441  }
   442  
   443  func (fake *FakeConfig) TargetedOrganizationNameReturns(result1 string) {
   444  	fake.targetedOrganizationNameMutex.Lock()
   445  	defer fake.targetedOrganizationNameMutex.Unlock()
   446  	fake.TargetedOrganizationNameStub = nil
   447  	fake.targetedOrganizationNameReturns = struct {
   448  		result1 string
   449  	}{result1}
   450  }
   451  
   452  func (fake *FakeConfig) TargetedOrganizationNameReturnsOnCall(i int, result1 string) {
   453  	fake.targetedOrganizationNameMutex.Lock()
   454  	defer fake.targetedOrganizationNameMutex.Unlock()
   455  	fake.TargetedOrganizationNameStub = nil
   456  	if fake.targetedOrganizationNameReturnsOnCall == nil {
   457  		fake.targetedOrganizationNameReturnsOnCall = make(map[int]struct {
   458  			result1 string
   459  		})
   460  	}
   461  	fake.targetedOrganizationNameReturnsOnCall[i] = struct {
   462  		result1 string
   463  	}{result1}
   464  }
   465  
   466  func (fake *FakeConfig) Verbose() (bool, []string) {
   467  	fake.verboseMutex.Lock()
   468  	ret, specificReturn := fake.verboseReturnsOnCall[len(fake.verboseArgsForCall)]
   469  	fake.verboseArgsForCall = append(fake.verboseArgsForCall, struct {
   470  	}{})
   471  	fake.recordInvocation("Verbose", []interface{}{})
   472  	fake.verboseMutex.Unlock()
   473  	if fake.VerboseStub != nil {
   474  		return fake.VerboseStub()
   475  	}
   476  	if specificReturn {
   477  		return ret.result1, ret.result2
   478  	}
   479  	fakeReturns := fake.verboseReturns
   480  	return fakeReturns.result1, fakeReturns.result2
   481  }
   482  
   483  func (fake *FakeConfig) VerboseCallCount() int {
   484  	fake.verboseMutex.RLock()
   485  	defer fake.verboseMutex.RUnlock()
   486  	return len(fake.verboseArgsForCall)
   487  }
   488  
   489  func (fake *FakeConfig) VerboseCalls(stub func() (bool, []string)) {
   490  	fake.verboseMutex.Lock()
   491  	defer fake.verboseMutex.Unlock()
   492  	fake.VerboseStub = stub
   493  }
   494  
   495  func (fake *FakeConfig) VerboseReturns(result1 bool, result2 []string) {
   496  	fake.verboseMutex.Lock()
   497  	defer fake.verboseMutex.Unlock()
   498  	fake.VerboseStub = nil
   499  	fake.verboseReturns = struct {
   500  		result1 bool
   501  		result2 []string
   502  	}{result1, result2}
   503  }
   504  
   505  func (fake *FakeConfig) VerboseReturnsOnCall(i int, result1 bool, result2 []string) {
   506  	fake.verboseMutex.Lock()
   507  	defer fake.verboseMutex.Unlock()
   508  	fake.VerboseStub = nil
   509  	if fake.verboseReturnsOnCall == nil {
   510  		fake.verboseReturnsOnCall = make(map[int]struct {
   511  			result1 bool
   512  			result2 []string
   513  		})
   514  	}
   515  	fake.verboseReturnsOnCall[i] = struct {
   516  		result1 bool
   517  		result2 []string
   518  	}{result1, result2}
   519  }
   520  
   521  func (fake *FakeConfig) Invocations() map[string][][]interface{} {
   522  	fake.invocationsMutex.RLock()
   523  	defer fake.invocationsMutex.RUnlock()
   524  	fake.accessTokenMutex.RLock()
   525  	defer fake.accessTokenMutex.RUnlock()
   526  	fake.binaryNameMutex.RLock()
   527  	defer fake.binaryNameMutex.RUnlock()
   528  	fake.currentUserNameMutex.RLock()
   529  	defer fake.currentUserNameMutex.RUnlock()
   530  	fake.hasTargetedOrganizationMutex.RLock()
   531  	defer fake.hasTargetedOrganizationMutex.RUnlock()
   532  	fake.hasTargetedSpaceMutex.RLock()
   533  	defer fake.hasTargetedSpaceMutex.RUnlock()
   534  	fake.refreshTokenMutex.RLock()
   535  	defer fake.refreshTokenMutex.RUnlock()
   536  	fake.targetedOrganizationNameMutex.RLock()
   537  	defer fake.targetedOrganizationNameMutex.RUnlock()
   538  	fake.verboseMutex.RLock()
   539  	defer fake.verboseMutex.RUnlock()
   540  	copiedInvocations := map[string][][]interface{}{}
   541  	for key, value := range fake.invocations {
   542  		copiedInvocations[key] = value
   543  	}
   544  	return copiedInvocations
   545  }
   546  
   547  func (fake *FakeConfig) recordInvocation(key string, args []interface{}) {
   548  	fake.invocationsMutex.Lock()
   549  	defer fake.invocationsMutex.Unlock()
   550  	if fake.invocations == nil {
   551  		fake.invocations = map[string][][]interface{}{}
   552  	}
   553  	if fake.invocations[key] == nil {
   554  		fake.invocations[key] = [][]interface{}{}
   555  	}
   556  	fake.invocations[key] = append(fake.invocations[key], args)
   557  }
   558  
   559  var _ sharedaction.Config = new(FakeConfig)