github.com/loggregator/cli@v6.33.1-0.20180224010324-82334f081791+incompatible/cf/commands/user/userfakes/fake_org_role_setter.go (about)

     1  // This file was generated by counterfeiter
     2  package userfakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"code.cloudfoundry.org/cli/cf/commandregistry"
     8  	"code.cloudfoundry.org/cli/cf/commands/user"
     9  	"code.cloudfoundry.org/cli/cf/flags"
    10  	"code.cloudfoundry.org/cli/cf/models"
    11  	"code.cloudfoundry.org/cli/cf/requirements"
    12  )
    13  
    14  type FakeOrgRoleSetter struct {
    15  	MetaDataStub        func() commandregistry.CommandMetadata
    16  	metaDataMutex       sync.RWMutex
    17  	metaDataArgsForCall []struct{}
    18  	metaDataReturns     struct {
    19  		result1 commandregistry.CommandMetadata
    20  	}
    21  	SetDependencyStub        func(deps commandregistry.Dependency, pluginCall bool) commandregistry.Command
    22  	setDependencyMutex       sync.RWMutex
    23  	setDependencyArgsForCall []struct {
    24  		deps       commandregistry.Dependency
    25  		pluginCall bool
    26  	}
    27  	setDependencyReturns struct {
    28  		result1 commandregistry.Command
    29  	}
    30  	RequirementsStub        func(requirementsFactory requirements.Factory, context flags.FlagContext) ([]requirements.Requirement, error)
    31  	requirementsMutex       sync.RWMutex
    32  	requirementsArgsForCall []struct {
    33  		requirementsFactory requirements.Factory
    34  		context             flags.FlagContext
    35  	}
    36  	requirementsReturns struct {
    37  		result1 []requirements.Requirement
    38  		result2 error
    39  	}
    40  	ExecuteStub        func(context flags.FlagContext) error
    41  	executeMutex       sync.RWMutex
    42  	executeArgsForCall []struct {
    43  		context flags.FlagContext
    44  	}
    45  	executeReturns struct {
    46  		result1 error
    47  	}
    48  	SetOrgRoleStub        func(orgGUID string, role models.Role, userGUID, userName string) error
    49  	setOrgRoleMutex       sync.RWMutex
    50  	setOrgRoleArgsForCall []struct {
    51  		orgGUID  string
    52  		role     models.Role
    53  		userGUID string
    54  		userName string
    55  	}
    56  	setOrgRoleReturns struct {
    57  		result1 error
    58  	}
    59  	invocations      map[string][][]interface{}
    60  	invocationsMutex sync.RWMutex
    61  }
    62  
    63  func (fake *FakeOrgRoleSetter) MetaData() commandregistry.CommandMetadata {
    64  	fake.metaDataMutex.Lock()
    65  	fake.metaDataArgsForCall = append(fake.metaDataArgsForCall, struct{}{})
    66  	fake.recordInvocation("MetaData", []interface{}{})
    67  	fake.metaDataMutex.Unlock()
    68  	if fake.MetaDataStub != nil {
    69  		return fake.MetaDataStub()
    70  	} else {
    71  		return fake.metaDataReturns.result1
    72  	}
    73  }
    74  
    75  func (fake *FakeOrgRoleSetter) MetaDataCallCount() int {
    76  	fake.metaDataMutex.RLock()
    77  	defer fake.metaDataMutex.RUnlock()
    78  	return len(fake.metaDataArgsForCall)
    79  }
    80  
    81  func (fake *FakeOrgRoleSetter) MetaDataReturns(result1 commandregistry.CommandMetadata) {
    82  	fake.MetaDataStub = nil
    83  	fake.metaDataReturns = struct {
    84  		result1 commandregistry.CommandMetadata
    85  	}{result1}
    86  }
    87  
    88  func (fake *FakeOrgRoleSetter) SetDependency(deps commandregistry.Dependency, pluginCall bool) commandregistry.Command {
    89  	fake.setDependencyMutex.Lock()
    90  	fake.setDependencyArgsForCall = append(fake.setDependencyArgsForCall, struct {
    91  		deps       commandregistry.Dependency
    92  		pluginCall bool
    93  	}{deps, pluginCall})
    94  	fake.recordInvocation("SetDependency", []interface{}{deps, pluginCall})
    95  	fake.setDependencyMutex.Unlock()
    96  	if fake.SetDependencyStub != nil {
    97  		return fake.SetDependencyStub(deps, pluginCall)
    98  	} else {
    99  		return fake.setDependencyReturns.result1
   100  	}
   101  }
   102  
   103  func (fake *FakeOrgRoleSetter) SetDependencyCallCount() int {
   104  	fake.setDependencyMutex.RLock()
   105  	defer fake.setDependencyMutex.RUnlock()
   106  	return len(fake.setDependencyArgsForCall)
   107  }
   108  
   109  func (fake *FakeOrgRoleSetter) SetDependencyArgsForCall(i int) (commandregistry.Dependency, bool) {
   110  	fake.setDependencyMutex.RLock()
   111  	defer fake.setDependencyMutex.RUnlock()
   112  	return fake.setDependencyArgsForCall[i].deps, fake.setDependencyArgsForCall[i].pluginCall
   113  }
   114  
   115  func (fake *FakeOrgRoleSetter) SetDependencyReturns(result1 commandregistry.Command) {
   116  	fake.SetDependencyStub = nil
   117  	fake.setDependencyReturns = struct {
   118  		result1 commandregistry.Command
   119  	}{result1}
   120  }
   121  
   122  func (fake *FakeOrgRoleSetter) Requirements(requirementsFactory requirements.Factory, context flags.FlagContext) ([]requirements.Requirement, error) {
   123  	fake.requirementsMutex.Lock()
   124  	fake.requirementsArgsForCall = append(fake.requirementsArgsForCall, struct {
   125  		requirementsFactory requirements.Factory
   126  		context             flags.FlagContext
   127  	}{requirementsFactory, context})
   128  	fake.recordInvocation("Requirements", []interface{}{requirementsFactory, context})
   129  	fake.requirementsMutex.Unlock()
   130  	if fake.RequirementsStub != nil {
   131  		return fake.RequirementsStub(requirementsFactory, context)
   132  	} else {
   133  		return fake.requirementsReturns.result1, fake.requirementsReturns.result2
   134  	}
   135  }
   136  
   137  func (fake *FakeOrgRoleSetter) RequirementsCallCount() int {
   138  	fake.requirementsMutex.RLock()
   139  	defer fake.requirementsMutex.RUnlock()
   140  	return len(fake.requirementsArgsForCall)
   141  }
   142  
   143  func (fake *FakeOrgRoleSetter) RequirementsArgsForCall(i int) (requirements.Factory, flags.FlagContext) {
   144  	fake.requirementsMutex.RLock()
   145  	defer fake.requirementsMutex.RUnlock()
   146  	return fake.requirementsArgsForCall[i].requirementsFactory, fake.requirementsArgsForCall[i].context
   147  }
   148  
   149  func (fake *FakeOrgRoleSetter) RequirementsReturns(result1 []requirements.Requirement, result2 error) {
   150  	fake.RequirementsStub = nil
   151  	fake.requirementsReturns = struct {
   152  		result1 []requirements.Requirement
   153  		result2 error
   154  	}{result1, result2}
   155  }
   156  
   157  func (fake *FakeOrgRoleSetter) Execute(context flags.FlagContext) error {
   158  	fake.executeMutex.Lock()
   159  	fake.executeArgsForCall = append(fake.executeArgsForCall, struct {
   160  		context flags.FlagContext
   161  	}{context})
   162  	fake.recordInvocation("Execute", []interface{}{context})
   163  	fake.executeMutex.Unlock()
   164  	if fake.ExecuteStub != nil {
   165  		return fake.ExecuteStub(context)
   166  	} else {
   167  		return fake.executeReturns.result1
   168  	}
   169  }
   170  
   171  func (fake *FakeOrgRoleSetter) ExecuteCallCount() int {
   172  	fake.executeMutex.RLock()
   173  	defer fake.executeMutex.RUnlock()
   174  	return len(fake.executeArgsForCall)
   175  }
   176  
   177  func (fake *FakeOrgRoleSetter) ExecuteArgsForCall(i int) flags.FlagContext {
   178  	fake.executeMutex.RLock()
   179  	defer fake.executeMutex.RUnlock()
   180  	return fake.executeArgsForCall[i].context
   181  }
   182  
   183  func (fake *FakeOrgRoleSetter) ExecuteReturns(result1 error) {
   184  	fake.ExecuteStub = nil
   185  	fake.executeReturns = struct {
   186  		result1 error
   187  	}{result1}
   188  }
   189  
   190  func (fake *FakeOrgRoleSetter) SetOrgRole(orgGUID string, role models.Role, userGUID string, userName string) error {
   191  	fake.setOrgRoleMutex.Lock()
   192  	fake.setOrgRoleArgsForCall = append(fake.setOrgRoleArgsForCall, struct {
   193  		orgGUID  string
   194  		role     models.Role
   195  		userGUID string
   196  		userName string
   197  	}{orgGUID, role, userGUID, userName})
   198  	fake.recordInvocation("SetOrgRole", []interface{}{orgGUID, role, userGUID, userName})
   199  	fake.setOrgRoleMutex.Unlock()
   200  	if fake.SetOrgRoleStub != nil {
   201  		return fake.SetOrgRoleStub(orgGUID, role, userGUID, userName)
   202  	} else {
   203  		return fake.setOrgRoleReturns.result1
   204  	}
   205  }
   206  
   207  func (fake *FakeOrgRoleSetter) SetOrgRoleCallCount() int {
   208  	fake.setOrgRoleMutex.RLock()
   209  	defer fake.setOrgRoleMutex.RUnlock()
   210  	return len(fake.setOrgRoleArgsForCall)
   211  }
   212  
   213  func (fake *FakeOrgRoleSetter) SetOrgRoleArgsForCall(i int) (string, models.Role, string, string) {
   214  	fake.setOrgRoleMutex.RLock()
   215  	defer fake.setOrgRoleMutex.RUnlock()
   216  	return fake.setOrgRoleArgsForCall[i].orgGUID, fake.setOrgRoleArgsForCall[i].role, fake.setOrgRoleArgsForCall[i].userGUID, fake.setOrgRoleArgsForCall[i].userName
   217  }
   218  
   219  func (fake *FakeOrgRoleSetter) SetOrgRoleReturns(result1 error) {
   220  	fake.SetOrgRoleStub = nil
   221  	fake.setOrgRoleReturns = struct {
   222  		result1 error
   223  	}{result1}
   224  }
   225  
   226  func (fake *FakeOrgRoleSetter) Invocations() map[string][][]interface{} {
   227  	fake.invocationsMutex.RLock()
   228  	defer fake.invocationsMutex.RUnlock()
   229  	fake.metaDataMutex.RLock()
   230  	defer fake.metaDataMutex.RUnlock()
   231  	fake.setDependencyMutex.RLock()
   232  	defer fake.setDependencyMutex.RUnlock()
   233  	fake.requirementsMutex.RLock()
   234  	defer fake.requirementsMutex.RUnlock()
   235  	fake.executeMutex.RLock()
   236  	defer fake.executeMutex.RUnlock()
   237  	fake.setOrgRoleMutex.RLock()
   238  	defer fake.setOrgRoleMutex.RUnlock()
   239  	return fake.invocations
   240  }
   241  
   242  func (fake *FakeOrgRoleSetter) recordInvocation(key string, args []interface{}) {
   243  	fake.invocationsMutex.Lock()
   244  	defer fake.invocationsMutex.Unlock()
   245  	if fake.invocations == nil {
   246  		fake.invocations = map[string][][]interface{}{}
   247  	}
   248  	if fake.invocations[key] == nil {
   249  		fake.invocations[key] = [][]interface{}{}
   250  	}
   251  	fake.invocations[key] = append(fake.invocations[key], args)
   252  }
   253  
   254  var _ user.OrgRoleSetter = new(FakeOrgRoleSetter)