github.com/orange-cloudfoundry/cli@v7.1.0+incompatible/command/v6/v6fakes/fake_create_service_key_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/actor/v2action" 8 v6 "code.cloudfoundry.org/cli/command/v6" 9 ) 10 11 type FakeCreateServiceKeyActor struct { 12 CreateServiceKeyStub func(string, string, string, map[string]interface{}) (v2action.ServiceKey, v2action.Warnings, error) 13 createServiceKeyMutex sync.RWMutex 14 createServiceKeyArgsForCall []struct { 15 arg1 string 16 arg2 string 17 arg3 string 18 arg4 map[string]interface{} 19 } 20 createServiceKeyReturns struct { 21 result1 v2action.ServiceKey 22 result2 v2action.Warnings 23 result3 error 24 } 25 createServiceKeyReturnsOnCall map[int]struct { 26 result1 v2action.ServiceKey 27 result2 v2action.Warnings 28 result3 error 29 } 30 invocations map[string][][]interface{} 31 invocationsMutex sync.RWMutex 32 } 33 34 func (fake *FakeCreateServiceKeyActor) CreateServiceKey(arg1 string, arg2 string, arg3 string, arg4 map[string]interface{}) (v2action.ServiceKey, v2action.Warnings, error) { 35 fake.createServiceKeyMutex.Lock() 36 ret, specificReturn := fake.createServiceKeyReturnsOnCall[len(fake.createServiceKeyArgsForCall)] 37 fake.createServiceKeyArgsForCall = append(fake.createServiceKeyArgsForCall, struct { 38 arg1 string 39 arg2 string 40 arg3 string 41 arg4 map[string]interface{} 42 }{arg1, arg2, arg3, arg4}) 43 fake.recordInvocation("CreateServiceKey", []interface{}{arg1, arg2, arg3, arg4}) 44 fake.createServiceKeyMutex.Unlock() 45 if fake.CreateServiceKeyStub != nil { 46 return fake.CreateServiceKeyStub(arg1, arg2, arg3, arg4) 47 } 48 if specificReturn { 49 return ret.result1, ret.result2, ret.result3 50 } 51 fakeReturns := fake.createServiceKeyReturns 52 return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3 53 } 54 55 func (fake *FakeCreateServiceKeyActor) CreateServiceKeyCallCount() int { 56 fake.createServiceKeyMutex.RLock() 57 defer fake.createServiceKeyMutex.RUnlock() 58 return len(fake.createServiceKeyArgsForCall) 59 } 60 61 func (fake *FakeCreateServiceKeyActor) CreateServiceKeyCalls(stub func(string, string, string, map[string]interface{}) (v2action.ServiceKey, v2action.Warnings, error)) { 62 fake.createServiceKeyMutex.Lock() 63 defer fake.createServiceKeyMutex.Unlock() 64 fake.CreateServiceKeyStub = stub 65 } 66 67 func (fake *FakeCreateServiceKeyActor) CreateServiceKeyArgsForCall(i int) (string, string, string, map[string]interface{}) { 68 fake.createServiceKeyMutex.RLock() 69 defer fake.createServiceKeyMutex.RUnlock() 70 argsForCall := fake.createServiceKeyArgsForCall[i] 71 return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4 72 } 73 74 func (fake *FakeCreateServiceKeyActor) CreateServiceKeyReturns(result1 v2action.ServiceKey, result2 v2action.Warnings, result3 error) { 75 fake.createServiceKeyMutex.Lock() 76 defer fake.createServiceKeyMutex.Unlock() 77 fake.CreateServiceKeyStub = nil 78 fake.createServiceKeyReturns = struct { 79 result1 v2action.ServiceKey 80 result2 v2action.Warnings 81 result3 error 82 }{result1, result2, result3} 83 } 84 85 func (fake *FakeCreateServiceKeyActor) CreateServiceKeyReturnsOnCall(i int, result1 v2action.ServiceKey, result2 v2action.Warnings, result3 error) { 86 fake.createServiceKeyMutex.Lock() 87 defer fake.createServiceKeyMutex.Unlock() 88 fake.CreateServiceKeyStub = nil 89 if fake.createServiceKeyReturnsOnCall == nil { 90 fake.createServiceKeyReturnsOnCall = make(map[int]struct { 91 result1 v2action.ServiceKey 92 result2 v2action.Warnings 93 result3 error 94 }) 95 } 96 fake.createServiceKeyReturnsOnCall[i] = struct { 97 result1 v2action.ServiceKey 98 result2 v2action.Warnings 99 result3 error 100 }{result1, result2, result3} 101 } 102 103 func (fake *FakeCreateServiceKeyActor) Invocations() map[string][][]interface{} { 104 fake.invocationsMutex.RLock() 105 defer fake.invocationsMutex.RUnlock() 106 fake.createServiceKeyMutex.RLock() 107 defer fake.createServiceKeyMutex.RUnlock() 108 copiedInvocations := map[string][][]interface{}{} 109 for key, value := range fake.invocations { 110 copiedInvocations[key] = value 111 } 112 return copiedInvocations 113 } 114 115 func (fake *FakeCreateServiceKeyActor) recordInvocation(key string, args []interface{}) { 116 fake.invocationsMutex.Lock() 117 defer fake.invocationsMutex.Unlock() 118 if fake.invocations == nil { 119 fake.invocations = map[string][][]interface{}{} 120 } 121 if fake.invocations[key] == nil { 122 fake.invocations[key] = [][]interface{}{} 123 } 124 fake.invocations[key] = append(fake.invocations[key], args) 125 } 126 127 var _ v6.CreateServiceKeyActor = new(FakeCreateServiceKeyActor)