github.com/orange-cloudfoundry/cli@v7.1.0+incompatible/command/v6/v6fakes/fake_service_actor.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package v6fakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"code.cloudfoundry.org/cli/actor/v2action"
     8  	v6 "code.cloudfoundry.org/cli/command/v6"
     9  )
    10  
    11  type FakeServiceActor struct {
    12  	CloudControllerAPIVersionStub        func() string
    13  	cloudControllerAPIVersionMutex       sync.RWMutex
    14  	cloudControllerAPIVersionArgsForCall []struct {
    15  	}
    16  	cloudControllerAPIVersionReturns struct {
    17  		result1 string
    18  	}
    19  	cloudControllerAPIVersionReturnsOnCall map[int]struct {
    20  		result1 string
    21  	}
    22  	GetServiceInstanceByNameAndSpaceStub        func(string, string) (v2action.ServiceInstance, v2action.Warnings, error)
    23  	getServiceInstanceByNameAndSpaceMutex       sync.RWMutex
    24  	getServiceInstanceByNameAndSpaceArgsForCall []struct {
    25  		arg1 string
    26  		arg2 string
    27  	}
    28  	getServiceInstanceByNameAndSpaceReturns struct {
    29  		result1 v2action.ServiceInstance
    30  		result2 v2action.Warnings
    31  		result3 error
    32  	}
    33  	getServiceInstanceByNameAndSpaceReturnsOnCall map[int]struct {
    34  		result1 v2action.ServiceInstance
    35  		result2 v2action.Warnings
    36  		result3 error
    37  	}
    38  	GetServiceInstanceSummaryByNameAndSpaceStub        func(string, string) (v2action.ServiceInstanceSummary, v2action.Warnings, error)
    39  	getServiceInstanceSummaryByNameAndSpaceMutex       sync.RWMutex
    40  	getServiceInstanceSummaryByNameAndSpaceArgsForCall []struct {
    41  		arg1 string
    42  		arg2 string
    43  	}
    44  	getServiceInstanceSummaryByNameAndSpaceReturns struct {
    45  		result1 v2action.ServiceInstanceSummary
    46  		result2 v2action.Warnings
    47  		result3 error
    48  	}
    49  	getServiceInstanceSummaryByNameAndSpaceReturnsOnCall map[int]struct {
    50  		result1 v2action.ServiceInstanceSummary
    51  		result2 v2action.Warnings
    52  		result3 error
    53  	}
    54  	invocations      map[string][][]interface{}
    55  	invocationsMutex sync.RWMutex
    56  }
    57  
    58  func (fake *FakeServiceActor) CloudControllerAPIVersion() string {
    59  	fake.cloudControllerAPIVersionMutex.Lock()
    60  	ret, specificReturn := fake.cloudControllerAPIVersionReturnsOnCall[len(fake.cloudControllerAPIVersionArgsForCall)]
    61  	fake.cloudControllerAPIVersionArgsForCall = append(fake.cloudControllerAPIVersionArgsForCall, struct {
    62  	}{})
    63  	fake.recordInvocation("CloudControllerAPIVersion", []interface{}{})
    64  	fake.cloudControllerAPIVersionMutex.Unlock()
    65  	if fake.CloudControllerAPIVersionStub != nil {
    66  		return fake.CloudControllerAPIVersionStub()
    67  	}
    68  	if specificReturn {
    69  		return ret.result1
    70  	}
    71  	fakeReturns := fake.cloudControllerAPIVersionReturns
    72  	return fakeReturns.result1
    73  }
    74  
    75  func (fake *FakeServiceActor) CloudControllerAPIVersionCallCount() int {
    76  	fake.cloudControllerAPIVersionMutex.RLock()
    77  	defer fake.cloudControllerAPIVersionMutex.RUnlock()
    78  	return len(fake.cloudControllerAPIVersionArgsForCall)
    79  }
    80  
    81  func (fake *FakeServiceActor) CloudControllerAPIVersionCalls(stub func() string) {
    82  	fake.cloudControllerAPIVersionMutex.Lock()
    83  	defer fake.cloudControllerAPIVersionMutex.Unlock()
    84  	fake.CloudControllerAPIVersionStub = stub
    85  }
    86  
    87  func (fake *FakeServiceActor) CloudControllerAPIVersionReturns(result1 string) {
    88  	fake.cloudControllerAPIVersionMutex.Lock()
    89  	defer fake.cloudControllerAPIVersionMutex.Unlock()
    90  	fake.CloudControllerAPIVersionStub = nil
    91  	fake.cloudControllerAPIVersionReturns = struct {
    92  		result1 string
    93  	}{result1}
    94  }
    95  
    96  func (fake *FakeServiceActor) CloudControllerAPIVersionReturnsOnCall(i int, result1 string) {
    97  	fake.cloudControllerAPIVersionMutex.Lock()
    98  	defer fake.cloudControllerAPIVersionMutex.Unlock()
    99  	fake.CloudControllerAPIVersionStub = nil
   100  	if fake.cloudControllerAPIVersionReturnsOnCall == nil {
   101  		fake.cloudControllerAPIVersionReturnsOnCall = make(map[int]struct {
   102  			result1 string
   103  		})
   104  	}
   105  	fake.cloudControllerAPIVersionReturnsOnCall[i] = struct {
   106  		result1 string
   107  	}{result1}
   108  }
   109  
   110  func (fake *FakeServiceActor) GetServiceInstanceByNameAndSpace(arg1 string, arg2 string) (v2action.ServiceInstance, v2action.Warnings, error) {
   111  	fake.getServiceInstanceByNameAndSpaceMutex.Lock()
   112  	ret, specificReturn := fake.getServiceInstanceByNameAndSpaceReturnsOnCall[len(fake.getServiceInstanceByNameAndSpaceArgsForCall)]
   113  	fake.getServiceInstanceByNameAndSpaceArgsForCall = append(fake.getServiceInstanceByNameAndSpaceArgsForCall, struct {
   114  		arg1 string
   115  		arg2 string
   116  	}{arg1, arg2})
   117  	fake.recordInvocation("GetServiceInstanceByNameAndSpace", []interface{}{arg1, arg2})
   118  	fake.getServiceInstanceByNameAndSpaceMutex.Unlock()
   119  	if fake.GetServiceInstanceByNameAndSpaceStub != nil {
   120  		return fake.GetServiceInstanceByNameAndSpaceStub(arg1, arg2)
   121  	}
   122  	if specificReturn {
   123  		return ret.result1, ret.result2, ret.result3
   124  	}
   125  	fakeReturns := fake.getServiceInstanceByNameAndSpaceReturns
   126  	return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3
   127  }
   128  
   129  func (fake *FakeServiceActor) GetServiceInstanceByNameAndSpaceCallCount() int {
   130  	fake.getServiceInstanceByNameAndSpaceMutex.RLock()
   131  	defer fake.getServiceInstanceByNameAndSpaceMutex.RUnlock()
   132  	return len(fake.getServiceInstanceByNameAndSpaceArgsForCall)
   133  }
   134  
   135  func (fake *FakeServiceActor) GetServiceInstanceByNameAndSpaceCalls(stub func(string, string) (v2action.ServiceInstance, v2action.Warnings, error)) {
   136  	fake.getServiceInstanceByNameAndSpaceMutex.Lock()
   137  	defer fake.getServiceInstanceByNameAndSpaceMutex.Unlock()
   138  	fake.GetServiceInstanceByNameAndSpaceStub = stub
   139  }
   140  
   141  func (fake *FakeServiceActor) GetServiceInstanceByNameAndSpaceArgsForCall(i int) (string, string) {
   142  	fake.getServiceInstanceByNameAndSpaceMutex.RLock()
   143  	defer fake.getServiceInstanceByNameAndSpaceMutex.RUnlock()
   144  	argsForCall := fake.getServiceInstanceByNameAndSpaceArgsForCall[i]
   145  	return argsForCall.arg1, argsForCall.arg2
   146  }
   147  
   148  func (fake *FakeServiceActor) GetServiceInstanceByNameAndSpaceReturns(result1 v2action.ServiceInstance, result2 v2action.Warnings, result3 error) {
   149  	fake.getServiceInstanceByNameAndSpaceMutex.Lock()
   150  	defer fake.getServiceInstanceByNameAndSpaceMutex.Unlock()
   151  	fake.GetServiceInstanceByNameAndSpaceStub = nil
   152  	fake.getServiceInstanceByNameAndSpaceReturns = struct {
   153  		result1 v2action.ServiceInstance
   154  		result2 v2action.Warnings
   155  		result3 error
   156  	}{result1, result2, result3}
   157  }
   158  
   159  func (fake *FakeServiceActor) GetServiceInstanceByNameAndSpaceReturnsOnCall(i int, result1 v2action.ServiceInstance, result2 v2action.Warnings, result3 error) {
   160  	fake.getServiceInstanceByNameAndSpaceMutex.Lock()
   161  	defer fake.getServiceInstanceByNameAndSpaceMutex.Unlock()
   162  	fake.GetServiceInstanceByNameAndSpaceStub = nil
   163  	if fake.getServiceInstanceByNameAndSpaceReturnsOnCall == nil {
   164  		fake.getServiceInstanceByNameAndSpaceReturnsOnCall = make(map[int]struct {
   165  			result1 v2action.ServiceInstance
   166  			result2 v2action.Warnings
   167  			result3 error
   168  		})
   169  	}
   170  	fake.getServiceInstanceByNameAndSpaceReturnsOnCall[i] = struct {
   171  		result1 v2action.ServiceInstance
   172  		result2 v2action.Warnings
   173  		result3 error
   174  	}{result1, result2, result3}
   175  }
   176  
   177  func (fake *FakeServiceActor) GetServiceInstanceSummaryByNameAndSpace(arg1 string, arg2 string) (v2action.ServiceInstanceSummary, v2action.Warnings, error) {
   178  	fake.getServiceInstanceSummaryByNameAndSpaceMutex.Lock()
   179  	ret, specificReturn := fake.getServiceInstanceSummaryByNameAndSpaceReturnsOnCall[len(fake.getServiceInstanceSummaryByNameAndSpaceArgsForCall)]
   180  	fake.getServiceInstanceSummaryByNameAndSpaceArgsForCall = append(fake.getServiceInstanceSummaryByNameAndSpaceArgsForCall, struct {
   181  		arg1 string
   182  		arg2 string
   183  	}{arg1, arg2})
   184  	fake.recordInvocation("GetServiceInstanceSummaryByNameAndSpace", []interface{}{arg1, arg2})
   185  	fake.getServiceInstanceSummaryByNameAndSpaceMutex.Unlock()
   186  	if fake.GetServiceInstanceSummaryByNameAndSpaceStub != nil {
   187  		return fake.GetServiceInstanceSummaryByNameAndSpaceStub(arg1, arg2)
   188  	}
   189  	if specificReturn {
   190  		return ret.result1, ret.result2, ret.result3
   191  	}
   192  	fakeReturns := fake.getServiceInstanceSummaryByNameAndSpaceReturns
   193  	return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3
   194  }
   195  
   196  func (fake *FakeServiceActor) GetServiceInstanceSummaryByNameAndSpaceCallCount() int {
   197  	fake.getServiceInstanceSummaryByNameAndSpaceMutex.RLock()
   198  	defer fake.getServiceInstanceSummaryByNameAndSpaceMutex.RUnlock()
   199  	return len(fake.getServiceInstanceSummaryByNameAndSpaceArgsForCall)
   200  }
   201  
   202  func (fake *FakeServiceActor) GetServiceInstanceSummaryByNameAndSpaceCalls(stub func(string, string) (v2action.ServiceInstanceSummary, v2action.Warnings, error)) {
   203  	fake.getServiceInstanceSummaryByNameAndSpaceMutex.Lock()
   204  	defer fake.getServiceInstanceSummaryByNameAndSpaceMutex.Unlock()
   205  	fake.GetServiceInstanceSummaryByNameAndSpaceStub = stub
   206  }
   207  
   208  func (fake *FakeServiceActor) GetServiceInstanceSummaryByNameAndSpaceArgsForCall(i int) (string, string) {
   209  	fake.getServiceInstanceSummaryByNameAndSpaceMutex.RLock()
   210  	defer fake.getServiceInstanceSummaryByNameAndSpaceMutex.RUnlock()
   211  	argsForCall := fake.getServiceInstanceSummaryByNameAndSpaceArgsForCall[i]
   212  	return argsForCall.arg1, argsForCall.arg2
   213  }
   214  
   215  func (fake *FakeServiceActor) GetServiceInstanceSummaryByNameAndSpaceReturns(result1 v2action.ServiceInstanceSummary, result2 v2action.Warnings, result3 error) {
   216  	fake.getServiceInstanceSummaryByNameAndSpaceMutex.Lock()
   217  	defer fake.getServiceInstanceSummaryByNameAndSpaceMutex.Unlock()
   218  	fake.GetServiceInstanceSummaryByNameAndSpaceStub = nil
   219  	fake.getServiceInstanceSummaryByNameAndSpaceReturns = struct {
   220  		result1 v2action.ServiceInstanceSummary
   221  		result2 v2action.Warnings
   222  		result3 error
   223  	}{result1, result2, result3}
   224  }
   225  
   226  func (fake *FakeServiceActor) GetServiceInstanceSummaryByNameAndSpaceReturnsOnCall(i int, result1 v2action.ServiceInstanceSummary, result2 v2action.Warnings, result3 error) {
   227  	fake.getServiceInstanceSummaryByNameAndSpaceMutex.Lock()
   228  	defer fake.getServiceInstanceSummaryByNameAndSpaceMutex.Unlock()
   229  	fake.GetServiceInstanceSummaryByNameAndSpaceStub = nil
   230  	if fake.getServiceInstanceSummaryByNameAndSpaceReturnsOnCall == nil {
   231  		fake.getServiceInstanceSummaryByNameAndSpaceReturnsOnCall = make(map[int]struct {
   232  			result1 v2action.ServiceInstanceSummary
   233  			result2 v2action.Warnings
   234  			result3 error
   235  		})
   236  	}
   237  	fake.getServiceInstanceSummaryByNameAndSpaceReturnsOnCall[i] = struct {
   238  		result1 v2action.ServiceInstanceSummary
   239  		result2 v2action.Warnings
   240  		result3 error
   241  	}{result1, result2, result3}
   242  }
   243  
   244  func (fake *FakeServiceActor) Invocations() map[string][][]interface{} {
   245  	fake.invocationsMutex.RLock()
   246  	defer fake.invocationsMutex.RUnlock()
   247  	fake.cloudControllerAPIVersionMutex.RLock()
   248  	defer fake.cloudControllerAPIVersionMutex.RUnlock()
   249  	fake.getServiceInstanceByNameAndSpaceMutex.RLock()
   250  	defer fake.getServiceInstanceByNameAndSpaceMutex.RUnlock()
   251  	fake.getServiceInstanceSummaryByNameAndSpaceMutex.RLock()
   252  	defer fake.getServiceInstanceSummaryByNameAndSpaceMutex.RUnlock()
   253  	copiedInvocations := map[string][][]interface{}{}
   254  	for key, value := range fake.invocations {
   255  		copiedInvocations[key] = value
   256  	}
   257  	return copiedInvocations
   258  }
   259  
   260  func (fake *FakeServiceActor) recordInvocation(key string, args []interface{}) {
   261  	fake.invocationsMutex.Lock()
   262  	defer fake.invocationsMutex.Unlock()
   263  	if fake.invocations == nil {
   264  		fake.invocations = map[string][][]interface{}{}
   265  	}
   266  	if fake.invocations[key] == nil {
   267  		fake.invocations[key] = [][]interface{}{}
   268  	}
   269  	fake.invocations[key] = append(fake.invocations[key], args)
   270  }
   271  
   272  var _ v6.ServiceActor = new(FakeServiceActor)