github.com/cloudfoundry-community/cloudfoundry-cli@v6.44.1-0.20240130060226-cda5ed8e89a5+incompatible/actor/v7action/v7actionfakes/fake_config.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package v7actionfakes
     3  
     4  import (
     5  	"sync"
     6  	"time"
     7  
     8  	"code.cloudfoundry.org/cli/actor/v7action"
     9  )
    10  
    11  type FakeConfig struct {
    12  	AccessTokenStub        func() string
    13  	accessTokenMutex       sync.RWMutex
    14  	accessTokenArgsForCall []struct {
    15  	}
    16  	accessTokenReturns struct {
    17  		result1 string
    18  	}
    19  	accessTokenReturnsOnCall map[int]struct {
    20  		result1 string
    21  	}
    22  	DialTimeoutStub        func() time.Duration
    23  	dialTimeoutMutex       sync.RWMutex
    24  	dialTimeoutArgsForCall []struct {
    25  	}
    26  	dialTimeoutReturns struct {
    27  		result1 time.Duration
    28  	}
    29  	dialTimeoutReturnsOnCall map[int]struct {
    30  		result1 time.Duration
    31  	}
    32  	PollingIntervalStub        func() time.Duration
    33  	pollingIntervalMutex       sync.RWMutex
    34  	pollingIntervalArgsForCall []struct {
    35  	}
    36  	pollingIntervalReturns struct {
    37  		result1 time.Duration
    38  	}
    39  	pollingIntervalReturnsOnCall map[int]struct {
    40  		result1 time.Duration
    41  	}
    42  	SSHOAuthClientStub        func() string
    43  	sSHOAuthClientMutex       sync.RWMutex
    44  	sSHOAuthClientArgsForCall []struct {
    45  	}
    46  	sSHOAuthClientReturns struct {
    47  		result1 string
    48  	}
    49  	sSHOAuthClientReturnsOnCall map[int]struct {
    50  		result1 string
    51  	}
    52  	StagingTimeoutStub        func() time.Duration
    53  	stagingTimeoutMutex       sync.RWMutex
    54  	stagingTimeoutArgsForCall []struct {
    55  	}
    56  	stagingTimeoutReturns struct {
    57  		result1 time.Duration
    58  	}
    59  	stagingTimeoutReturnsOnCall map[int]struct {
    60  		result1 time.Duration
    61  	}
    62  	StartupTimeoutStub        func() time.Duration
    63  	startupTimeoutMutex       sync.RWMutex
    64  	startupTimeoutArgsForCall []struct {
    65  	}
    66  	startupTimeoutReturns struct {
    67  		result1 time.Duration
    68  	}
    69  	startupTimeoutReturnsOnCall map[int]struct {
    70  		result1 time.Duration
    71  	}
    72  	invocations      map[string][][]interface{}
    73  	invocationsMutex sync.RWMutex
    74  }
    75  
    76  func (fake *FakeConfig) AccessToken() string {
    77  	fake.accessTokenMutex.Lock()
    78  	ret, specificReturn := fake.accessTokenReturnsOnCall[len(fake.accessTokenArgsForCall)]
    79  	fake.accessTokenArgsForCall = append(fake.accessTokenArgsForCall, struct {
    80  	}{})
    81  	fake.recordInvocation("AccessToken", []interface{}{})
    82  	fake.accessTokenMutex.Unlock()
    83  	if fake.AccessTokenStub != nil {
    84  		return fake.AccessTokenStub()
    85  	}
    86  	if specificReturn {
    87  		return ret.result1
    88  	}
    89  	fakeReturns := fake.accessTokenReturns
    90  	return fakeReturns.result1
    91  }
    92  
    93  func (fake *FakeConfig) AccessTokenCallCount() int {
    94  	fake.accessTokenMutex.RLock()
    95  	defer fake.accessTokenMutex.RUnlock()
    96  	return len(fake.accessTokenArgsForCall)
    97  }
    98  
    99  func (fake *FakeConfig) AccessTokenCalls(stub func() string) {
   100  	fake.accessTokenMutex.Lock()
   101  	defer fake.accessTokenMutex.Unlock()
   102  	fake.AccessTokenStub = stub
   103  }
   104  
   105  func (fake *FakeConfig) AccessTokenReturns(result1 string) {
   106  	fake.accessTokenMutex.Lock()
   107  	defer fake.accessTokenMutex.Unlock()
   108  	fake.AccessTokenStub = nil
   109  	fake.accessTokenReturns = struct {
   110  		result1 string
   111  	}{result1}
   112  }
   113  
   114  func (fake *FakeConfig) AccessTokenReturnsOnCall(i int, result1 string) {
   115  	fake.accessTokenMutex.Lock()
   116  	defer fake.accessTokenMutex.Unlock()
   117  	fake.AccessTokenStub = nil
   118  	if fake.accessTokenReturnsOnCall == nil {
   119  		fake.accessTokenReturnsOnCall = make(map[int]struct {
   120  			result1 string
   121  		})
   122  	}
   123  	fake.accessTokenReturnsOnCall[i] = struct {
   124  		result1 string
   125  	}{result1}
   126  }
   127  
   128  func (fake *FakeConfig) DialTimeout() time.Duration {
   129  	fake.dialTimeoutMutex.Lock()
   130  	ret, specificReturn := fake.dialTimeoutReturnsOnCall[len(fake.dialTimeoutArgsForCall)]
   131  	fake.dialTimeoutArgsForCall = append(fake.dialTimeoutArgsForCall, struct {
   132  	}{})
   133  	fake.recordInvocation("DialTimeout", []interface{}{})
   134  	fake.dialTimeoutMutex.Unlock()
   135  	if fake.DialTimeoutStub != nil {
   136  		return fake.DialTimeoutStub()
   137  	}
   138  	if specificReturn {
   139  		return ret.result1
   140  	}
   141  	fakeReturns := fake.dialTimeoutReturns
   142  	return fakeReturns.result1
   143  }
   144  
   145  func (fake *FakeConfig) DialTimeoutCallCount() int {
   146  	fake.dialTimeoutMutex.RLock()
   147  	defer fake.dialTimeoutMutex.RUnlock()
   148  	return len(fake.dialTimeoutArgsForCall)
   149  }
   150  
   151  func (fake *FakeConfig) DialTimeoutCalls(stub func() time.Duration) {
   152  	fake.dialTimeoutMutex.Lock()
   153  	defer fake.dialTimeoutMutex.Unlock()
   154  	fake.DialTimeoutStub = stub
   155  }
   156  
   157  func (fake *FakeConfig) DialTimeoutReturns(result1 time.Duration) {
   158  	fake.dialTimeoutMutex.Lock()
   159  	defer fake.dialTimeoutMutex.Unlock()
   160  	fake.DialTimeoutStub = nil
   161  	fake.dialTimeoutReturns = struct {
   162  		result1 time.Duration
   163  	}{result1}
   164  }
   165  
   166  func (fake *FakeConfig) DialTimeoutReturnsOnCall(i int, result1 time.Duration) {
   167  	fake.dialTimeoutMutex.Lock()
   168  	defer fake.dialTimeoutMutex.Unlock()
   169  	fake.DialTimeoutStub = nil
   170  	if fake.dialTimeoutReturnsOnCall == nil {
   171  		fake.dialTimeoutReturnsOnCall = make(map[int]struct {
   172  			result1 time.Duration
   173  		})
   174  	}
   175  	fake.dialTimeoutReturnsOnCall[i] = struct {
   176  		result1 time.Duration
   177  	}{result1}
   178  }
   179  
   180  func (fake *FakeConfig) PollingInterval() time.Duration {
   181  	fake.pollingIntervalMutex.Lock()
   182  	ret, specificReturn := fake.pollingIntervalReturnsOnCall[len(fake.pollingIntervalArgsForCall)]
   183  	fake.pollingIntervalArgsForCall = append(fake.pollingIntervalArgsForCall, struct {
   184  	}{})
   185  	fake.recordInvocation("PollingInterval", []interface{}{})
   186  	fake.pollingIntervalMutex.Unlock()
   187  	if fake.PollingIntervalStub != nil {
   188  		return fake.PollingIntervalStub()
   189  	}
   190  	if specificReturn {
   191  		return ret.result1
   192  	}
   193  	fakeReturns := fake.pollingIntervalReturns
   194  	return fakeReturns.result1
   195  }
   196  
   197  func (fake *FakeConfig) PollingIntervalCallCount() int {
   198  	fake.pollingIntervalMutex.RLock()
   199  	defer fake.pollingIntervalMutex.RUnlock()
   200  	return len(fake.pollingIntervalArgsForCall)
   201  }
   202  
   203  func (fake *FakeConfig) PollingIntervalCalls(stub func() time.Duration) {
   204  	fake.pollingIntervalMutex.Lock()
   205  	defer fake.pollingIntervalMutex.Unlock()
   206  	fake.PollingIntervalStub = stub
   207  }
   208  
   209  func (fake *FakeConfig) PollingIntervalReturns(result1 time.Duration) {
   210  	fake.pollingIntervalMutex.Lock()
   211  	defer fake.pollingIntervalMutex.Unlock()
   212  	fake.PollingIntervalStub = nil
   213  	fake.pollingIntervalReturns = struct {
   214  		result1 time.Duration
   215  	}{result1}
   216  }
   217  
   218  func (fake *FakeConfig) PollingIntervalReturnsOnCall(i int, result1 time.Duration) {
   219  	fake.pollingIntervalMutex.Lock()
   220  	defer fake.pollingIntervalMutex.Unlock()
   221  	fake.PollingIntervalStub = nil
   222  	if fake.pollingIntervalReturnsOnCall == nil {
   223  		fake.pollingIntervalReturnsOnCall = make(map[int]struct {
   224  			result1 time.Duration
   225  		})
   226  	}
   227  	fake.pollingIntervalReturnsOnCall[i] = struct {
   228  		result1 time.Duration
   229  	}{result1}
   230  }
   231  
   232  func (fake *FakeConfig) SSHOAuthClient() string {
   233  	fake.sSHOAuthClientMutex.Lock()
   234  	ret, specificReturn := fake.sSHOAuthClientReturnsOnCall[len(fake.sSHOAuthClientArgsForCall)]
   235  	fake.sSHOAuthClientArgsForCall = append(fake.sSHOAuthClientArgsForCall, struct {
   236  	}{})
   237  	fake.recordInvocation("SSHOAuthClient", []interface{}{})
   238  	fake.sSHOAuthClientMutex.Unlock()
   239  	if fake.SSHOAuthClientStub != nil {
   240  		return fake.SSHOAuthClientStub()
   241  	}
   242  	if specificReturn {
   243  		return ret.result1
   244  	}
   245  	fakeReturns := fake.sSHOAuthClientReturns
   246  	return fakeReturns.result1
   247  }
   248  
   249  func (fake *FakeConfig) SSHOAuthClientCallCount() int {
   250  	fake.sSHOAuthClientMutex.RLock()
   251  	defer fake.sSHOAuthClientMutex.RUnlock()
   252  	return len(fake.sSHOAuthClientArgsForCall)
   253  }
   254  
   255  func (fake *FakeConfig) SSHOAuthClientCalls(stub func() string) {
   256  	fake.sSHOAuthClientMutex.Lock()
   257  	defer fake.sSHOAuthClientMutex.Unlock()
   258  	fake.SSHOAuthClientStub = stub
   259  }
   260  
   261  func (fake *FakeConfig) SSHOAuthClientReturns(result1 string) {
   262  	fake.sSHOAuthClientMutex.Lock()
   263  	defer fake.sSHOAuthClientMutex.Unlock()
   264  	fake.SSHOAuthClientStub = nil
   265  	fake.sSHOAuthClientReturns = struct {
   266  		result1 string
   267  	}{result1}
   268  }
   269  
   270  func (fake *FakeConfig) SSHOAuthClientReturnsOnCall(i int, result1 string) {
   271  	fake.sSHOAuthClientMutex.Lock()
   272  	defer fake.sSHOAuthClientMutex.Unlock()
   273  	fake.SSHOAuthClientStub = nil
   274  	if fake.sSHOAuthClientReturnsOnCall == nil {
   275  		fake.sSHOAuthClientReturnsOnCall = make(map[int]struct {
   276  			result1 string
   277  		})
   278  	}
   279  	fake.sSHOAuthClientReturnsOnCall[i] = struct {
   280  		result1 string
   281  	}{result1}
   282  }
   283  
   284  func (fake *FakeConfig) StagingTimeout() time.Duration {
   285  	fake.stagingTimeoutMutex.Lock()
   286  	ret, specificReturn := fake.stagingTimeoutReturnsOnCall[len(fake.stagingTimeoutArgsForCall)]
   287  	fake.stagingTimeoutArgsForCall = append(fake.stagingTimeoutArgsForCall, struct {
   288  	}{})
   289  	fake.recordInvocation("StagingTimeout", []interface{}{})
   290  	fake.stagingTimeoutMutex.Unlock()
   291  	if fake.StagingTimeoutStub != nil {
   292  		return fake.StagingTimeoutStub()
   293  	}
   294  	if specificReturn {
   295  		return ret.result1
   296  	}
   297  	fakeReturns := fake.stagingTimeoutReturns
   298  	return fakeReturns.result1
   299  }
   300  
   301  func (fake *FakeConfig) StagingTimeoutCallCount() int {
   302  	fake.stagingTimeoutMutex.RLock()
   303  	defer fake.stagingTimeoutMutex.RUnlock()
   304  	return len(fake.stagingTimeoutArgsForCall)
   305  }
   306  
   307  func (fake *FakeConfig) StagingTimeoutCalls(stub func() time.Duration) {
   308  	fake.stagingTimeoutMutex.Lock()
   309  	defer fake.stagingTimeoutMutex.Unlock()
   310  	fake.StagingTimeoutStub = stub
   311  }
   312  
   313  func (fake *FakeConfig) StagingTimeoutReturns(result1 time.Duration) {
   314  	fake.stagingTimeoutMutex.Lock()
   315  	defer fake.stagingTimeoutMutex.Unlock()
   316  	fake.StagingTimeoutStub = nil
   317  	fake.stagingTimeoutReturns = struct {
   318  		result1 time.Duration
   319  	}{result1}
   320  }
   321  
   322  func (fake *FakeConfig) StagingTimeoutReturnsOnCall(i int, result1 time.Duration) {
   323  	fake.stagingTimeoutMutex.Lock()
   324  	defer fake.stagingTimeoutMutex.Unlock()
   325  	fake.StagingTimeoutStub = nil
   326  	if fake.stagingTimeoutReturnsOnCall == nil {
   327  		fake.stagingTimeoutReturnsOnCall = make(map[int]struct {
   328  			result1 time.Duration
   329  		})
   330  	}
   331  	fake.stagingTimeoutReturnsOnCall[i] = struct {
   332  		result1 time.Duration
   333  	}{result1}
   334  }
   335  
   336  func (fake *FakeConfig) StartupTimeout() time.Duration {
   337  	fake.startupTimeoutMutex.Lock()
   338  	ret, specificReturn := fake.startupTimeoutReturnsOnCall[len(fake.startupTimeoutArgsForCall)]
   339  	fake.startupTimeoutArgsForCall = append(fake.startupTimeoutArgsForCall, struct {
   340  	}{})
   341  	fake.recordInvocation("StartupTimeout", []interface{}{})
   342  	fake.startupTimeoutMutex.Unlock()
   343  	if fake.StartupTimeoutStub != nil {
   344  		return fake.StartupTimeoutStub()
   345  	}
   346  	if specificReturn {
   347  		return ret.result1
   348  	}
   349  	fakeReturns := fake.startupTimeoutReturns
   350  	return fakeReturns.result1
   351  }
   352  
   353  func (fake *FakeConfig) StartupTimeoutCallCount() int {
   354  	fake.startupTimeoutMutex.RLock()
   355  	defer fake.startupTimeoutMutex.RUnlock()
   356  	return len(fake.startupTimeoutArgsForCall)
   357  }
   358  
   359  func (fake *FakeConfig) StartupTimeoutCalls(stub func() time.Duration) {
   360  	fake.startupTimeoutMutex.Lock()
   361  	defer fake.startupTimeoutMutex.Unlock()
   362  	fake.StartupTimeoutStub = stub
   363  }
   364  
   365  func (fake *FakeConfig) StartupTimeoutReturns(result1 time.Duration) {
   366  	fake.startupTimeoutMutex.Lock()
   367  	defer fake.startupTimeoutMutex.Unlock()
   368  	fake.StartupTimeoutStub = nil
   369  	fake.startupTimeoutReturns = struct {
   370  		result1 time.Duration
   371  	}{result1}
   372  }
   373  
   374  func (fake *FakeConfig) StartupTimeoutReturnsOnCall(i int, result1 time.Duration) {
   375  	fake.startupTimeoutMutex.Lock()
   376  	defer fake.startupTimeoutMutex.Unlock()
   377  	fake.StartupTimeoutStub = nil
   378  	if fake.startupTimeoutReturnsOnCall == nil {
   379  		fake.startupTimeoutReturnsOnCall = make(map[int]struct {
   380  			result1 time.Duration
   381  		})
   382  	}
   383  	fake.startupTimeoutReturnsOnCall[i] = struct {
   384  		result1 time.Duration
   385  	}{result1}
   386  }
   387  
   388  func (fake *FakeConfig) Invocations() map[string][][]interface{} {
   389  	fake.invocationsMutex.RLock()
   390  	defer fake.invocationsMutex.RUnlock()
   391  	fake.accessTokenMutex.RLock()
   392  	defer fake.accessTokenMutex.RUnlock()
   393  	fake.dialTimeoutMutex.RLock()
   394  	defer fake.dialTimeoutMutex.RUnlock()
   395  	fake.pollingIntervalMutex.RLock()
   396  	defer fake.pollingIntervalMutex.RUnlock()
   397  	fake.sSHOAuthClientMutex.RLock()
   398  	defer fake.sSHOAuthClientMutex.RUnlock()
   399  	fake.stagingTimeoutMutex.RLock()
   400  	defer fake.stagingTimeoutMutex.RUnlock()
   401  	fake.startupTimeoutMutex.RLock()
   402  	defer fake.startupTimeoutMutex.RUnlock()
   403  	copiedInvocations := map[string][][]interface{}{}
   404  	for key, value := range fake.invocations {
   405  		copiedInvocations[key] = value
   406  	}
   407  	return copiedInvocations
   408  }
   409  
   410  func (fake *FakeConfig) recordInvocation(key string, args []interface{}) {
   411  	fake.invocationsMutex.Lock()
   412  	defer fake.invocationsMutex.Unlock()
   413  	if fake.invocations == nil {
   414  		fake.invocations = map[string][][]interface{}{}
   415  	}
   416  	if fake.invocations[key] == nil {
   417  		fake.invocations[key] = [][]interface{}{}
   418  	}
   419  	fake.invocations[key] = append(fake.invocations[key], args)
   420  }
   421  
   422  var _ v7action.Config = new(FakeConfig)