github.com/loggregator/cli@v6.33.1-0.20180224010324-82334f081791+incompatible/cf/net/netfakes/fake_request_dumper_interface.go (about)

     1  // This file was generated by counterfeiter
     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) DumpRequestArgsForCall(i int) *http.Request {
    45  	fake.dumpRequestMutex.RLock()
    46  	defer fake.dumpRequestMutex.RUnlock()
    47  	return fake.dumpRequestArgsForCall[i].arg1
    48  }
    49  
    50  func (fake *FakeRequestDumperInterface) DumpResponse(arg1 *http.Response) {
    51  	fake.dumpResponseMutex.Lock()
    52  	fake.dumpResponseArgsForCall = append(fake.dumpResponseArgsForCall, struct {
    53  		arg1 *http.Response
    54  	}{arg1})
    55  	fake.recordInvocation("DumpResponse", []interface{}{arg1})
    56  	fake.dumpResponseMutex.Unlock()
    57  	if fake.DumpResponseStub != nil {
    58  		fake.DumpResponseStub(arg1)
    59  	}
    60  }
    61  
    62  func (fake *FakeRequestDumperInterface) DumpResponseCallCount() int {
    63  	fake.dumpResponseMutex.RLock()
    64  	defer fake.dumpResponseMutex.RUnlock()
    65  	return len(fake.dumpResponseArgsForCall)
    66  }
    67  
    68  func (fake *FakeRequestDumperInterface) DumpResponseArgsForCall(i int) *http.Response {
    69  	fake.dumpResponseMutex.RLock()
    70  	defer fake.dumpResponseMutex.RUnlock()
    71  	return fake.dumpResponseArgsForCall[i].arg1
    72  }
    73  
    74  func (fake *FakeRequestDumperInterface) Invocations() map[string][][]interface{} {
    75  	fake.invocationsMutex.RLock()
    76  	defer fake.invocationsMutex.RUnlock()
    77  	fake.dumpRequestMutex.RLock()
    78  	defer fake.dumpRequestMutex.RUnlock()
    79  	fake.dumpResponseMutex.RLock()
    80  	defer fake.dumpResponseMutex.RUnlock()
    81  	return fake.invocations
    82  }
    83  
    84  func (fake *FakeRequestDumperInterface) recordInvocation(key string, args []interface{}) {
    85  	fake.invocationsMutex.Lock()
    86  	defer fake.invocationsMutex.Unlock()
    87  	if fake.invocations == nil {
    88  		fake.invocations = map[string][][]interface{}{}
    89  	}
    90  	if fake.invocations[key] == nil {
    91  		fake.invocations[key] = [][]interface{}{}
    92  	}
    93  	fake.invocations[key] = append(fake.invocations[key], args)
    94  }
    95  
    96  var _ net.RequestDumperInterface = new(FakeRequestDumperInterface)