github.com/loggregator/cli@v6.33.1-0.20180224010324-82334f081791+incompatible/actor/v3action/v3actionfakes/fake_config.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package v3actionfakes
     3  
     4  import (
     5  	"sync"
     6  	"time"
     7  
     8  	"code.cloudfoundry.org/cli/actor/v3action"
     9  )
    10  
    11  type FakeConfig struct {
    12  	AccessTokenStub        func() string
    13  	accessTokenMutex       sync.RWMutex
    14  	accessTokenArgsForCall []struct{}
    15  	accessTokenReturns     struct {
    16  		result1 string
    17  	}
    18  	accessTokenReturnsOnCall map[int]struct {
    19  		result1 string
    20  	}
    21  	PollingIntervalStub        func() time.Duration
    22  	pollingIntervalMutex       sync.RWMutex
    23  	pollingIntervalArgsForCall []struct{}
    24  	pollingIntervalReturns     struct {
    25  		result1 time.Duration
    26  	}
    27  	pollingIntervalReturnsOnCall map[int]struct {
    28  		result1 time.Duration
    29  	}
    30  	SSHOAuthClientStub        func() string
    31  	sSHOAuthClientMutex       sync.RWMutex
    32  	sSHOAuthClientArgsForCall []struct{}
    33  	sSHOAuthClientReturns     struct {
    34  		result1 string
    35  	}
    36  	sSHOAuthClientReturnsOnCall map[int]struct {
    37  		result1 string
    38  	}
    39  	StartupTimeoutStub        func() time.Duration
    40  	startupTimeoutMutex       sync.RWMutex
    41  	startupTimeoutArgsForCall []struct{}
    42  	startupTimeoutReturns     struct {
    43  		result1 time.Duration
    44  	}
    45  	startupTimeoutReturnsOnCall map[int]struct {
    46  		result1 time.Duration
    47  	}
    48  	StagingTimeoutStub        func() time.Duration
    49  	stagingTimeoutMutex       sync.RWMutex
    50  	stagingTimeoutArgsForCall []struct{}
    51  	stagingTimeoutReturns     struct {
    52  		result1 time.Duration
    53  	}
    54  	stagingTimeoutReturnsOnCall map[int]struct {
    55  		result1 time.Duration
    56  	}
    57  	invocations      map[string][][]interface{}
    58  	invocationsMutex sync.RWMutex
    59  }
    60  
    61  func (fake *FakeConfig) AccessToken() string {
    62  	fake.accessTokenMutex.Lock()
    63  	ret, specificReturn := fake.accessTokenReturnsOnCall[len(fake.accessTokenArgsForCall)]
    64  	fake.accessTokenArgsForCall = append(fake.accessTokenArgsForCall, struct{}{})
    65  	fake.recordInvocation("AccessToken", []interface{}{})
    66  	fake.accessTokenMutex.Unlock()
    67  	if fake.AccessTokenStub != nil {
    68  		return fake.AccessTokenStub()
    69  	}
    70  	if specificReturn {
    71  		return ret.result1
    72  	}
    73  	return fake.accessTokenReturns.result1
    74  }
    75  
    76  func (fake *FakeConfig) AccessTokenCallCount() int {
    77  	fake.accessTokenMutex.RLock()
    78  	defer fake.accessTokenMutex.RUnlock()
    79  	return len(fake.accessTokenArgsForCall)
    80  }
    81  
    82  func (fake *FakeConfig) AccessTokenReturns(result1 string) {
    83  	fake.AccessTokenStub = nil
    84  	fake.accessTokenReturns = struct {
    85  		result1 string
    86  	}{result1}
    87  }
    88  
    89  func (fake *FakeConfig) AccessTokenReturnsOnCall(i int, result1 string) {
    90  	fake.AccessTokenStub = nil
    91  	if fake.accessTokenReturnsOnCall == nil {
    92  		fake.accessTokenReturnsOnCall = make(map[int]struct {
    93  			result1 string
    94  		})
    95  	}
    96  	fake.accessTokenReturnsOnCall[i] = struct {
    97  		result1 string
    98  	}{result1}
    99  }
   100  
   101  func (fake *FakeConfig) PollingInterval() time.Duration {
   102  	fake.pollingIntervalMutex.Lock()
   103  	ret, specificReturn := fake.pollingIntervalReturnsOnCall[len(fake.pollingIntervalArgsForCall)]
   104  	fake.pollingIntervalArgsForCall = append(fake.pollingIntervalArgsForCall, struct{}{})
   105  	fake.recordInvocation("PollingInterval", []interface{}{})
   106  	fake.pollingIntervalMutex.Unlock()
   107  	if fake.PollingIntervalStub != nil {
   108  		return fake.PollingIntervalStub()
   109  	}
   110  	if specificReturn {
   111  		return ret.result1
   112  	}
   113  	return fake.pollingIntervalReturns.result1
   114  }
   115  
   116  func (fake *FakeConfig) PollingIntervalCallCount() int {
   117  	fake.pollingIntervalMutex.RLock()
   118  	defer fake.pollingIntervalMutex.RUnlock()
   119  	return len(fake.pollingIntervalArgsForCall)
   120  }
   121  
   122  func (fake *FakeConfig) PollingIntervalReturns(result1 time.Duration) {
   123  	fake.PollingIntervalStub = nil
   124  	fake.pollingIntervalReturns = struct {
   125  		result1 time.Duration
   126  	}{result1}
   127  }
   128  
   129  func (fake *FakeConfig) PollingIntervalReturnsOnCall(i int, result1 time.Duration) {
   130  	fake.PollingIntervalStub = nil
   131  	if fake.pollingIntervalReturnsOnCall == nil {
   132  		fake.pollingIntervalReturnsOnCall = make(map[int]struct {
   133  			result1 time.Duration
   134  		})
   135  	}
   136  	fake.pollingIntervalReturnsOnCall[i] = struct {
   137  		result1 time.Duration
   138  	}{result1}
   139  }
   140  
   141  func (fake *FakeConfig) SSHOAuthClient() string {
   142  	fake.sSHOAuthClientMutex.Lock()
   143  	ret, specificReturn := fake.sSHOAuthClientReturnsOnCall[len(fake.sSHOAuthClientArgsForCall)]
   144  	fake.sSHOAuthClientArgsForCall = append(fake.sSHOAuthClientArgsForCall, struct{}{})
   145  	fake.recordInvocation("SSHOAuthClient", []interface{}{})
   146  	fake.sSHOAuthClientMutex.Unlock()
   147  	if fake.SSHOAuthClientStub != nil {
   148  		return fake.SSHOAuthClientStub()
   149  	}
   150  	if specificReturn {
   151  		return ret.result1
   152  	}
   153  	return fake.sSHOAuthClientReturns.result1
   154  }
   155  
   156  func (fake *FakeConfig) SSHOAuthClientCallCount() int {
   157  	fake.sSHOAuthClientMutex.RLock()
   158  	defer fake.sSHOAuthClientMutex.RUnlock()
   159  	return len(fake.sSHOAuthClientArgsForCall)
   160  }
   161  
   162  func (fake *FakeConfig) SSHOAuthClientReturns(result1 string) {
   163  	fake.SSHOAuthClientStub = nil
   164  	fake.sSHOAuthClientReturns = struct {
   165  		result1 string
   166  	}{result1}
   167  }
   168  
   169  func (fake *FakeConfig) SSHOAuthClientReturnsOnCall(i int, result1 string) {
   170  	fake.SSHOAuthClientStub = nil
   171  	if fake.sSHOAuthClientReturnsOnCall == nil {
   172  		fake.sSHOAuthClientReturnsOnCall = make(map[int]struct {
   173  			result1 string
   174  		})
   175  	}
   176  	fake.sSHOAuthClientReturnsOnCall[i] = struct {
   177  		result1 string
   178  	}{result1}
   179  }
   180  
   181  func (fake *FakeConfig) StartupTimeout() time.Duration {
   182  	fake.startupTimeoutMutex.Lock()
   183  	ret, specificReturn := fake.startupTimeoutReturnsOnCall[len(fake.startupTimeoutArgsForCall)]
   184  	fake.startupTimeoutArgsForCall = append(fake.startupTimeoutArgsForCall, struct{}{})
   185  	fake.recordInvocation("StartupTimeout", []interface{}{})
   186  	fake.startupTimeoutMutex.Unlock()
   187  	if fake.StartupTimeoutStub != nil {
   188  		return fake.StartupTimeoutStub()
   189  	}
   190  	if specificReturn {
   191  		return ret.result1
   192  	}
   193  	return fake.startupTimeoutReturns.result1
   194  }
   195  
   196  func (fake *FakeConfig) StartupTimeoutCallCount() int {
   197  	fake.startupTimeoutMutex.RLock()
   198  	defer fake.startupTimeoutMutex.RUnlock()
   199  	return len(fake.startupTimeoutArgsForCall)
   200  }
   201  
   202  func (fake *FakeConfig) StartupTimeoutReturns(result1 time.Duration) {
   203  	fake.StartupTimeoutStub = nil
   204  	fake.startupTimeoutReturns = struct {
   205  		result1 time.Duration
   206  	}{result1}
   207  }
   208  
   209  func (fake *FakeConfig) StartupTimeoutReturnsOnCall(i int, result1 time.Duration) {
   210  	fake.StartupTimeoutStub = nil
   211  	if fake.startupTimeoutReturnsOnCall == nil {
   212  		fake.startupTimeoutReturnsOnCall = make(map[int]struct {
   213  			result1 time.Duration
   214  		})
   215  	}
   216  	fake.startupTimeoutReturnsOnCall[i] = struct {
   217  		result1 time.Duration
   218  	}{result1}
   219  }
   220  
   221  func (fake *FakeConfig) StagingTimeout() time.Duration {
   222  	fake.stagingTimeoutMutex.Lock()
   223  	ret, specificReturn := fake.stagingTimeoutReturnsOnCall[len(fake.stagingTimeoutArgsForCall)]
   224  	fake.stagingTimeoutArgsForCall = append(fake.stagingTimeoutArgsForCall, struct{}{})
   225  	fake.recordInvocation("StagingTimeout", []interface{}{})
   226  	fake.stagingTimeoutMutex.Unlock()
   227  	if fake.StagingTimeoutStub != nil {
   228  		return fake.StagingTimeoutStub()
   229  	}
   230  	if specificReturn {
   231  		return ret.result1
   232  	}
   233  	return fake.stagingTimeoutReturns.result1
   234  }
   235  
   236  func (fake *FakeConfig) StagingTimeoutCallCount() int {
   237  	fake.stagingTimeoutMutex.RLock()
   238  	defer fake.stagingTimeoutMutex.RUnlock()
   239  	return len(fake.stagingTimeoutArgsForCall)
   240  }
   241  
   242  func (fake *FakeConfig) StagingTimeoutReturns(result1 time.Duration) {
   243  	fake.StagingTimeoutStub = nil
   244  	fake.stagingTimeoutReturns = struct {
   245  		result1 time.Duration
   246  	}{result1}
   247  }
   248  
   249  func (fake *FakeConfig) StagingTimeoutReturnsOnCall(i int, result1 time.Duration) {
   250  	fake.StagingTimeoutStub = nil
   251  	if fake.stagingTimeoutReturnsOnCall == nil {
   252  		fake.stagingTimeoutReturnsOnCall = make(map[int]struct {
   253  			result1 time.Duration
   254  		})
   255  	}
   256  	fake.stagingTimeoutReturnsOnCall[i] = struct {
   257  		result1 time.Duration
   258  	}{result1}
   259  }
   260  
   261  func (fake *FakeConfig) Invocations() map[string][][]interface{} {
   262  	fake.invocationsMutex.RLock()
   263  	defer fake.invocationsMutex.RUnlock()
   264  	fake.accessTokenMutex.RLock()
   265  	defer fake.accessTokenMutex.RUnlock()
   266  	fake.pollingIntervalMutex.RLock()
   267  	defer fake.pollingIntervalMutex.RUnlock()
   268  	fake.sSHOAuthClientMutex.RLock()
   269  	defer fake.sSHOAuthClientMutex.RUnlock()
   270  	fake.startupTimeoutMutex.RLock()
   271  	defer fake.startupTimeoutMutex.RUnlock()
   272  	fake.stagingTimeoutMutex.RLock()
   273  	defer fake.stagingTimeoutMutex.RUnlock()
   274  	copiedInvocations := map[string][][]interface{}{}
   275  	for key, value := range fake.invocations {
   276  		copiedInvocations[key] = value
   277  	}
   278  	return copiedInvocations
   279  }
   280  
   281  func (fake *FakeConfig) recordInvocation(key string, args []interface{}) {
   282  	fake.invocationsMutex.Lock()
   283  	defer fake.invocationsMutex.Unlock()
   284  	if fake.invocations == nil {
   285  		fake.invocations = map[string][][]interface{}{}
   286  	}
   287  	if fake.invocations[key] == nil {
   288  		fake.invocations[key] = [][]interface{}{}
   289  	}
   290  	fake.invocations[key] = append(fake.invocations[key], args)
   291  }
   292  
   293  var _ v3action.Config = new(FakeConfig)