github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/command/v6/v6fakes/fake_bind_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 FakeBindServiceActor struct {
    12  	BindServiceBySpaceStub        func(string, string, string, string, map[string]interface{}) (v2action.ServiceBinding, v2action.Warnings, error)
    13  	bindServiceBySpaceMutex       sync.RWMutex
    14  	bindServiceBySpaceArgsForCall []struct {
    15  		arg1 string
    16  		arg2 string
    17  		arg3 string
    18  		arg4 string
    19  		arg5 map[string]interface{}
    20  	}
    21  	bindServiceBySpaceReturns struct {
    22  		result1 v2action.ServiceBinding
    23  		result2 v2action.Warnings
    24  		result3 error
    25  	}
    26  	bindServiceBySpaceReturnsOnCall map[int]struct {
    27  		result1 v2action.ServiceBinding
    28  		result2 v2action.Warnings
    29  		result3 error
    30  	}
    31  	CloudControllerAPIVersionStub        func() string
    32  	cloudControllerAPIVersionMutex       sync.RWMutex
    33  	cloudControllerAPIVersionArgsForCall []struct {
    34  	}
    35  	cloudControllerAPIVersionReturns struct {
    36  		result1 string
    37  	}
    38  	cloudControllerAPIVersionReturnsOnCall map[int]struct {
    39  		result1 string
    40  	}
    41  	invocations      map[string][][]interface{}
    42  	invocationsMutex sync.RWMutex
    43  }
    44  
    45  func (fake *FakeBindServiceActor) BindServiceBySpace(arg1 string, arg2 string, arg3 string, arg4 string, arg5 map[string]interface{}) (v2action.ServiceBinding, v2action.Warnings, error) {
    46  	fake.bindServiceBySpaceMutex.Lock()
    47  	ret, specificReturn := fake.bindServiceBySpaceReturnsOnCall[len(fake.bindServiceBySpaceArgsForCall)]
    48  	fake.bindServiceBySpaceArgsForCall = append(fake.bindServiceBySpaceArgsForCall, struct {
    49  		arg1 string
    50  		arg2 string
    51  		arg3 string
    52  		arg4 string
    53  		arg5 map[string]interface{}
    54  	}{arg1, arg2, arg3, arg4, arg5})
    55  	fake.recordInvocation("BindServiceBySpace", []interface{}{arg1, arg2, arg3, arg4, arg5})
    56  	fake.bindServiceBySpaceMutex.Unlock()
    57  	if fake.BindServiceBySpaceStub != nil {
    58  		return fake.BindServiceBySpaceStub(arg1, arg2, arg3, arg4, arg5)
    59  	}
    60  	if specificReturn {
    61  		return ret.result1, ret.result2, ret.result3
    62  	}
    63  	fakeReturns := fake.bindServiceBySpaceReturns
    64  	return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3
    65  }
    66  
    67  func (fake *FakeBindServiceActor) BindServiceBySpaceCallCount() int {
    68  	fake.bindServiceBySpaceMutex.RLock()
    69  	defer fake.bindServiceBySpaceMutex.RUnlock()
    70  	return len(fake.bindServiceBySpaceArgsForCall)
    71  }
    72  
    73  func (fake *FakeBindServiceActor) BindServiceBySpaceCalls(stub func(string, string, string, string, map[string]interface{}) (v2action.ServiceBinding, v2action.Warnings, error)) {
    74  	fake.bindServiceBySpaceMutex.Lock()
    75  	defer fake.bindServiceBySpaceMutex.Unlock()
    76  	fake.BindServiceBySpaceStub = stub
    77  }
    78  
    79  func (fake *FakeBindServiceActor) BindServiceBySpaceArgsForCall(i int) (string, string, string, string, map[string]interface{}) {
    80  	fake.bindServiceBySpaceMutex.RLock()
    81  	defer fake.bindServiceBySpaceMutex.RUnlock()
    82  	argsForCall := fake.bindServiceBySpaceArgsForCall[i]
    83  	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5
    84  }
    85  
    86  func (fake *FakeBindServiceActor) BindServiceBySpaceReturns(result1 v2action.ServiceBinding, result2 v2action.Warnings, result3 error) {
    87  	fake.bindServiceBySpaceMutex.Lock()
    88  	defer fake.bindServiceBySpaceMutex.Unlock()
    89  	fake.BindServiceBySpaceStub = nil
    90  	fake.bindServiceBySpaceReturns = struct {
    91  		result1 v2action.ServiceBinding
    92  		result2 v2action.Warnings
    93  		result3 error
    94  	}{result1, result2, result3}
    95  }
    96  
    97  func (fake *FakeBindServiceActor) BindServiceBySpaceReturnsOnCall(i int, result1 v2action.ServiceBinding, result2 v2action.Warnings, result3 error) {
    98  	fake.bindServiceBySpaceMutex.Lock()
    99  	defer fake.bindServiceBySpaceMutex.Unlock()
   100  	fake.BindServiceBySpaceStub = nil
   101  	if fake.bindServiceBySpaceReturnsOnCall == nil {
   102  		fake.bindServiceBySpaceReturnsOnCall = make(map[int]struct {
   103  			result1 v2action.ServiceBinding
   104  			result2 v2action.Warnings
   105  			result3 error
   106  		})
   107  	}
   108  	fake.bindServiceBySpaceReturnsOnCall[i] = struct {
   109  		result1 v2action.ServiceBinding
   110  		result2 v2action.Warnings
   111  		result3 error
   112  	}{result1, result2, result3}
   113  }
   114  
   115  func (fake *FakeBindServiceActor) CloudControllerAPIVersion() string {
   116  	fake.cloudControllerAPIVersionMutex.Lock()
   117  	ret, specificReturn := fake.cloudControllerAPIVersionReturnsOnCall[len(fake.cloudControllerAPIVersionArgsForCall)]
   118  	fake.cloudControllerAPIVersionArgsForCall = append(fake.cloudControllerAPIVersionArgsForCall, struct {
   119  	}{})
   120  	fake.recordInvocation("CloudControllerAPIVersion", []interface{}{})
   121  	fake.cloudControllerAPIVersionMutex.Unlock()
   122  	if fake.CloudControllerAPIVersionStub != nil {
   123  		return fake.CloudControllerAPIVersionStub()
   124  	}
   125  	if specificReturn {
   126  		return ret.result1
   127  	}
   128  	fakeReturns := fake.cloudControllerAPIVersionReturns
   129  	return fakeReturns.result1
   130  }
   131  
   132  func (fake *FakeBindServiceActor) CloudControllerAPIVersionCallCount() int {
   133  	fake.cloudControllerAPIVersionMutex.RLock()
   134  	defer fake.cloudControllerAPIVersionMutex.RUnlock()
   135  	return len(fake.cloudControllerAPIVersionArgsForCall)
   136  }
   137  
   138  func (fake *FakeBindServiceActor) CloudControllerAPIVersionCalls(stub func() string) {
   139  	fake.cloudControllerAPIVersionMutex.Lock()
   140  	defer fake.cloudControllerAPIVersionMutex.Unlock()
   141  	fake.CloudControllerAPIVersionStub = stub
   142  }
   143  
   144  func (fake *FakeBindServiceActor) CloudControllerAPIVersionReturns(result1 string) {
   145  	fake.cloudControllerAPIVersionMutex.Lock()
   146  	defer fake.cloudControllerAPIVersionMutex.Unlock()
   147  	fake.CloudControllerAPIVersionStub = nil
   148  	fake.cloudControllerAPIVersionReturns = struct {
   149  		result1 string
   150  	}{result1}
   151  }
   152  
   153  func (fake *FakeBindServiceActor) CloudControllerAPIVersionReturnsOnCall(i int, result1 string) {
   154  	fake.cloudControllerAPIVersionMutex.Lock()
   155  	defer fake.cloudControllerAPIVersionMutex.Unlock()
   156  	fake.CloudControllerAPIVersionStub = nil
   157  	if fake.cloudControllerAPIVersionReturnsOnCall == nil {
   158  		fake.cloudControllerAPIVersionReturnsOnCall = make(map[int]struct {
   159  			result1 string
   160  		})
   161  	}
   162  	fake.cloudControllerAPIVersionReturnsOnCall[i] = struct {
   163  		result1 string
   164  	}{result1}
   165  }
   166  
   167  func (fake *FakeBindServiceActor) Invocations() map[string][][]interface{} {
   168  	fake.invocationsMutex.RLock()
   169  	defer fake.invocationsMutex.RUnlock()
   170  	fake.bindServiceBySpaceMutex.RLock()
   171  	defer fake.bindServiceBySpaceMutex.RUnlock()
   172  	fake.cloudControllerAPIVersionMutex.RLock()
   173  	defer fake.cloudControllerAPIVersionMutex.RUnlock()
   174  	copiedInvocations := map[string][][]interface{}{}
   175  	for key, value := range fake.invocations {
   176  		copiedInvocations[key] = value
   177  	}
   178  	return copiedInvocations
   179  }
   180  
   181  func (fake *FakeBindServiceActor) recordInvocation(key string, args []interface{}) {
   182  	fake.invocationsMutex.Lock()
   183  	defer fake.invocationsMutex.Unlock()
   184  	if fake.invocations == nil {
   185  		fake.invocations = map[string][][]interface{}{}
   186  	}
   187  	if fake.invocations[key] == nil {
   188  		fake.invocations[key] = [][]interface{}{}
   189  	}
   190  	fake.invocations[key] = append(fake.invocations[key], args)
   191  }
   192  
   193  var _ v6.BindServiceActor = new(FakeBindServiceActor)