github.com/orange-cloudfoundry/cli@v7.1.0+incompatible/command/v6/v6fakes/fake_create_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 FakeCreateServiceActor struct {
    12  	CreateServiceInstanceStub        func(string, string, string, string, string, map[string]interface{}, []string) (v2action.ServiceInstance, v2action.Warnings, error)
    13  	createServiceInstanceMutex       sync.RWMutex
    14  	createServiceInstanceArgsForCall []struct {
    15  		arg1 string
    16  		arg2 string
    17  		arg3 string
    18  		arg4 string
    19  		arg5 string
    20  		arg6 map[string]interface{}
    21  		arg7 []string
    22  	}
    23  	createServiceInstanceReturns struct {
    24  		result1 v2action.ServiceInstance
    25  		result2 v2action.Warnings
    26  		result3 error
    27  	}
    28  	createServiceInstanceReturnsOnCall map[int]struct {
    29  		result1 v2action.ServiceInstance
    30  		result2 v2action.Warnings
    31  		result3 error
    32  	}
    33  	invocations      map[string][][]interface{}
    34  	invocationsMutex sync.RWMutex
    35  }
    36  
    37  func (fake *FakeCreateServiceActor) CreateServiceInstance(arg1 string, arg2 string, arg3 string, arg4 string, arg5 string, arg6 map[string]interface{}, arg7 []string) (v2action.ServiceInstance, v2action.Warnings, error) {
    38  	var arg7Copy []string
    39  	if arg7 != nil {
    40  		arg7Copy = make([]string, len(arg7))
    41  		copy(arg7Copy, arg7)
    42  	}
    43  	fake.createServiceInstanceMutex.Lock()
    44  	ret, specificReturn := fake.createServiceInstanceReturnsOnCall[len(fake.createServiceInstanceArgsForCall)]
    45  	fake.createServiceInstanceArgsForCall = append(fake.createServiceInstanceArgsForCall, struct {
    46  		arg1 string
    47  		arg2 string
    48  		arg3 string
    49  		arg4 string
    50  		arg5 string
    51  		arg6 map[string]interface{}
    52  		arg7 []string
    53  	}{arg1, arg2, arg3, arg4, arg5, arg6, arg7Copy})
    54  	fake.recordInvocation("CreateServiceInstance", []interface{}{arg1, arg2, arg3, arg4, arg5, arg6, arg7Copy})
    55  	fake.createServiceInstanceMutex.Unlock()
    56  	if fake.CreateServiceInstanceStub != nil {
    57  		return fake.CreateServiceInstanceStub(arg1, arg2, arg3, arg4, arg5, arg6, arg7)
    58  	}
    59  	if specificReturn {
    60  		return ret.result1, ret.result2, ret.result3
    61  	}
    62  	fakeReturns := fake.createServiceInstanceReturns
    63  	return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3
    64  }
    65  
    66  func (fake *FakeCreateServiceActor) CreateServiceInstanceCallCount() int {
    67  	fake.createServiceInstanceMutex.RLock()
    68  	defer fake.createServiceInstanceMutex.RUnlock()
    69  	return len(fake.createServiceInstanceArgsForCall)
    70  }
    71  
    72  func (fake *FakeCreateServiceActor) CreateServiceInstanceCalls(stub func(string, string, string, string, string, map[string]interface{}, []string) (v2action.ServiceInstance, v2action.Warnings, error)) {
    73  	fake.createServiceInstanceMutex.Lock()
    74  	defer fake.createServiceInstanceMutex.Unlock()
    75  	fake.CreateServiceInstanceStub = stub
    76  }
    77  
    78  func (fake *FakeCreateServiceActor) CreateServiceInstanceArgsForCall(i int) (string, string, string, string, string, map[string]interface{}, []string) {
    79  	fake.createServiceInstanceMutex.RLock()
    80  	defer fake.createServiceInstanceMutex.RUnlock()
    81  	argsForCall := fake.createServiceInstanceArgsForCall[i]
    82  	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5, argsForCall.arg6, argsForCall.arg7
    83  }
    84  
    85  func (fake *FakeCreateServiceActor) CreateServiceInstanceReturns(result1 v2action.ServiceInstance, result2 v2action.Warnings, result3 error) {
    86  	fake.createServiceInstanceMutex.Lock()
    87  	defer fake.createServiceInstanceMutex.Unlock()
    88  	fake.CreateServiceInstanceStub = nil
    89  	fake.createServiceInstanceReturns = struct {
    90  		result1 v2action.ServiceInstance
    91  		result2 v2action.Warnings
    92  		result3 error
    93  	}{result1, result2, result3}
    94  }
    95  
    96  func (fake *FakeCreateServiceActor) CreateServiceInstanceReturnsOnCall(i int, result1 v2action.ServiceInstance, result2 v2action.Warnings, result3 error) {
    97  	fake.createServiceInstanceMutex.Lock()
    98  	defer fake.createServiceInstanceMutex.Unlock()
    99  	fake.CreateServiceInstanceStub = nil
   100  	if fake.createServiceInstanceReturnsOnCall == nil {
   101  		fake.createServiceInstanceReturnsOnCall = make(map[int]struct {
   102  			result1 v2action.ServiceInstance
   103  			result2 v2action.Warnings
   104  			result3 error
   105  		})
   106  	}
   107  	fake.createServiceInstanceReturnsOnCall[i] = struct {
   108  		result1 v2action.ServiceInstance
   109  		result2 v2action.Warnings
   110  		result3 error
   111  	}{result1, result2, result3}
   112  }
   113  
   114  func (fake *FakeCreateServiceActor) Invocations() map[string][][]interface{} {
   115  	fake.invocationsMutex.RLock()
   116  	defer fake.invocationsMutex.RUnlock()
   117  	fake.createServiceInstanceMutex.RLock()
   118  	defer fake.createServiceInstanceMutex.RUnlock()
   119  	copiedInvocations := map[string][][]interface{}{}
   120  	for key, value := range fake.invocations {
   121  		copiedInvocations[key] = value
   122  	}
   123  	return copiedInvocations
   124  }
   125  
   126  func (fake *FakeCreateServiceActor) recordInvocation(key string, args []interface{}) {
   127  	fake.invocationsMutex.Lock()
   128  	defer fake.invocationsMutex.Unlock()
   129  	if fake.invocations == nil {
   130  		fake.invocations = map[string][][]interface{}{}
   131  	}
   132  	if fake.invocations[key] == nil {
   133  		fake.invocations[key] = [][]interface{}{}
   134  	}
   135  	fake.invocations[key] = append(fake.invocations[key], args)
   136  }
   137  
   138  var _ v6.CreateServiceActor = new(FakeCreateServiceActor)