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