github.com/lukasheimann/cloudfoundrycli@v7.1.0+incompatible/cf/net/netfakes/fake_request_dumper_interface.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package netfakes 3 4 import ( 5 "net/http" 6 "sync" 7 8 "code.cloudfoundry.org/cli/cf/net" 9 ) 10 11 type FakeRequestDumperInterface struct { 12 DumpRequestStub func(*http.Request) 13 dumpRequestMutex sync.RWMutex 14 dumpRequestArgsForCall []struct { 15 arg1 *http.Request 16 } 17 DumpResponseStub func(*http.Response) 18 dumpResponseMutex sync.RWMutex 19 dumpResponseArgsForCall []struct { 20 arg1 *http.Response 21 } 22 invocations map[string][][]interface{} 23 invocationsMutex sync.RWMutex 24 } 25 26 func (fake *FakeRequestDumperInterface) DumpRequest(arg1 *http.Request) { 27 fake.dumpRequestMutex.Lock() 28 fake.dumpRequestArgsForCall = append(fake.dumpRequestArgsForCall, struct { 29 arg1 *http.Request 30 }{arg1}) 31 fake.recordInvocation("DumpRequest", []interface{}{arg1}) 32 fake.dumpRequestMutex.Unlock() 33 if fake.DumpRequestStub != nil { 34 fake.DumpRequestStub(arg1) 35 } 36 } 37 38 func (fake *FakeRequestDumperInterface) DumpRequestCallCount() int { 39 fake.dumpRequestMutex.RLock() 40 defer fake.dumpRequestMutex.RUnlock() 41 return len(fake.dumpRequestArgsForCall) 42 } 43 44 func (fake *FakeRequestDumperInterface) DumpRequestCalls(stub func(*http.Request)) { 45 fake.dumpRequestMutex.Lock() 46 defer fake.dumpRequestMutex.Unlock() 47 fake.DumpRequestStub = stub 48 } 49 50 func (fake *FakeRequestDumperInterface) DumpRequestArgsForCall(i int) *http.Request { 51 fake.dumpRequestMutex.RLock() 52 defer fake.dumpRequestMutex.RUnlock() 53 argsForCall := fake.dumpRequestArgsForCall[i] 54 return argsForCall.arg1 55 } 56 57 func (fake *FakeRequestDumperInterface) DumpResponse(arg1 *http.Response) { 58 fake.dumpResponseMutex.Lock() 59 fake.dumpResponseArgsForCall = append(fake.dumpResponseArgsForCall, struct { 60 arg1 *http.Response 61 }{arg1}) 62 fake.recordInvocation("DumpResponse", []interface{}{arg1}) 63 fake.dumpResponseMutex.Unlock() 64 if fake.DumpResponseStub != nil { 65 fake.DumpResponseStub(arg1) 66 } 67 } 68 69 func (fake *FakeRequestDumperInterface) DumpResponseCallCount() int { 70 fake.dumpResponseMutex.RLock() 71 defer fake.dumpResponseMutex.RUnlock() 72 return len(fake.dumpResponseArgsForCall) 73 } 74 75 func (fake *FakeRequestDumperInterface) DumpResponseCalls(stub func(*http.Response)) { 76 fake.dumpResponseMutex.Lock() 77 defer fake.dumpResponseMutex.Unlock() 78 fake.DumpResponseStub = stub 79 } 80 81 func (fake *FakeRequestDumperInterface) DumpResponseArgsForCall(i int) *http.Response { 82 fake.dumpResponseMutex.RLock() 83 defer fake.dumpResponseMutex.RUnlock() 84 argsForCall := fake.dumpResponseArgsForCall[i] 85 return argsForCall.arg1 86 } 87 88 func (fake *FakeRequestDumperInterface) Invocations() map[string][][]interface{} { 89 fake.invocationsMutex.RLock() 90 defer fake.invocationsMutex.RUnlock() 91 fake.dumpRequestMutex.RLock() 92 defer fake.dumpRequestMutex.RUnlock() 93 fake.dumpResponseMutex.RLock() 94 defer fake.dumpResponseMutex.RUnlock() 95 copiedInvocations := map[string][][]interface{}{} 96 for key, value := range fake.invocations { 97 copiedInvocations[key] = value 98 } 99 return copiedInvocations 100 } 101 102 func (fake *FakeRequestDumperInterface) recordInvocation(key string, args []interface{}) { 103 fake.invocationsMutex.Lock() 104 defer fake.invocationsMutex.Unlock() 105 if fake.invocations == nil { 106 fake.invocations = map[string][][]interface{}{} 107 } 108 if fake.invocations[key] == nil { 109 fake.invocations[key] = [][]interface{}{} 110 } 111 fake.invocations[key] = append(fake.invocations[key], args) 112 } 113 114 var _ net.RequestDumperInterface = new(FakeRequestDumperInterface)