github.com/wanddynosios/cli/v8@v8.7.9-0.20240221182337-1a92e3a7017f/actor/v7action/v7actionfakes/fake_who_am_ier.go (about)

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