github.com/swisscom/cloudfoundry-cli@v7.1.0+incompatible/actor/v2action/composite/compositefakes/fake_broker_actor.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package compositefakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"code.cloudfoundry.org/cli/actor/v2action"
     8  	"code.cloudfoundry.org/cli/actor/v2action/composite"
     9  )
    10  
    11  type FakeBrokerActor struct {
    12  	GetServiceBrokerByNameStub        func(string) (v2action.ServiceBroker, v2action.Warnings, error)
    13  	getServiceBrokerByNameMutex       sync.RWMutex
    14  	getServiceBrokerByNameArgsForCall []struct {
    15  		arg1 string
    16  	}
    17  	getServiceBrokerByNameReturns struct {
    18  		result1 v2action.ServiceBroker
    19  		result2 v2action.Warnings
    20  		result3 error
    21  	}
    22  	getServiceBrokerByNameReturnsOnCall map[int]struct {
    23  		result1 v2action.ServiceBroker
    24  		result2 v2action.Warnings
    25  		result3 error
    26  	}
    27  	GetServiceBrokersStub        func() ([]v2action.ServiceBroker, v2action.Warnings, error)
    28  	getServiceBrokersMutex       sync.RWMutex
    29  	getServiceBrokersArgsForCall []struct {
    30  	}
    31  	getServiceBrokersReturns struct {
    32  		result1 []v2action.ServiceBroker
    33  		result2 v2action.Warnings
    34  		result3 error
    35  	}
    36  	getServiceBrokersReturnsOnCall map[int]struct {
    37  		result1 []v2action.ServiceBroker
    38  		result2 v2action.Warnings
    39  		result3 error
    40  	}
    41  	invocations      map[string][][]interface{}
    42  	invocationsMutex sync.RWMutex
    43  }
    44  
    45  func (fake *FakeBrokerActor) GetServiceBrokerByName(arg1 string) (v2action.ServiceBroker, v2action.Warnings, error) {
    46  	fake.getServiceBrokerByNameMutex.Lock()
    47  	ret, specificReturn := fake.getServiceBrokerByNameReturnsOnCall[len(fake.getServiceBrokerByNameArgsForCall)]
    48  	fake.getServiceBrokerByNameArgsForCall = append(fake.getServiceBrokerByNameArgsForCall, struct {
    49  		arg1 string
    50  	}{arg1})
    51  	fake.recordInvocation("GetServiceBrokerByName", []interface{}{arg1})
    52  	fake.getServiceBrokerByNameMutex.Unlock()
    53  	if fake.GetServiceBrokerByNameStub != nil {
    54  		return fake.GetServiceBrokerByNameStub(arg1)
    55  	}
    56  	if specificReturn {
    57  		return ret.result1, ret.result2, ret.result3
    58  	}
    59  	fakeReturns := fake.getServiceBrokerByNameReturns
    60  	return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3
    61  }
    62  
    63  func (fake *FakeBrokerActor) GetServiceBrokerByNameCallCount() int {
    64  	fake.getServiceBrokerByNameMutex.RLock()
    65  	defer fake.getServiceBrokerByNameMutex.RUnlock()
    66  	return len(fake.getServiceBrokerByNameArgsForCall)
    67  }
    68  
    69  func (fake *FakeBrokerActor) GetServiceBrokerByNameCalls(stub func(string) (v2action.ServiceBroker, v2action.Warnings, error)) {
    70  	fake.getServiceBrokerByNameMutex.Lock()
    71  	defer fake.getServiceBrokerByNameMutex.Unlock()
    72  	fake.GetServiceBrokerByNameStub = stub
    73  }
    74  
    75  func (fake *FakeBrokerActor) GetServiceBrokerByNameArgsForCall(i int) string {
    76  	fake.getServiceBrokerByNameMutex.RLock()
    77  	defer fake.getServiceBrokerByNameMutex.RUnlock()
    78  	argsForCall := fake.getServiceBrokerByNameArgsForCall[i]
    79  	return argsForCall.arg1
    80  }
    81  
    82  func (fake *FakeBrokerActor) GetServiceBrokerByNameReturns(result1 v2action.ServiceBroker, result2 v2action.Warnings, result3 error) {
    83  	fake.getServiceBrokerByNameMutex.Lock()
    84  	defer fake.getServiceBrokerByNameMutex.Unlock()
    85  	fake.GetServiceBrokerByNameStub = nil
    86  	fake.getServiceBrokerByNameReturns = struct {
    87  		result1 v2action.ServiceBroker
    88  		result2 v2action.Warnings
    89  		result3 error
    90  	}{result1, result2, result3}
    91  }
    92  
    93  func (fake *FakeBrokerActor) GetServiceBrokerByNameReturnsOnCall(i int, result1 v2action.ServiceBroker, result2 v2action.Warnings, result3 error) {
    94  	fake.getServiceBrokerByNameMutex.Lock()
    95  	defer fake.getServiceBrokerByNameMutex.Unlock()
    96  	fake.GetServiceBrokerByNameStub = nil
    97  	if fake.getServiceBrokerByNameReturnsOnCall == nil {
    98  		fake.getServiceBrokerByNameReturnsOnCall = make(map[int]struct {
    99  			result1 v2action.ServiceBroker
   100  			result2 v2action.Warnings
   101  			result3 error
   102  		})
   103  	}
   104  	fake.getServiceBrokerByNameReturnsOnCall[i] = struct {
   105  		result1 v2action.ServiceBroker
   106  		result2 v2action.Warnings
   107  		result3 error
   108  	}{result1, result2, result3}
   109  }
   110  
   111  func (fake *FakeBrokerActor) GetServiceBrokers() ([]v2action.ServiceBroker, v2action.Warnings, error) {
   112  	fake.getServiceBrokersMutex.Lock()
   113  	ret, specificReturn := fake.getServiceBrokersReturnsOnCall[len(fake.getServiceBrokersArgsForCall)]
   114  	fake.getServiceBrokersArgsForCall = append(fake.getServiceBrokersArgsForCall, struct {
   115  	}{})
   116  	fake.recordInvocation("GetServiceBrokers", []interface{}{})
   117  	fake.getServiceBrokersMutex.Unlock()
   118  	if fake.GetServiceBrokersStub != nil {
   119  		return fake.GetServiceBrokersStub()
   120  	}
   121  	if specificReturn {
   122  		return ret.result1, ret.result2, ret.result3
   123  	}
   124  	fakeReturns := fake.getServiceBrokersReturns
   125  	return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3
   126  }
   127  
   128  func (fake *FakeBrokerActor) GetServiceBrokersCallCount() int {
   129  	fake.getServiceBrokersMutex.RLock()
   130  	defer fake.getServiceBrokersMutex.RUnlock()
   131  	return len(fake.getServiceBrokersArgsForCall)
   132  }
   133  
   134  func (fake *FakeBrokerActor) GetServiceBrokersCalls(stub func() ([]v2action.ServiceBroker, v2action.Warnings, error)) {
   135  	fake.getServiceBrokersMutex.Lock()
   136  	defer fake.getServiceBrokersMutex.Unlock()
   137  	fake.GetServiceBrokersStub = stub
   138  }
   139  
   140  func (fake *FakeBrokerActor) GetServiceBrokersReturns(result1 []v2action.ServiceBroker, result2 v2action.Warnings, result3 error) {
   141  	fake.getServiceBrokersMutex.Lock()
   142  	defer fake.getServiceBrokersMutex.Unlock()
   143  	fake.GetServiceBrokersStub = nil
   144  	fake.getServiceBrokersReturns = struct {
   145  		result1 []v2action.ServiceBroker
   146  		result2 v2action.Warnings
   147  		result3 error
   148  	}{result1, result2, result3}
   149  }
   150  
   151  func (fake *FakeBrokerActor) GetServiceBrokersReturnsOnCall(i int, result1 []v2action.ServiceBroker, result2 v2action.Warnings, result3 error) {
   152  	fake.getServiceBrokersMutex.Lock()
   153  	defer fake.getServiceBrokersMutex.Unlock()
   154  	fake.GetServiceBrokersStub = nil
   155  	if fake.getServiceBrokersReturnsOnCall == nil {
   156  		fake.getServiceBrokersReturnsOnCall = make(map[int]struct {
   157  			result1 []v2action.ServiceBroker
   158  			result2 v2action.Warnings
   159  			result3 error
   160  		})
   161  	}
   162  	fake.getServiceBrokersReturnsOnCall[i] = struct {
   163  		result1 []v2action.ServiceBroker
   164  		result2 v2action.Warnings
   165  		result3 error
   166  	}{result1, result2, result3}
   167  }
   168  
   169  func (fake *FakeBrokerActor) Invocations() map[string][][]interface{} {
   170  	fake.invocationsMutex.RLock()
   171  	defer fake.invocationsMutex.RUnlock()
   172  	fake.getServiceBrokerByNameMutex.RLock()
   173  	defer fake.getServiceBrokerByNameMutex.RUnlock()
   174  	fake.getServiceBrokersMutex.RLock()
   175  	defer fake.getServiceBrokersMutex.RUnlock()
   176  	copiedInvocations := map[string][][]interface{}{}
   177  	for key, value := range fake.invocations {
   178  		copiedInvocations[key] = value
   179  	}
   180  	return copiedInvocations
   181  }
   182  
   183  func (fake *FakeBrokerActor) recordInvocation(key string, args []interface{}) {
   184  	fake.invocationsMutex.Lock()
   185  	defer fake.invocationsMutex.Unlock()
   186  	if fake.invocations == nil {
   187  		fake.invocations = map[string][][]interface{}{}
   188  	}
   189  	if fake.invocations[key] == nil {
   190  		fake.invocations[key] = [][]interface{}{}
   191  	}
   192  	fake.invocations[key] = append(fake.invocations[key], args)
   193  }
   194  
   195  var _ composite.BrokerActor = new(FakeBrokerActor)