github.com/pf-qiu/concourse/v6@v6.7.3-0.20201207032516-1f455d73275f/atc/exec/execfakes/fake_put_delegate_factory.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package execfakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"github.com/pf-qiu/concourse/v6/atc/exec"
     8  )
     9  
    10  type FakePutDelegateFactory struct {
    11  	PutDelegateStub        func(exec.RunState) exec.PutDelegate
    12  	putDelegateMutex       sync.RWMutex
    13  	putDelegateArgsForCall []struct {
    14  		arg1 exec.RunState
    15  	}
    16  	putDelegateReturns struct {
    17  		result1 exec.PutDelegate
    18  	}
    19  	putDelegateReturnsOnCall map[int]struct {
    20  		result1 exec.PutDelegate
    21  	}
    22  	invocations      map[string][][]interface{}
    23  	invocationsMutex sync.RWMutex
    24  }
    25  
    26  func (fake *FakePutDelegateFactory) PutDelegate(arg1 exec.RunState) exec.PutDelegate {
    27  	fake.putDelegateMutex.Lock()
    28  	ret, specificReturn := fake.putDelegateReturnsOnCall[len(fake.putDelegateArgsForCall)]
    29  	fake.putDelegateArgsForCall = append(fake.putDelegateArgsForCall, struct {
    30  		arg1 exec.RunState
    31  	}{arg1})
    32  	fake.recordInvocation("PutDelegate", []interface{}{arg1})
    33  	fake.putDelegateMutex.Unlock()
    34  	if fake.PutDelegateStub != nil {
    35  		return fake.PutDelegateStub(arg1)
    36  	}
    37  	if specificReturn {
    38  		return ret.result1
    39  	}
    40  	fakeReturns := fake.putDelegateReturns
    41  	return fakeReturns.result1
    42  }
    43  
    44  func (fake *FakePutDelegateFactory) PutDelegateCallCount() int {
    45  	fake.putDelegateMutex.RLock()
    46  	defer fake.putDelegateMutex.RUnlock()
    47  	return len(fake.putDelegateArgsForCall)
    48  }
    49  
    50  func (fake *FakePutDelegateFactory) PutDelegateCalls(stub func(exec.RunState) exec.PutDelegate) {
    51  	fake.putDelegateMutex.Lock()
    52  	defer fake.putDelegateMutex.Unlock()
    53  	fake.PutDelegateStub = stub
    54  }
    55  
    56  func (fake *FakePutDelegateFactory) PutDelegateArgsForCall(i int) exec.RunState {
    57  	fake.putDelegateMutex.RLock()
    58  	defer fake.putDelegateMutex.RUnlock()
    59  	argsForCall := fake.putDelegateArgsForCall[i]
    60  	return argsForCall.arg1
    61  }
    62  
    63  func (fake *FakePutDelegateFactory) PutDelegateReturns(result1 exec.PutDelegate) {
    64  	fake.putDelegateMutex.Lock()
    65  	defer fake.putDelegateMutex.Unlock()
    66  	fake.PutDelegateStub = nil
    67  	fake.putDelegateReturns = struct {
    68  		result1 exec.PutDelegate
    69  	}{result1}
    70  }
    71  
    72  func (fake *FakePutDelegateFactory) PutDelegateReturnsOnCall(i int, result1 exec.PutDelegate) {
    73  	fake.putDelegateMutex.Lock()
    74  	defer fake.putDelegateMutex.Unlock()
    75  	fake.PutDelegateStub = nil
    76  	if fake.putDelegateReturnsOnCall == nil {
    77  		fake.putDelegateReturnsOnCall = make(map[int]struct {
    78  			result1 exec.PutDelegate
    79  		})
    80  	}
    81  	fake.putDelegateReturnsOnCall[i] = struct {
    82  		result1 exec.PutDelegate
    83  	}{result1}
    84  }
    85  
    86  func (fake *FakePutDelegateFactory) Invocations() map[string][][]interface{} {
    87  	fake.invocationsMutex.RLock()
    88  	defer fake.invocationsMutex.RUnlock()
    89  	fake.putDelegateMutex.RLock()
    90  	defer fake.putDelegateMutex.RUnlock()
    91  	copiedInvocations := map[string][][]interface{}{}
    92  	for key, value := range fake.invocations {
    93  		copiedInvocations[key] = value
    94  	}
    95  	return copiedInvocations
    96  }
    97  
    98  func (fake *FakePutDelegateFactory) recordInvocation(key string, args []interface{}) {
    99  	fake.invocationsMutex.Lock()
   100  	defer fake.invocationsMutex.Unlock()
   101  	if fake.invocations == nil {
   102  		fake.invocations = map[string][][]interface{}{}
   103  	}
   104  	if fake.invocations[key] == nil {
   105  		fake.invocations[key] = [][]interface{}{}
   106  	}
   107  	fake.invocations[key] = append(fake.invocations[key], args)
   108  }
   109  
   110  var _ exec.PutDelegateFactory = new(FakePutDelegateFactory)