github.com/cloudfoundry-incubator/stembuild@v0.0.0-20211223202937-5b61d62226c6/construct/constructfakes/fake_version_getter.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 FakeVersionGetter struct {
    11  	GetVersionStub        func() string
    12  	getVersionMutex       sync.RWMutex
    13  	getVersionArgsForCall []struct {
    14  	}
    15  	getVersionReturns struct {
    16  		result1 string
    17  	}
    18  	getVersionReturnsOnCall map[int]struct {
    19  		result1 string
    20  	}
    21  	invocations      map[string][][]interface{}
    22  	invocationsMutex sync.RWMutex
    23  }
    24  
    25  func (fake *FakeVersionGetter) GetVersion() string {
    26  	fake.getVersionMutex.Lock()
    27  	ret, specificReturn := fake.getVersionReturnsOnCall[len(fake.getVersionArgsForCall)]
    28  	fake.getVersionArgsForCall = append(fake.getVersionArgsForCall, struct {
    29  	}{})
    30  	fake.recordInvocation("GetVersion", []interface{}{})
    31  	fake.getVersionMutex.Unlock()
    32  	if fake.GetVersionStub != nil {
    33  		return fake.GetVersionStub()
    34  	}
    35  	if specificReturn {
    36  		return ret.result1
    37  	}
    38  	fakeReturns := fake.getVersionReturns
    39  	return fakeReturns.result1
    40  }
    41  
    42  func (fake *FakeVersionGetter) GetVersionCallCount() int {
    43  	fake.getVersionMutex.RLock()
    44  	defer fake.getVersionMutex.RUnlock()
    45  	return len(fake.getVersionArgsForCall)
    46  }
    47  
    48  func (fake *FakeVersionGetter) GetVersionCalls(stub func() string) {
    49  	fake.getVersionMutex.Lock()
    50  	defer fake.getVersionMutex.Unlock()
    51  	fake.GetVersionStub = stub
    52  }
    53  
    54  func (fake *FakeVersionGetter) GetVersionReturns(result1 string) {
    55  	fake.getVersionMutex.Lock()
    56  	defer fake.getVersionMutex.Unlock()
    57  	fake.GetVersionStub = nil
    58  	fake.getVersionReturns = struct {
    59  		result1 string
    60  	}{result1}
    61  }
    62  
    63  func (fake *FakeVersionGetter) GetVersionReturnsOnCall(i int, result1 string) {
    64  	fake.getVersionMutex.Lock()
    65  	defer fake.getVersionMutex.Unlock()
    66  	fake.GetVersionStub = nil
    67  	if fake.getVersionReturnsOnCall == nil {
    68  		fake.getVersionReturnsOnCall = make(map[int]struct {
    69  			result1 string
    70  		})
    71  	}
    72  	fake.getVersionReturnsOnCall[i] = struct {
    73  		result1 string
    74  	}{result1}
    75  }
    76  
    77  func (fake *FakeVersionGetter) Invocations() map[string][][]interface{} {
    78  	fake.invocationsMutex.RLock()
    79  	defer fake.invocationsMutex.RUnlock()
    80  	fake.getVersionMutex.RLock()
    81  	defer fake.getVersionMutex.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 *FakeVersionGetter) 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.VersionGetter = new(FakeVersionGetter)