github.com/cloudfoundry/cli@v7.1.0+incompatible/api/uaa/noaabridge/noaabridgefakes/fake_uaaclient.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package noaabridgefakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"code.cloudfoundry.org/cli/api/uaa"
     8  	"code.cloudfoundry.org/cli/api/uaa/noaabridge"
     9  )
    10  
    11  type FakeUAAClient struct {
    12  	RefreshAccessTokenStub        func(string) (uaa.RefreshedTokens, error)
    13  	refreshAccessTokenMutex       sync.RWMutex
    14  	refreshAccessTokenArgsForCall []struct {
    15  		arg1 string
    16  	}
    17  	refreshAccessTokenReturns struct {
    18  		result1 uaa.RefreshedTokens
    19  		result2 error
    20  	}
    21  	refreshAccessTokenReturnsOnCall map[int]struct {
    22  		result1 uaa.RefreshedTokens
    23  		result2 error
    24  	}
    25  	invocations      map[string][][]interface{}
    26  	invocationsMutex sync.RWMutex
    27  }
    28  
    29  func (fake *FakeUAAClient) RefreshAccessToken(arg1 string) (uaa.RefreshedTokens, error) {
    30  	fake.refreshAccessTokenMutex.Lock()
    31  	ret, specificReturn := fake.refreshAccessTokenReturnsOnCall[len(fake.refreshAccessTokenArgsForCall)]
    32  	fake.refreshAccessTokenArgsForCall = append(fake.refreshAccessTokenArgsForCall, struct {
    33  		arg1 string
    34  	}{arg1})
    35  	fake.recordInvocation("RefreshAccessToken", []interface{}{arg1})
    36  	fake.refreshAccessTokenMutex.Unlock()
    37  	if fake.RefreshAccessTokenStub != nil {
    38  		return fake.RefreshAccessTokenStub(arg1)
    39  	}
    40  	if specificReturn {
    41  		return ret.result1, ret.result2
    42  	}
    43  	fakeReturns := fake.refreshAccessTokenReturns
    44  	return fakeReturns.result1, fakeReturns.result2
    45  }
    46  
    47  func (fake *FakeUAAClient) RefreshAccessTokenCallCount() int {
    48  	fake.refreshAccessTokenMutex.RLock()
    49  	defer fake.refreshAccessTokenMutex.RUnlock()
    50  	return len(fake.refreshAccessTokenArgsForCall)
    51  }
    52  
    53  func (fake *FakeUAAClient) RefreshAccessTokenCalls(stub func(string) (uaa.RefreshedTokens, error)) {
    54  	fake.refreshAccessTokenMutex.Lock()
    55  	defer fake.refreshAccessTokenMutex.Unlock()
    56  	fake.RefreshAccessTokenStub = stub
    57  }
    58  
    59  func (fake *FakeUAAClient) RefreshAccessTokenArgsForCall(i int) string {
    60  	fake.refreshAccessTokenMutex.RLock()
    61  	defer fake.refreshAccessTokenMutex.RUnlock()
    62  	argsForCall := fake.refreshAccessTokenArgsForCall[i]
    63  	return argsForCall.arg1
    64  }
    65  
    66  func (fake *FakeUAAClient) RefreshAccessTokenReturns(result1 uaa.RefreshedTokens, result2 error) {
    67  	fake.refreshAccessTokenMutex.Lock()
    68  	defer fake.refreshAccessTokenMutex.Unlock()
    69  	fake.RefreshAccessTokenStub = nil
    70  	fake.refreshAccessTokenReturns = struct {
    71  		result1 uaa.RefreshedTokens
    72  		result2 error
    73  	}{result1, result2}
    74  }
    75  
    76  func (fake *FakeUAAClient) RefreshAccessTokenReturnsOnCall(i int, result1 uaa.RefreshedTokens, result2 error) {
    77  	fake.refreshAccessTokenMutex.Lock()
    78  	defer fake.refreshAccessTokenMutex.Unlock()
    79  	fake.RefreshAccessTokenStub = nil
    80  	if fake.refreshAccessTokenReturnsOnCall == nil {
    81  		fake.refreshAccessTokenReturnsOnCall = make(map[int]struct {
    82  			result1 uaa.RefreshedTokens
    83  			result2 error
    84  		})
    85  	}
    86  	fake.refreshAccessTokenReturnsOnCall[i] = struct {
    87  		result1 uaa.RefreshedTokens
    88  		result2 error
    89  	}{result1, result2}
    90  }
    91  
    92  func (fake *FakeUAAClient) Invocations() map[string][][]interface{} {
    93  	fake.invocationsMutex.RLock()
    94  	defer fake.invocationsMutex.RUnlock()
    95  	fake.refreshAccessTokenMutex.RLock()
    96  	defer fake.refreshAccessTokenMutex.RUnlock()
    97  	copiedInvocations := map[string][][]interface{}{}
    98  	for key, value := range fake.invocations {
    99  		copiedInvocations[key] = value
   100  	}
   101  	return copiedInvocations
   102  }
   103  
   104  func (fake *FakeUAAClient) recordInvocation(key string, args []interface{}) {
   105  	fake.invocationsMutex.Lock()
   106  	defer fake.invocationsMutex.Unlock()
   107  	if fake.invocations == nil {
   108  		fake.invocations = map[string][][]interface{}{}
   109  	}
   110  	if fake.invocations[key] == nil {
   111  		fake.invocations[key] = [][]interface{}{}
   112  	}
   113  	fake.invocations[key] = append(fake.invocations[key], args)
   114  }
   115  
   116  var _ noaabridge.UAAClient = new(FakeUAAClient)