github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/cf/configuration/configurationfakes/fake_data_interface.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package configurationfakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/cf/configuration" 8 ) 9 10 type FakeDataInterface struct { 11 JSONMarshalV3Stub func() ([]byte, error) 12 jSONMarshalV3Mutex sync.RWMutex 13 jSONMarshalV3ArgsForCall []struct { 14 } 15 jSONMarshalV3Returns struct { 16 result1 []byte 17 result2 error 18 } 19 jSONMarshalV3ReturnsOnCall map[int]struct { 20 result1 []byte 21 result2 error 22 } 23 JSONUnmarshalV3Stub func([]byte) error 24 jSONUnmarshalV3Mutex sync.RWMutex 25 jSONUnmarshalV3ArgsForCall []struct { 26 arg1 []byte 27 } 28 jSONUnmarshalV3Returns struct { 29 result1 error 30 } 31 jSONUnmarshalV3ReturnsOnCall map[int]struct { 32 result1 error 33 } 34 invocations map[string][][]interface{} 35 invocationsMutex sync.RWMutex 36 } 37 38 func (fake *FakeDataInterface) JSONMarshalV3() ([]byte, error) { 39 fake.jSONMarshalV3Mutex.Lock() 40 ret, specificReturn := fake.jSONMarshalV3ReturnsOnCall[len(fake.jSONMarshalV3ArgsForCall)] 41 fake.jSONMarshalV3ArgsForCall = append(fake.jSONMarshalV3ArgsForCall, struct { 42 }{}) 43 fake.recordInvocation("JSONMarshalV3", []interface{}{}) 44 fake.jSONMarshalV3Mutex.Unlock() 45 if fake.JSONMarshalV3Stub != nil { 46 return fake.JSONMarshalV3Stub() 47 } 48 if specificReturn { 49 return ret.result1, ret.result2 50 } 51 fakeReturns := fake.jSONMarshalV3Returns 52 return fakeReturns.result1, fakeReturns.result2 53 } 54 55 func (fake *FakeDataInterface) JSONMarshalV3CallCount() int { 56 fake.jSONMarshalV3Mutex.RLock() 57 defer fake.jSONMarshalV3Mutex.RUnlock() 58 return len(fake.jSONMarshalV3ArgsForCall) 59 } 60 61 func (fake *FakeDataInterface) JSONMarshalV3Calls(stub func() ([]byte, error)) { 62 fake.jSONMarshalV3Mutex.Lock() 63 defer fake.jSONMarshalV3Mutex.Unlock() 64 fake.JSONMarshalV3Stub = stub 65 } 66 67 func (fake *FakeDataInterface) JSONMarshalV3Returns(result1 []byte, result2 error) { 68 fake.jSONMarshalV3Mutex.Lock() 69 defer fake.jSONMarshalV3Mutex.Unlock() 70 fake.JSONMarshalV3Stub = nil 71 fake.jSONMarshalV3Returns = struct { 72 result1 []byte 73 result2 error 74 }{result1, result2} 75 } 76 77 func (fake *FakeDataInterface) JSONMarshalV3ReturnsOnCall(i int, result1 []byte, result2 error) { 78 fake.jSONMarshalV3Mutex.Lock() 79 defer fake.jSONMarshalV3Mutex.Unlock() 80 fake.JSONMarshalV3Stub = nil 81 if fake.jSONMarshalV3ReturnsOnCall == nil { 82 fake.jSONMarshalV3ReturnsOnCall = make(map[int]struct { 83 result1 []byte 84 result2 error 85 }) 86 } 87 fake.jSONMarshalV3ReturnsOnCall[i] = struct { 88 result1 []byte 89 result2 error 90 }{result1, result2} 91 } 92 93 func (fake *FakeDataInterface) JSONUnmarshalV3(arg1 []byte) error { 94 var arg1Copy []byte 95 if arg1 != nil { 96 arg1Copy = make([]byte, len(arg1)) 97 copy(arg1Copy, arg1) 98 } 99 fake.jSONUnmarshalV3Mutex.Lock() 100 ret, specificReturn := fake.jSONUnmarshalV3ReturnsOnCall[len(fake.jSONUnmarshalV3ArgsForCall)] 101 fake.jSONUnmarshalV3ArgsForCall = append(fake.jSONUnmarshalV3ArgsForCall, struct { 102 arg1 []byte 103 }{arg1Copy}) 104 fake.recordInvocation("JSONUnmarshalV3", []interface{}{arg1Copy}) 105 fake.jSONUnmarshalV3Mutex.Unlock() 106 if fake.JSONUnmarshalV3Stub != nil { 107 return fake.JSONUnmarshalV3Stub(arg1) 108 } 109 if specificReturn { 110 return ret.result1 111 } 112 fakeReturns := fake.jSONUnmarshalV3Returns 113 return fakeReturns.result1 114 } 115 116 func (fake *FakeDataInterface) JSONUnmarshalV3CallCount() int { 117 fake.jSONUnmarshalV3Mutex.RLock() 118 defer fake.jSONUnmarshalV3Mutex.RUnlock() 119 return len(fake.jSONUnmarshalV3ArgsForCall) 120 } 121 122 func (fake *FakeDataInterface) JSONUnmarshalV3Calls(stub func([]byte) error) { 123 fake.jSONUnmarshalV3Mutex.Lock() 124 defer fake.jSONUnmarshalV3Mutex.Unlock() 125 fake.JSONUnmarshalV3Stub = stub 126 } 127 128 func (fake *FakeDataInterface) JSONUnmarshalV3ArgsForCall(i int) []byte { 129 fake.jSONUnmarshalV3Mutex.RLock() 130 defer fake.jSONUnmarshalV3Mutex.RUnlock() 131 argsForCall := fake.jSONUnmarshalV3ArgsForCall[i] 132 return argsForCall.arg1 133 } 134 135 func (fake *FakeDataInterface) JSONUnmarshalV3Returns(result1 error) { 136 fake.jSONUnmarshalV3Mutex.Lock() 137 defer fake.jSONUnmarshalV3Mutex.Unlock() 138 fake.JSONUnmarshalV3Stub = nil 139 fake.jSONUnmarshalV3Returns = struct { 140 result1 error 141 }{result1} 142 } 143 144 func (fake *FakeDataInterface) JSONUnmarshalV3ReturnsOnCall(i int, result1 error) { 145 fake.jSONUnmarshalV3Mutex.Lock() 146 defer fake.jSONUnmarshalV3Mutex.Unlock() 147 fake.JSONUnmarshalV3Stub = nil 148 if fake.jSONUnmarshalV3ReturnsOnCall == nil { 149 fake.jSONUnmarshalV3ReturnsOnCall = make(map[int]struct { 150 result1 error 151 }) 152 } 153 fake.jSONUnmarshalV3ReturnsOnCall[i] = struct { 154 result1 error 155 }{result1} 156 } 157 158 func (fake *FakeDataInterface) Invocations() map[string][][]interface{} { 159 fake.invocationsMutex.RLock() 160 defer fake.invocationsMutex.RUnlock() 161 fake.jSONMarshalV3Mutex.RLock() 162 defer fake.jSONMarshalV3Mutex.RUnlock() 163 fake.jSONUnmarshalV3Mutex.RLock() 164 defer fake.jSONUnmarshalV3Mutex.RUnlock() 165 copiedInvocations := map[string][][]interface{}{} 166 for key, value := range fake.invocations { 167 copiedInvocations[key] = value 168 } 169 return copiedInvocations 170 } 171 172 func (fake *FakeDataInterface) recordInvocation(key string, args []interface{}) { 173 fake.invocationsMutex.Lock() 174 defer fake.invocationsMutex.Unlock() 175 if fake.invocations == nil { 176 fake.invocations = map[string][][]interface{}{} 177 } 178 if fake.invocations[key] == nil { 179 fake.invocations[key] = [][]interface{}{} 180 } 181 fake.invocations[key] = append(fake.invocations[key], args) 182 } 183 184 var _ configuration.DataInterface = new(FakeDataInterface)