github.com/lukasheimann/cloudfoundrycli@v7.1.0+incompatible/api/uaa/uaafakes/fake_connection_wrapper.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package uaafakes
     3  
     4  import (
     5  	"net/http"
     6  	"sync"
     7  
     8  	"code.cloudfoundry.org/cli/api/uaa"
     9  )
    10  
    11  type FakeConnectionWrapper struct {
    12  	MakeStub        func(*http.Request, *uaa.Response) error
    13  	makeMutex       sync.RWMutex
    14  	makeArgsForCall []struct {
    15  		arg1 *http.Request
    16  		arg2 *uaa.Response
    17  	}
    18  	makeReturns struct {
    19  		result1 error
    20  	}
    21  	makeReturnsOnCall map[int]struct {
    22  		result1 error
    23  	}
    24  	WrapStub        func(uaa.Connection) uaa.Connection
    25  	wrapMutex       sync.RWMutex
    26  	wrapArgsForCall []struct {
    27  		arg1 uaa.Connection
    28  	}
    29  	wrapReturns struct {
    30  		result1 uaa.Connection
    31  	}
    32  	wrapReturnsOnCall map[int]struct {
    33  		result1 uaa.Connection
    34  	}
    35  	invocations      map[string][][]interface{}
    36  	invocationsMutex sync.RWMutex
    37  }
    38  
    39  func (fake *FakeConnectionWrapper) Make(arg1 *http.Request, arg2 *uaa.Response) error {
    40  	fake.makeMutex.Lock()
    41  	ret, specificReturn := fake.makeReturnsOnCall[len(fake.makeArgsForCall)]
    42  	fake.makeArgsForCall = append(fake.makeArgsForCall, struct {
    43  		arg1 *http.Request
    44  		arg2 *uaa.Response
    45  	}{arg1, arg2})
    46  	fake.recordInvocation("Make", []interface{}{arg1, arg2})
    47  	fake.makeMutex.Unlock()
    48  	if fake.MakeStub != nil {
    49  		return fake.MakeStub(arg1, arg2)
    50  	}
    51  	if specificReturn {
    52  		return ret.result1
    53  	}
    54  	fakeReturns := fake.makeReturns
    55  	return fakeReturns.result1
    56  }
    57  
    58  func (fake *FakeConnectionWrapper) MakeCallCount() int {
    59  	fake.makeMutex.RLock()
    60  	defer fake.makeMutex.RUnlock()
    61  	return len(fake.makeArgsForCall)
    62  }
    63  
    64  func (fake *FakeConnectionWrapper) MakeCalls(stub func(*http.Request, *uaa.Response) error) {
    65  	fake.makeMutex.Lock()
    66  	defer fake.makeMutex.Unlock()
    67  	fake.MakeStub = stub
    68  }
    69  
    70  func (fake *FakeConnectionWrapper) MakeArgsForCall(i int) (*http.Request, *uaa.Response) {
    71  	fake.makeMutex.RLock()
    72  	defer fake.makeMutex.RUnlock()
    73  	argsForCall := fake.makeArgsForCall[i]
    74  	return argsForCall.arg1, argsForCall.arg2
    75  }
    76  
    77  func (fake *FakeConnectionWrapper) MakeReturns(result1 error) {
    78  	fake.makeMutex.Lock()
    79  	defer fake.makeMutex.Unlock()
    80  	fake.MakeStub = nil
    81  	fake.makeReturns = struct {
    82  		result1 error
    83  	}{result1}
    84  }
    85  
    86  func (fake *FakeConnectionWrapper) MakeReturnsOnCall(i int, result1 error) {
    87  	fake.makeMutex.Lock()
    88  	defer fake.makeMutex.Unlock()
    89  	fake.MakeStub = nil
    90  	if fake.makeReturnsOnCall == nil {
    91  		fake.makeReturnsOnCall = make(map[int]struct {
    92  			result1 error
    93  		})
    94  	}
    95  	fake.makeReturnsOnCall[i] = struct {
    96  		result1 error
    97  	}{result1}
    98  }
    99  
   100  func (fake *FakeConnectionWrapper) Wrap(arg1 uaa.Connection) uaa.Connection {
   101  	fake.wrapMutex.Lock()
   102  	ret, specificReturn := fake.wrapReturnsOnCall[len(fake.wrapArgsForCall)]
   103  	fake.wrapArgsForCall = append(fake.wrapArgsForCall, struct {
   104  		arg1 uaa.Connection
   105  	}{arg1})
   106  	fake.recordInvocation("Wrap", []interface{}{arg1})
   107  	fake.wrapMutex.Unlock()
   108  	if fake.WrapStub != nil {
   109  		return fake.WrapStub(arg1)
   110  	}
   111  	if specificReturn {
   112  		return ret.result1
   113  	}
   114  	fakeReturns := fake.wrapReturns
   115  	return fakeReturns.result1
   116  }
   117  
   118  func (fake *FakeConnectionWrapper) WrapCallCount() int {
   119  	fake.wrapMutex.RLock()
   120  	defer fake.wrapMutex.RUnlock()
   121  	return len(fake.wrapArgsForCall)
   122  }
   123  
   124  func (fake *FakeConnectionWrapper) WrapCalls(stub func(uaa.Connection) uaa.Connection) {
   125  	fake.wrapMutex.Lock()
   126  	defer fake.wrapMutex.Unlock()
   127  	fake.WrapStub = stub
   128  }
   129  
   130  func (fake *FakeConnectionWrapper) WrapArgsForCall(i int) uaa.Connection {
   131  	fake.wrapMutex.RLock()
   132  	defer fake.wrapMutex.RUnlock()
   133  	argsForCall := fake.wrapArgsForCall[i]
   134  	return argsForCall.arg1
   135  }
   136  
   137  func (fake *FakeConnectionWrapper) WrapReturns(result1 uaa.Connection) {
   138  	fake.wrapMutex.Lock()
   139  	defer fake.wrapMutex.Unlock()
   140  	fake.WrapStub = nil
   141  	fake.wrapReturns = struct {
   142  		result1 uaa.Connection
   143  	}{result1}
   144  }
   145  
   146  func (fake *FakeConnectionWrapper) WrapReturnsOnCall(i int, result1 uaa.Connection) {
   147  	fake.wrapMutex.Lock()
   148  	defer fake.wrapMutex.Unlock()
   149  	fake.WrapStub = nil
   150  	if fake.wrapReturnsOnCall == nil {
   151  		fake.wrapReturnsOnCall = make(map[int]struct {
   152  			result1 uaa.Connection
   153  		})
   154  	}
   155  	fake.wrapReturnsOnCall[i] = struct {
   156  		result1 uaa.Connection
   157  	}{result1}
   158  }
   159  
   160  func (fake *FakeConnectionWrapper) Invocations() map[string][][]interface{} {
   161  	fake.invocationsMutex.RLock()
   162  	defer fake.invocationsMutex.RUnlock()
   163  	fake.makeMutex.RLock()
   164  	defer fake.makeMutex.RUnlock()
   165  	fake.wrapMutex.RLock()
   166  	defer fake.wrapMutex.RUnlock()
   167  	copiedInvocations := map[string][][]interface{}{}
   168  	for key, value := range fake.invocations {
   169  		copiedInvocations[key] = value
   170  	}
   171  	return copiedInvocations
   172  }
   173  
   174  func (fake *FakeConnectionWrapper) recordInvocation(key string, args []interface{}) {
   175  	fake.invocationsMutex.Lock()
   176  	defer fake.invocationsMutex.Unlock()
   177  	if fake.invocations == nil {
   178  		fake.invocations = map[string][][]interface{}{}
   179  	}
   180  	if fake.invocations[key] == nil {
   181  		fake.invocations[key] = [][]interface{}{}
   182  	}
   183  	fake.invocations[key] = append(fake.invocations[key], args)
   184  }
   185  
   186  var _ uaa.ConnectionWrapper = new(FakeConnectionWrapper)