github.com/cloudfoundry-incubator/stembuild@v0.0.0-20211223202937-5b61d62226c6/construct/constructfakes/fake_vmconnection_validator.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package constructfakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"github.com/cloudfoundry-incubator/stembuild/construct"
     8  )
     9  
    10  type FakeVMConnectionValidator struct {
    11  	ValidateStub        func() error
    12  	validateMutex       sync.RWMutex
    13  	validateArgsForCall []struct {
    14  	}
    15  	validateReturns struct {
    16  		result1 error
    17  	}
    18  	validateReturnsOnCall map[int]struct {
    19  		result1 error
    20  	}
    21  	invocations      map[string][][]interface{}
    22  	invocationsMutex sync.RWMutex
    23  }
    24  
    25  func (fake *FakeVMConnectionValidator) Validate() error {
    26  	fake.validateMutex.Lock()
    27  	ret, specificReturn := fake.validateReturnsOnCall[len(fake.validateArgsForCall)]
    28  	fake.validateArgsForCall = append(fake.validateArgsForCall, struct {
    29  	}{})
    30  	fake.recordInvocation("Validate", []interface{}{})
    31  	fake.validateMutex.Unlock()
    32  	if fake.ValidateStub != nil {
    33  		return fake.ValidateStub()
    34  	}
    35  	if specificReturn {
    36  		return ret.result1
    37  	}
    38  	fakeReturns := fake.validateReturns
    39  	return fakeReturns.result1
    40  }
    41  
    42  func (fake *FakeVMConnectionValidator) ValidateCallCount() int {
    43  	fake.validateMutex.RLock()
    44  	defer fake.validateMutex.RUnlock()
    45  	return len(fake.validateArgsForCall)
    46  }
    47  
    48  func (fake *FakeVMConnectionValidator) ValidateCalls(stub func() error) {
    49  	fake.validateMutex.Lock()
    50  	defer fake.validateMutex.Unlock()
    51  	fake.ValidateStub = stub
    52  }
    53  
    54  func (fake *FakeVMConnectionValidator) ValidateReturns(result1 error) {
    55  	fake.validateMutex.Lock()
    56  	defer fake.validateMutex.Unlock()
    57  	fake.ValidateStub = nil
    58  	fake.validateReturns = struct {
    59  		result1 error
    60  	}{result1}
    61  }
    62  
    63  func (fake *FakeVMConnectionValidator) ValidateReturnsOnCall(i int, result1 error) {
    64  	fake.validateMutex.Lock()
    65  	defer fake.validateMutex.Unlock()
    66  	fake.ValidateStub = nil
    67  	if fake.validateReturnsOnCall == nil {
    68  		fake.validateReturnsOnCall = make(map[int]struct {
    69  			result1 error
    70  		})
    71  	}
    72  	fake.validateReturnsOnCall[i] = struct {
    73  		result1 error
    74  	}{result1}
    75  }
    76  
    77  func (fake *FakeVMConnectionValidator) Invocations() map[string][][]interface{} {
    78  	fake.invocationsMutex.RLock()
    79  	defer fake.invocationsMutex.RUnlock()
    80  	fake.validateMutex.RLock()
    81  	defer fake.validateMutex.RUnlock()
    82  	copiedInvocations := map[string][][]interface{}{}
    83  	for key, value := range fake.invocations {
    84  		copiedInvocations[key] = value
    85  	}
    86  	return copiedInvocations
    87  }
    88  
    89  func (fake *FakeVMConnectionValidator) recordInvocation(key string, args []interface{}) {
    90  	fake.invocationsMutex.Lock()
    91  	defer fake.invocationsMutex.Unlock()
    92  	if fake.invocations == nil {
    93  		fake.invocations = map[string][][]interface{}{}
    94  	}
    95  	if fake.invocations[key] == nil {
    96  		fake.invocations[key] = [][]interface{}{}
    97  	}
    98  	fake.invocations[key] = append(fake.invocations[key], args)
    99  }
   100  
   101  var _ construct.VMConnectionValidator = new(FakeVMConnectionValidator)