code.cloudfoundry.org/cli@v7.1.0+incompatible/cf/net/netfakes/fake_warning_producer.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package netfakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"code.cloudfoundry.org/cli/cf/net"
     8  )
     9  
    10  type FakeWarningProducer struct {
    11  	WarningsStub        func() []string
    12  	warningsMutex       sync.RWMutex
    13  	warningsArgsForCall []struct {
    14  	}
    15  	warningsReturns struct {
    16  		result1 []string
    17  	}
    18  	warningsReturnsOnCall map[int]struct {
    19  		result1 []string
    20  	}
    21  	invocations      map[string][][]interface{}
    22  	invocationsMutex sync.RWMutex
    23  }
    24  
    25  func (fake *FakeWarningProducer) Warnings() []string {
    26  	fake.warningsMutex.Lock()
    27  	ret, specificReturn := fake.warningsReturnsOnCall[len(fake.warningsArgsForCall)]
    28  	fake.warningsArgsForCall = append(fake.warningsArgsForCall, struct {
    29  	}{})
    30  	fake.recordInvocation("Warnings", []interface{}{})
    31  	fake.warningsMutex.Unlock()
    32  	if fake.WarningsStub != nil {
    33  		return fake.WarningsStub()
    34  	}
    35  	if specificReturn {
    36  		return ret.result1
    37  	}
    38  	fakeReturns := fake.warningsReturns
    39  	return fakeReturns.result1
    40  }
    41  
    42  func (fake *FakeWarningProducer) WarningsCallCount() int {
    43  	fake.warningsMutex.RLock()
    44  	defer fake.warningsMutex.RUnlock()
    45  	return len(fake.warningsArgsForCall)
    46  }
    47  
    48  func (fake *FakeWarningProducer) WarningsCalls(stub func() []string) {
    49  	fake.warningsMutex.Lock()
    50  	defer fake.warningsMutex.Unlock()
    51  	fake.WarningsStub = stub
    52  }
    53  
    54  func (fake *FakeWarningProducer) WarningsReturns(result1 []string) {
    55  	fake.warningsMutex.Lock()
    56  	defer fake.warningsMutex.Unlock()
    57  	fake.WarningsStub = nil
    58  	fake.warningsReturns = struct {
    59  		result1 []string
    60  	}{result1}
    61  }
    62  
    63  func (fake *FakeWarningProducer) WarningsReturnsOnCall(i int, result1 []string) {
    64  	fake.warningsMutex.Lock()
    65  	defer fake.warningsMutex.Unlock()
    66  	fake.WarningsStub = nil
    67  	if fake.warningsReturnsOnCall == nil {
    68  		fake.warningsReturnsOnCall = make(map[int]struct {
    69  			result1 []string
    70  		})
    71  	}
    72  	fake.warningsReturnsOnCall[i] = struct {
    73  		result1 []string
    74  	}{result1}
    75  }
    76  
    77  func (fake *FakeWarningProducer) Invocations() map[string][][]interface{} {
    78  	fake.invocationsMutex.RLock()
    79  	defer fake.invocationsMutex.RUnlock()
    80  	fake.warningsMutex.RLock()
    81  	defer fake.warningsMutex.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 *FakeWarningProducer) 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 _ net.WarningProducer = new(FakeWarningProducer)