github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/command/v6/v6fakes/fake_auth_actor.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package v6fakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"code.cloudfoundry.org/cli/api/uaa/constant"
     8  	v6 "code.cloudfoundry.org/cli/command/v6"
     9  )
    10  
    11  type FakeAuthActor struct {
    12  	AuthenticateStub        func(string, string, string, constant.GrantType) error
    13  	authenticateMutex       sync.RWMutex
    14  	authenticateArgsForCall []struct {
    15  		arg1 string
    16  		arg2 string
    17  		arg3 string
    18  		arg4 constant.GrantType
    19  	}
    20  	authenticateReturns struct {
    21  		result1 error
    22  	}
    23  	authenticateReturnsOnCall map[int]struct {
    24  		result1 error
    25  	}
    26  	CloudControllerAPIVersionStub        func() string
    27  	cloudControllerAPIVersionMutex       sync.RWMutex
    28  	cloudControllerAPIVersionArgsForCall []struct {
    29  	}
    30  	cloudControllerAPIVersionReturns struct {
    31  		result1 string
    32  	}
    33  	cloudControllerAPIVersionReturnsOnCall map[int]struct {
    34  		result1 string
    35  	}
    36  	UAAAPIVersionStub        func() string
    37  	uAAAPIVersionMutex       sync.RWMutex
    38  	uAAAPIVersionArgsForCall []struct {
    39  	}
    40  	uAAAPIVersionReturns struct {
    41  		result1 string
    42  	}
    43  	uAAAPIVersionReturnsOnCall map[int]struct {
    44  		result1 string
    45  	}
    46  	invocations      map[string][][]interface{}
    47  	invocationsMutex sync.RWMutex
    48  }
    49  
    50  func (fake *FakeAuthActor) Authenticate(arg1 string, arg2 string, arg3 string, arg4 constant.GrantType) error {
    51  	fake.authenticateMutex.Lock()
    52  	ret, specificReturn := fake.authenticateReturnsOnCall[len(fake.authenticateArgsForCall)]
    53  	fake.authenticateArgsForCall = append(fake.authenticateArgsForCall, struct {
    54  		arg1 string
    55  		arg2 string
    56  		arg3 string
    57  		arg4 constant.GrantType
    58  	}{arg1, arg2, arg3, arg4})
    59  	fake.recordInvocation("Authenticate", []interface{}{arg1, arg2, arg3, arg4})
    60  	fake.authenticateMutex.Unlock()
    61  	if fake.AuthenticateStub != nil {
    62  		return fake.AuthenticateStub(arg1, arg2, arg3, arg4)
    63  	}
    64  	if specificReturn {
    65  		return ret.result1
    66  	}
    67  	fakeReturns := fake.authenticateReturns
    68  	return fakeReturns.result1
    69  }
    70  
    71  func (fake *FakeAuthActor) AuthenticateCallCount() int {
    72  	fake.authenticateMutex.RLock()
    73  	defer fake.authenticateMutex.RUnlock()
    74  	return len(fake.authenticateArgsForCall)
    75  }
    76  
    77  func (fake *FakeAuthActor) AuthenticateCalls(stub func(string, string, string, constant.GrantType) error) {
    78  	fake.authenticateMutex.Lock()
    79  	defer fake.authenticateMutex.Unlock()
    80  	fake.AuthenticateStub = stub
    81  }
    82  
    83  func (fake *FakeAuthActor) AuthenticateArgsForCall(i int) (string, string, string, constant.GrantType) {
    84  	fake.authenticateMutex.RLock()
    85  	defer fake.authenticateMutex.RUnlock()
    86  	argsForCall := fake.authenticateArgsForCall[i]
    87  	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4
    88  }
    89  
    90  func (fake *FakeAuthActor) AuthenticateReturns(result1 error) {
    91  	fake.authenticateMutex.Lock()
    92  	defer fake.authenticateMutex.Unlock()
    93  	fake.AuthenticateStub = nil
    94  	fake.authenticateReturns = struct {
    95  		result1 error
    96  	}{result1}
    97  }
    98  
    99  func (fake *FakeAuthActor) AuthenticateReturnsOnCall(i int, result1 error) {
   100  	fake.authenticateMutex.Lock()
   101  	defer fake.authenticateMutex.Unlock()
   102  	fake.AuthenticateStub = nil
   103  	if fake.authenticateReturnsOnCall == nil {
   104  		fake.authenticateReturnsOnCall = make(map[int]struct {
   105  			result1 error
   106  		})
   107  	}
   108  	fake.authenticateReturnsOnCall[i] = struct {
   109  		result1 error
   110  	}{result1}
   111  }
   112  
   113  func (fake *FakeAuthActor) CloudControllerAPIVersion() string {
   114  	fake.cloudControllerAPIVersionMutex.Lock()
   115  	ret, specificReturn := fake.cloudControllerAPIVersionReturnsOnCall[len(fake.cloudControllerAPIVersionArgsForCall)]
   116  	fake.cloudControllerAPIVersionArgsForCall = append(fake.cloudControllerAPIVersionArgsForCall, struct {
   117  	}{})
   118  	fake.recordInvocation("CloudControllerAPIVersion", []interface{}{})
   119  	fake.cloudControllerAPIVersionMutex.Unlock()
   120  	if fake.CloudControllerAPIVersionStub != nil {
   121  		return fake.CloudControllerAPIVersionStub()
   122  	}
   123  	if specificReturn {
   124  		return ret.result1
   125  	}
   126  	fakeReturns := fake.cloudControllerAPIVersionReturns
   127  	return fakeReturns.result1
   128  }
   129  
   130  func (fake *FakeAuthActor) CloudControllerAPIVersionCallCount() int {
   131  	fake.cloudControllerAPIVersionMutex.RLock()
   132  	defer fake.cloudControllerAPIVersionMutex.RUnlock()
   133  	return len(fake.cloudControllerAPIVersionArgsForCall)
   134  }
   135  
   136  func (fake *FakeAuthActor) CloudControllerAPIVersionCalls(stub func() string) {
   137  	fake.cloudControllerAPIVersionMutex.Lock()
   138  	defer fake.cloudControllerAPIVersionMutex.Unlock()
   139  	fake.CloudControllerAPIVersionStub = stub
   140  }
   141  
   142  func (fake *FakeAuthActor) CloudControllerAPIVersionReturns(result1 string) {
   143  	fake.cloudControllerAPIVersionMutex.Lock()
   144  	defer fake.cloudControllerAPIVersionMutex.Unlock()
   145  	fake.CloudControllerAPIVersionStub = nil
   146  	fake.cloudControllerAPIVersionReturns = struct {
   147  		result1 string
   148  	}{result1}
   149  }
   150  
   151  func (fake *FakeAuthActor) CloudControllerAPIVersionReturnsOnCall(i int, result1 string) {
   152  	fake.cloudControllerAPIVersionMutex.Lock()
   153  	defer fake.cloudControllerAPIVersionMutex.Unlock()
   154  	fake.CloudControllerAPIVersionStub = nil
   155  	if fake.cloudControllerAPIVersionReturnsOnCall == nil {
   156  		fake.cloudControllerAPIVersionReturnsOnCall = make(map[int]struct {
   157  			result1 string
   158  		})
   159  	}
   160  	fake.cloudControllerAPIVersionReturnsOnCall[i] = struct {
   161  		result1 string
   162  	}{result1}
   163  }
   164  
   165  func (fake *FakeAuthActor) UAAAPIVersion() string {
   166  	fake.uAAAPIVersionMutex.Lock()
   167  	ret, specificReturn := fake.uAAAPIVersionReturnsOnCall[len(fake.uAAAPIVersionArgsForCall)]
   168  	fake.uAAAPIVersionArgsForCall = append(fake.uAAAPIVersionArgsForCall, struct {
   169  	}{})
   170  	fake.recordInvocation("UAAAPIVersion", []interface{}{})
   171  	fake.uAAAPIVersionMutex.Unlock()
   172  	if fake.UAAAPIVersionStub != nil {
   173  		return fake.UAAAPIVersionStub()
   174  	}
   175  	if specificReturn {
   176  		return ret.result1
   177  	}
   178  	fakeReturns := fake.uAAAPIVersionReturns
   179  	return fakeReturns.result1
   180  }
   181  
   182  func (fake *FakeAuthActor) UAAAPIVersionCallCount() int {
   183  	fake.uAAAPIVersionMutex.RLock()
   184  	defer fake.uAAAPIVersionMutex.RUnlock()
   185  	return len(fake.uAAAPIVersionArgsForCall)
   186  }
   187  
   188  func (fake *FakeAuthActor) UAAAPIVersionCalls(stub func() string) {
   189  	fake.uAAAPIVersionMutex.Lock()
   190  	defer fake.uAAAPIVersionMutex.Unlock()
   191  	fake.UAAAPIVersionStub = stub
   192  }
   193  
   194  func (fake *FakeAuthActor) UAAAPIVersionReturns(result1 string) {
   195  	fake.uAAAPIVersionMutex.Lock()
   196  	defer fake.uAAAPIVersionMutex.Unlock()
   197  	fake.UAAAPIVersionStub = nil
   198  	fake.uAAAPIVersionReturns = struct {
   199  		result1 string
   200  	}{result1}
   201  }
   202  
   203  func (fake *FakeAuthActor) UAAAPIVersionReturnsOnCall(i int, result1 string) {
   204  	fake.uAAAPIVersionMutex.Lock()
   205  	defer fake.uAAAPIVersionMutex.Unlock()
   206  	fake.UAAAPIVersionStub = nil
   207  	if fake.uAAAPIVersionReturnsOnCall == nil {
   208  		fake.uAAAPIVersionReturnsOnCall = make(map[int]struct {
   209  			result1 string
   210  		})
   211  	}
   212  	fake.uAAAPIVersionReturnsOnCall[i] = struct {
   213  		result1 string
   214  	}{result1}
   215  }
   216  
   217  func (fake *FakeAuthActor) Invocations() map[string][][]interface{} {
   218  	fake.invocationsMutex.RLock()
   219  	defer fake.invocationsMutex.RUnlock()
   220  	fake.authenticateMutex.RLock()
   221  	defer fake.authenticateMutex.RUnlock()
   222  	fake.cloudControllerAPIVersionMutex.RLock()
   223  	defer fake.cloudControllerAPIVersionMutex.RUnlock()
   224  	fake.uAAAPIVersionMutex.RLock()
   225  	defer fake.uAAAPIVersionMutex.RUnlock()
   226  	copiedInvocations := map[string][][]interface{}{}
   227  	for key, value := range fake.invocations {
   228  		copiedInvocations[key] = value
   229  	}
   230  	return copiedInvocations
   231  }
   232  
   233  func (fake *FakeAuthActor) recordInvocation(key string, args []interface{}) {
   234  	fake.invocationsMutex.Lock()
   235  	defer fake.invocationsMutex.Unlock()
   236  	if fake.invocations == nil {
   237  		fake.invocations = map[string][][]interface{}{}
   238  	}
   239  	if fake.invocations[key] == nil {
   240  		fake.invocations[key] = [][]interface{}{}
   241  	}
   242  	fake.invocations[key] = append(fake.invocations[key], args)
   243  }
   244  
   245  var _ v6.AuthActor = new(FakeAuthActor)