github.com/loggregator/cli@v6.33.1-0.20180224010324-82334f081791+incompatible/command/v3/v3fakes/fake_v3apply_manifest_actor.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package v3fakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/actor/v3action" 8 "code.cloudfoundry.org/cli/command/v3" 9 ) 10 11 type FakeV3ApplyManifestActor struct { 12 CloudControllerAPIVersionStub func() string 13 cloudControllerAPIVersionMutex sync.RWMutex 14 cloudControllerAPIVersionArgsForCall []struct{} 15 cloudControllerAPIVersionReturns struct { 16 result1 string 17 } 18 cloudControllerAPIVersionReturnsOnCall map[int]struct { 19 result1 string 20 } 21 ApplyApplicationManifestStub func(parser v3action.ManifestParser, spaceGUID string) (v3action.Warnings, error) 22 applyApplicationManifestMutex sync.RWMutex 23 applyApplicationManifestArgsForCall []struct { 24 parser v3action.ManifestParser 25 spaceGUID string 26 } 27 applyApplicationManifestReturns struct { 28 result1 v3action.Warnings 29 result2 error 30 } 31 applyApplicationManifestReturnsOnCall map[int]struct { 32 result1 v3action.Warnings 33 result2 error 34 } 35 invocations map[string][][]interface{} 36 invocationsMutex sync.RWMutex 37 } 38 39 func (fake *FakeV3ApplyManifestActor) CloudControllerAPIVersion() string { 40 fake.cloudControllerAPIVersionMutex.Lock() 41 ret, specificReturn := fake.cloudControllerAPIVersionReturnsOnCall[len(fake.cloudControllerAPIVersionArgsForCall)] 42 fake.cloudControllerAPIVersionArgsForCall = append(fake.cloudControllerAPIVersionArgsForCall, struct{}{}) 43 fake.recordInvocation("CloudControllerAPIVersion", []interface{}{}) 44 fake.cloudControllerAPIVersionMutex.Unlock() 45 if fake.CloudControllerAPIVersionStub != nil { 46 return fake.CloudControllerAPIVersionStub() 47 } 48 if specificReturn { 49 return ret.result1 50 } 51 return fake.cloudControllerAPIVersionReturns.result1 52 } 53 54 func (fake *FakeV3ApplyManifestActor) CloudControllerAPIVersionCallCount() int { 55 fake.cloudControllerAPIVersionMutex.RLock() 56 defer fake.cloudControllerAPIVersionMutex.RUnlock() 57 return len(fake.cloudControllerAPIVersionArgsForCall) 58 } 59 60 func (fake *FakeV3ApplyManifestActor) CloudControllerAPIVersionReturns(result1 string) { 61 fake.CloudControllerAPIVersionStub = nil 62 fake.cloudControllerAPIVersionReturns = struct { 63 result1 string 64 }{result1} 65 } 66 67 func (fake *FakeV3ApplyManifestActor) CloudControllerAPIVersionReturnsOnCall(i int, result1 string) { 68 fake.CloudControllerAPIVersionStub = nil 69 if fake.cloudControllerAPIVersionReturnsOnCall == nil { 70 fake.cloudControllerAPIVersionReturnsOnCall = make(map[int]struct { 71 result1 string 72 }) 73 } 74 fake.cloudControllerAPIVersionReturnsOnCall[i] = struct { 75 result1 string 76 }{result1} 77 } 78 79 func (fake *FakeV3ApplyManifestActor) ApplyApplicationManifest(parser v3action.ManifestParser, spaceGUID string) (v3action.Warnings, error) { 80 fake.applyApplicationManifestMutex.Lock() 81 ret, specificReturn := fake.applyApplicationManifestReturnsOnCall[len(fake.applyApplicationManifestArgsForCall)] 82 fake.applyApplicationManifestArgsForCall = append(fake.applyApplicationManifestArgsForCall, struct { 83 parser v3action.ManifestParser 84 spaceGUID string 85 }{parser, spaceGUID}) 86 fake.recordInvocation("ApplyApplicationManifest", []interface{}{parser, spaceGUID}) 87 fake.applyApplicationManifestMutex.Unlock() 88 if fake.ApplyApplicationManifestStub != nil { 89 return fake.ApplyApplicationManifestStub(parser, spaceGUID) 90 } 91 if specificReturn { 92 return ret.result1, ret.result2 93 } 94 return fake.applyApplicationManifestReturns.result1, fake.applyApplicationManifestReturns.result2 95 } 96 97 func (fake *FakeV3ApplyManifestActor) ApplyApplicationManifestCallCount() int { 98 fake.applyApplicationManifestMutex.RLock() 99 defer fake.applyApplicationManifestMutex.RUnlock() 100 return len(fake.applyApplicationManifestArgsForCall) 101 } 102 103 func (fake *FakeV3ApplyManifestActor) ApplyApplicationManifestArgsForCall(i int) (v3action.ManifestParser, string) { 104 fake.applyApplicationManifestMutex.RLock() 105 defer fake.applyApplicationManifestMutex.RUnlock() 106 return fake.applyApplicationManifestArgsForCall[i].parser, fake.applyApplicationManifestArgsForCall[i].spaceGUID 107 } 108 109 func (fake *FakeV3ApplyManifestActor) ApplyApplicationManifestReturns(result1 v3action.Warnings, result2 error) { 110 fake.ApplyApplicationManifestStub = nil 111 fake.applyApplicationManifestReturns = struct { 112 result1 v3action.Warnings 113 result2 error 114 }{result1, result2} 115 } 116 117 func (fake *FakeV3ApplyManifestActor) ApplyApplicationManifestReturnsOnCall(i int, result1 v3action.Warnings, result2 error) { 118 fake.ApplyApplicationManifestStub = nil 119 if fake.applyApplicationManifestReturnsOnCall == nil { 120 fake.applyApplicationManifestReturnsOnCall = make(map[int]struct { 121 result1 v3action.Warnings 122 result2 error 123 }) 124 } 125 fake.applyApplicationManifestReturnsOnCall[i] = struct { 126 result1 v3action.Warnings 127 result2 error 128 }{result1, result2} 129 } 130 131 func (fake *FakeV3ApplyManifestActor) Invocations() map[string][][]interface{} { 132 fake.invocationsMutex.RLock() 133 defer fake.invocationsMutex.RUnlock() 134 fake.cloudControllerAPIVersionMutex.RLock() 135 defer fake.cloudControllerAPIVersionMutex.RUnlock() 136 fake.applyApplicationManifestMutex.RLock() 137 defer fake.applyApplicationManifestMutex.RUnlock() 138 copiedInvocations := map[string][][]interface{}{} 139 for key, value := range fake.invocations { 140 copiedInvocations[key] = value 141 } 142 return copiedInvocations 143 } 144 145 func (fake *FakeV3ApplyManifestActor) recordInvocation(key string, args []interface{}) { 146 fake.invocationsMutex.Lock() 147 defer fake.invocationsMutex.Unlock() 148 if fake.invocations == nil { 149 fake.invocations = map[string][][]interface{}{} 150 } 151 if fake.invocations[key] == nil { 152 fake.invocations[key] = [][]interface{}{} 153 } 154 fake.invocations[key] = append(fake.invocations[key], args) 155 } 156 157 var _ v3.V3ApplyManifestActor = new(FakeV3ApplyManifestActor)