github.com/cloudfoundry-incubator/stembuild@v0.0.0-20211223202937-5b61d62226c6/commandparser/commandparserfakes/fake_construct_messenger.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package commandparserfakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"github.com/cloudfoundry-incubator/stembuild/commandparser"
     8  )
     9  
    10  type FakeConstructMessenger struct {
    11  	ArgumentsNotProvidedStub        func()
    12  	argumentsNotProvidedMutex       sync.RWMutex
    13  	argumentsNotProvidedArgsForCall []struct {
    14  	}
    15  	CannotConnectToVMStub        func(error)
    16  	cannotConnectToVMMutex       sync.RWMutex
    17  	cannotConnectToVMArgsForCall []struct {
    18  		arg1 error
    19  	}
    20  	CannotPrepareVMStub        func(error)
    21  	cannotPrepareVMMutex       sync.RWMutex
    22  	cannotPrepareVMArgsForCall []struct {
    23  		arg1 error
    24  	}
    25  	LGPONotFoundStub        func()
    26  	lGPONotFoundMutex       sync.RWMutex
    27  	lGPONotFoundArgsForCall []struct {
    28  	}
    29  	invocations      map[string][][]interface{}
    30  	invocationsMutex sync.RWMutex
    31  }
    32  
    33  func (fake *FakeConstructMessenger) ArgumentsNotProvided() {
    34  	fake.argumentsNotProvidedMutex.Lock()
    35  	fake.argumentsNotProvidedArgsForCall = append(fake.argumentsNotProvidedArgsForCall, struct {
    36  	}{})
    37  	fake.recordInvocation("ArgumentsNotProvided", []interface{}{})
    38  	fake.argumentsNotProvidedMutex.Unlock()
    39  	if fake.ArgumentsNotProvidedStub != nil {
    40  		fake.ArgumentsNotProvidedStub()
    41  	}
    42  }
    43  
    44  func (fake *FakeConstructMessenger) ArgumentsNotProvidedCallCount() int {
    45  	fake.argumentsNotProvidedMutex.RLock()
    46  	defer fake.argumentsNotProvidedMutex.RUnlock()
    47  	return len(fake.argumentsNotProvidedArgsForCall)
    48  }
    49  
    50  func (fake *FakeConstructMessenger) ArgumentsNotProvidedCalls(stub func()) {
    51  	fake.argumentsNotProvidedMutex.Lock()
    52  	defer fake.argumentsNotProvidedMutex.Unlock()
    53  	fake.ArgumentsNotProvidedStub = stub
    54  }
    55  
    56  func (fake *FakeConstructMessenger) CannotConnectToVM(arg1 error) {
    57  	fake.cannotConnectToVMMutex.Lock()
    58  	fake.cannotConnectToVMArgsForCall = append(fake.cannotConnectToVMArgsForCall, struct {
    59  		arg1 error
    60  	}{arg1})
    61  	fake.recordInvocation("CannotConnectToVM", []interface{}{arg1})
    62  	fake.cannotConnectToVMMutex.Unlock()
    63  	if fake.CannotConnectToVMStub != nil {
    64  		fake.CannotConnectToVMStub(arg1)
    65  	}
    66  }
    67  
    68  func (fake *FakeConstructMessenger) CannotConnectToVMCallCount() int {
    69  	fake.cannotConnectToVMMutex.RLock()
    70  	defer fake.cannotConnectToVMMutex.RUnlock()
    71  	return len(fake.cannotConnectToVMArgsForCall)
    72  }
    73  
    74  func (fake *FakeConstructMessenger) CannotConnectToVMCalls(stub func(error)) {
    75  	fake.cannotConnectToVMMutex.Lock()
    76  	defer fake.cannotConnectToVMMutex.Unlock()
    77  	fake.CannotConnectToVMStub = stub
    78  }
    79  
    80  func (fake *FakeConstructMessenger) CannotConnectToVMArgsForCall(i int) error {
    81  	fake.cannotConnectToVMMutex.RLock()
    82  	defer fake.cannotConnectToVMMutex.RUnlock()
    83  	argsForCall := fake.cannotConnectToVMArgsForCall[i]
    84  	return argsForCall.arg1
    85  }
    86  
    87  func (fake *FakeConstructMessenger) CannotPrepareVM(arg1 error) {
    88  	fake.cannotPrepareVMMutex.Lock()
    89  	fake.cannotPrepareVMArgsForCall = append(fake.cannotPrepareVMArgsForCall, struct {
    90  		arg1 error
    91  	}{arg1})
    92  	fake.recordInvocation("CannotPrepareVM", []interface{}{arg1})
    93  	fake.cannotPrepareVMMutex.Unlock()
    94  	if fake.CannotPrepareVMStub != nil {
    95  		fake.CannotPrepareVMStub(arg1)
    96  	}
    97  }
    98  
    99  func (fake *FakeConstructMessenger) CannotPrepareVMCallCount() int {
   100  	fake.cannotPrepareVMMutex.RLock()
   101  	defer fake.cannotPrepareVMMutex.RUnlock()
   102  	return len(fake.cannotPrepareVMArgsForCall)
   103  }
   104  
   105  func (fake *FakeConstructMessenger) CannotPrepareVMCalls(stub func(error)) {
   106  	fake.cannotPrepareVMMutex.Lock()
   107  	defer fake.cannotPrepareVMMutex.Unlock()
   108  	fake.CannotPrepareVMStub = stub
   109  }
   110  
   111  func (fake *FakeConstructMessenger) CannotPrepareVMArgsForCall(i int) error {
   112  	fake.cannotPrepareVMMutex.RLock()
   113  	defer fake.cannotPrepareVMMutex.RUnlock()
   114  	argsForCall := fake.cannotPrepareVMArgsForCall[i]
   115  	return argsForCall.arg1
   116  }
   117  
   118  func (fake *FakeConstructMessenger) LGPONotFound() {
   119  	fake.lGPONotFoundMutex.Lock()
   120  	fake.lGPONotFoundArgsForCall = append(fake.lGPONotFoundArgsForCall, struct {
   121  	}{})
   122  	fake.recordInvocation("LGPONotFound", []interface{}{})
   123  	fake.lGPONotFoundMutex.Unlock()
   124  	if fake.LGPONotFoundStub != nil {
   125  		fake.LGPONotFoundStub()
   126  	}
   127  }
   128  
   129  func (fake *FakeConstructMessenger) LGPONotFoundCallCount() int {
   130  	fake.lGPONotFoundMutex.RLock()
   131  	defer fake.lGPONotFoundMutex.RUnlock()
   132  	return len(fake.lGPONotFoundArgsForCall)
   133  }
   134  
   135  func (fake *FakeConstructMessenger) LGPONotFoundCalls(stub func()) {
   136  	fake.lGPONotFoundMutex.Lock()
   137  	defer fake.lGPONotFoundMutex.Unlock()
   138  	fake.LGPONotFoundStub = stub
   139  }
   140  
   141  func (fake *FakeConstructMessenger) Invocations() map[string][][]interface{} {
   142  	fake.invocationsMutex.RLock()
   143  	defer fake.invocationsMutex.RUnlock()
   144  	fake.argumentsNotProvidedMutex.RLock()
   145  	defer fake.argumentsNotProvidedMutex.RUnlock()
   146  	fake.cannotConnectToVMMutex.RLock()
   147  	defer fake.cannotConnectToVMMutex.RUnlock()
   148  	fake.cannotPrepareVMMutex.RLock()
   149  	defer fake.cannotPrepareVMMutex.RUnlock()
   150  	fake.lGPONotFoundMutex.RLock()
   151  	defer fake.lGPONotFoundMutex.RUnlock()
   152  	copiedInvocations := map[string][][]interface{}{}
   153  	for key, value := range fake.invocations {
   154  		copiedInvocations[key] = value
   155  	}
   156  	return copiedInvocations
   157  }
   158  
   159  func (fake *FakeConstructMessenger) recordInvocation(key string, args []interface{}) {
   160  	fake.invocationsMutex.Lock()
   161  	defer fake.invocationsMutex.Unlock()
   162  	if fake.invocations == nil {
   163  		fake.invocations = map[string][][]interface{}{}
   164  	}
   165  	if fake.invocations[key] == nil {
   166  		fake.invocations[key] = [][]interface{}{}
   167  	}
   168  	fake.invocations[key] = append(fake.invocations[key], args)
   169  }
   170  
   171  var _ commandparser.ConstructMessenger = new(FakeConstructMessenger)