github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/cf/api/apifakes/fake_service_broker_repository.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package apifakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"code.cloudfoundry.org/cli/cf/api"
     8  	"code.cloudfoundry.org/cli/cf/models"
     9  )
    10  
    11  type FakeServiceBrokerRepository struct {
    12  	CreateStub        func(string, string, string, string, string) error
    13  	createMutex       sync.RWMutex
    14  	createArgsForCall []struct {
    15  		arg1 string
    16  		arg2 string
    17  		arg3 string
    18  		arg4 string
    19  		arg5 string
    20  	}
    21  	createReturns struct {
    22  		result1 error
    23  	}
    24  	createReturnsOnCall map[int]struct {
    25  		result1 error
    26  	}
    27  	DeleteStub        func(string) error
    28  	deleteMutex       sync.RWMutex
    29  	deleteArgsForCall []struct {
    30  		arg1 string
    31  	}
    32  	deleteReturns struct {
    33  		result1 error
    34  	}
    35  	deleteReturnsOnCall map[int]struct {
    36  		result1 error
    37  	}
    38  	FindByGUIDStub        func(string) (models.ServiceBroker, error)
    39  	findByGUIDMutex       sync.RWMutex
    40  	findByGUIDArgsForCall []struct {
    41  		arg1 string
    42  	}
    43  	findByGUIDReturns struct {
    44  		result1 models.ServiceBroker
    45  		result2 error
    46  	}
    47  	findByGUIDReturnsOnCall map[int]struct {
    48  		result1 models.ServiceBroker
    49  		result2 error
    50  	}
    51  	FindByNameStub        func(string) (models.ServiceBroker, error)
    52  	findByNameMutex       sync.RWMutex
    53  	findByNameArgsForCall []struct {
    54  		arg1 string
    55  	}
    56  	findByNameReturns struct {
    57  		result1 models.ServiceBroker
    58  		result2 error
    59  	}
    60  	findByNameReturnsOnCall map[int]struct {
    61  		result1 models.ServiceBroker
    62  		result2 error
    63  	}
    64  	ListServiceBrokersStub        func(func(models.ServiceBroker) bool) error
    65  	listServiceBrokersMutex       sync.RWMutex
    66  	listServiceBrokersArgsForCall []struct {
    67  		arg1 func(models.ServiceBroker) bool
    68  	}
    69  	listServiceBrokersReturns struct {
    70  		result1 error
    71  	}
    72  	listServiceBrokersReturnsOnCall map[int]struct {
    73  		result1 error
    74  	}
    75  	RenameStub        func(string, string) error
    76  	renameMutex       sync.RWMutex
    77  	renameArgsForCall []struct {
    78  		arg1 string
    79  		arg2 string
    80  	}
    81  	renameReturns struct {
    82  		result1 error
    83  	}
    84  	renameReturnsOnCall map[int]struct {
    85  		result1 error
    86  	}
    87  	UpdateStub        func(models.ServiceBroker) error
    88  	updateMutex       sync.RWMutex
    89  	updateArgsForCall []struct {
    90  		arg1 models.ServiceBroker
    91  	}
    92  	updateReturns struct {
    93  		result1 error
    94  	}
    95  	updateReturnsOnCall map[int]struct {
    96  		result1 error
    97  	}
    98  	invocations      map[string][][]interface{}
    99  	invocationsMutex sync.RWMutex
   100  }
   101  
   102  func (fake *FakeServiceBrokerRepository) Create(arg1 string, arg2 string, arg3 string, arg4 string, arg5 string) error {
   103  	fake.createMutex.Lock()
   104  	ret, specificReturn := fake.createReturnsOnCall[len(fake.createArgsForCall)]
   105  	fake.createArgsForCall = append(fake.createArgsForCall, struct {
   106  		arg1 string
   107  		arg2 string
   108  		arg3 string
   109  		arg4 string
   110  		arg5 string
   111  	}{arg1, arg2, arg3, arg4, arg5})
   112  	fake.recordInvocation("Create", []interface{}{arg1, arg2, arg3, arg4, arg5})
   113  	fake.createMutex.Unlock()
   114  	if fake.CreateStub != nil {
   115  		return fake.CreateStub(arg1, arg2, arg3, arg4, arg5)
   116  	}
   117  	if specificReturn {
   118  		return ret.result1
   119  	}
   120  	fakeReturns := fake.createReturns
   121  	return fakeReturns.result1
   122  }
   123  
   124  func (fake *FakeServiceBrokerRepository) CreateCallCount() int {
   125  	fake.createMutex.RLock()
   126  	defer fake.createMutex.RUnlock()
   127  	return len(fake.createArgsForCall)
   128  }
   129  
   130  func (fake *FakeServiceBrokerRepository) CreateCalls(stub func(string, string, string, string, string) error) {
   131  	fake.createMutex.Lock()
   132  	defer fake.createMutex.Unlock()
   133  	fake.CreateStub = stub
   134  }
   135  
   136  func (fake *FakeServiceBrokerRepository) CreateArgsForCall(i int) (string, string, string, string, string) {
   137  	fake.createMutex.RLock()
   138  	defer fake.createMutex.RUnlock()
   139  	argsForCall := fake.createArgsForCall[i]
   140  	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5
   141  }
   142  
   143  func (fake *FakeServiceBrokerRepository) CreateReturns(result1 error) {
   144  	fake.createMutex.Lock()
   145  	defer fake.createMutex.Unlock()
   146  	fake.CreateStub = nil
   147  	fake.createReturns = struct {
   148  		result1 error
   149  	}{result1}
   150  }
   151  
   152  func (fake *FakeServiceBrokerRepository) CreateReturnsOnCall(i int, result1 error) {
   153  	fake.createMutex.Lock()
   154  	defer fake.createMutex.Unlock()
   155  	fake.CreateStub = nil
   156  	if fake.createReturnsOnCall == nil {
   157  		fake.createReturnsOnCall = make(map[int]struct {
   158  			result1 error
   159  		})
   160  	}
   161  	fake.createReturnsOnCall[i] = struct {
   162  		result1 error
   163  	}{result1}
   164  }
   165  
   166  func (fake *FakeServiceBrokerRepository) Delete(arg1 string) error {
   167  	fake.deleteMutex.Lock()
   168  	ret, specificReturn := fake.deleteReturnsOnCall[len(fake.deleteArgsForCall)]
   169  	fake.deleteArgsForCall = append(fake.deleteArgsForCall, struct {
   170  		arg1 string
   171  	}{arg1})
   172  	fake.recordInvocation("Delete", []interface{}{arg1})
   173  	fake.deleteMutex.Unlock()
   174  	if fake.DeleteStub != nil {
   175  		return fake.DeleteStub(arg1)
   176  	}
   177  	if specificReturn {
   178  		return ret.result1
   179  	}
   180  	fakeReturns := fake.deleteReturns
   181  	return fakeReturns.result1
   182  }
   183  
   184  func (fake *FakeServiceBrokerRepository) DeleteCallCount() int {
   185  	fake.deleteMutex.RLock()
   186  	defer fake.deleteMutex.RUnlock()
   187  	return len(fake.deleteArgsForCall)
   188  }
   189  
   190  func (fake *FakeServiceBrokerRepository) DeleteCalls(stub func(string) error) {
   191  	fake.deleteMutex.Lock()
   192  	defer fake.deleteMutex.Unlock()
   193  	fake.DeleteStub = stub
   194  }
   195  
   196  func (fake *FakeServiceBrokerRepository) DeleteArgsForCall(i int) string {
   197  	fake.deleteMutex.RLock()
   198  	defer fake.deleteMutex.RUnlock()
   199  	argsForCall := fake.deleteArgsForCall[i]
   200  	return argsForCall.arg1
   201  }
   202  
   203  func (fake *FakeServiceBrokerRepository) DeleteReturns(result1 error) {
   204  	fake.deleteMutex.Lock()
   205  	defer fake.deleteMutex.Unlock()
   206  	fake.DeleteStub = nil
   207  	fake.deleteReturns = struct {
   208  		result1 error
   209  	}{result1}
   210  }
   211  
   212  func (fake *FakeServiceBrokerRepository) DeleteReturnsOnCall(i int, result1 error) {
   213  	fake.deleteMutex.Lock()
   214  	defer fake.deleteMutex.Unlock()
   215  	fake.DeleteStub = nil
   216  	if fake.deleteReturnsOnCall == nil {
   217  		fake.deleteReturnsOnCall = make(map[int]struct {
   218  			result1 error
   219  		})
   220  	}
   221  	fake.deleteReturnsOnCall[i] = struct {
   222  		result1 error
   223  	}{result1}
   224  }
   225  
   226  func (fake *FakeServiceBrokerRepository) FindByGUID(arg1 string) (models.ServiceBroker, error) {
   227  	fake.findByGUIDMutex.Lock()
   228  	ret, specificReturn := fake.findByGUIDReturnsOnCall[len(fake.findByGUIDArgsForCall)]
   229  	fake.findByGUIDArgsForCall = append(fake.findByGUIDArgsForCall, struct {
   230  		arg1 string
   231  	}{arg1})
   232  	fake.recordInvocation("FindByGUID", []interface{}{arg1})
   233  	fake.findByGUIDMutex.Unlock()
   234  	if fake.FindByGUIDStub != nil {
   235  		return fake.FindByGUIDStub(arg1)
   236  	}
   237  	if specificReturn {
   238  		return ret.result1, ret.result2
   239  	}
   240  	fakeReturns := fake.findByGUIDReturns
   241  	return fakeReturns.result1, fakeReturns.result2
   242  }
   243  
   244  func (fake *FakeServiceBrokerRepository) FindByGUIDCallCount() int {
   245  	fake.findByGUIDMutex.RLock()
   246  	defer fake.findByGUIDMutex.RUnlock()
   247  	return len(fake.findByGUIDArgsForCall)
   248  }
   249  
   250  func (fake *FakeServiceBrokerRepository) FindByGUIDCalls(stub func(string) (models.ServiceBroker, error)) {
   251  	fake.findByGUIDMutex.Lock()
   252  	defer fake.findByGUIDMutex.Unlock()
   253  	fake.FindByGUIDStub = stub
   254  }
   255  
   256  func (fake *FakeServiceBrokerRepository) FindByGUIDArgsForCall(i int) string {
   257  	fake.findByGUIDMutex.RLock()
   258  	defer fake.findByGUIDMutex.RUnlock()
   259  	argsForCall := fake.findByGUIDArgsForCall[i]
   260  	return argsForCall.arg1
   261  }
   262  
   263  func (fake *FakeServiceBrokerRepository) FindByGUIDReturns(result1 models.ServiceBroker, result2 error) {
   264  	fake.findByGUIDMutex.Lock()
   265  	defer fake.findByGUIDMutex.Unlock()
   266  	fake.FindByGUIDStub = nil
   267  	fake.findByGUIDReturns = struct {
   268  		result1 models.ServiceBroker
   269  		result2 error
   270  	}{result1, result2}
   271  }
   272  
   273  func (fake *FakeServiceBrokerRepository) FindByGUIDReturnsOnCall(i int, result1 models.ServiceBroker, result2 error) {
   274  	fake.findByGUIDMutex.Lock()
   275  	defer fake.findByGUIDMutex.Unlock()
   276  	fake.FindByGUIDStub = nil
   277  	if fake.findByGUIDReturnsOnCall == nil {
   278  		fake.findByGUIDReturnsOnCall = make(map[int]struct {
   279  			result1 models.ServiceBroker
   280  			result2 error
   281  		})
   282  	}
   283  	fake.findByGUIDReturnsOnCall[i] = struct {
   284  		result1 models.ServiceBroker
   285  		result2 error
   286  	}{result1, result2}
   287  }
   288  
   289  func (fake *FakeServiceBrokerRepository) FindByName(arg1 string) (models.ServiceBroker, error) {
   290  	fake.findByNameMutex.Lock()
   291  	ret, specificReturn := fake.findByNameReturnsOnCall[len(fake.findByNameArgsForCall)]
   292  	fake.findByNameArgsForCall = append(fake.findByNameArgsForCall, struct {
   293  		arg1 string
   294  	}{arg1})
   295  	fake.recordInvocation("FindByName", []interface{}{arg1})
   296  	fake.findByNameMutex.Unlock()
   297  	if fake.FindByNameStub != nil {
   298  		return fake.FindByNameStub(arg1)
   299  	}
   300  	if specificReturn {
   301  		return ret.result1, ret.result2
   302  	}
   303  	fakeReturns := fake.findByNameReturns
   304  	return fakeReturns.result1, fakeReturns.result2
   305  }
   306  
   307  func (fake *FakeServiceBrokerRepository) FindByNameCallCount() int {
   308  	fake.findByNameMutex.RLock()
   309  	defer fake.findByNameMutex.RUnlock()
   310  	return len(fake.findByNameArgsForCall)
   311  }
   312  
   313  func (fake *FakeServiceBrokerRepository) FindByNameCalls(stub func(string) (models.ServiceBroker, error)) {
   314  	fake.findByNameMutex.Lock()
   315  	defer fake.findByNameMutex.Unlock()
   316  	fake.FindByNameStub = stub
   317  }
   318  
   319  func (fake *FakeServiceBrokerRepository) FindByNameArgsForCall(i int) string {
   320  	fake.findByNameMutex.RLock()
   321  	defer fake.findByNameMutex.RUnlock()
   322  	argsForCall := fake.findByNameArgsForCall[i]
   323  	return argsForCall.arg1
   324  }
   325  
   326  func (fake *FakeServiceBrokerRepository) FindByNameReturns(result1 models.ServiceBroker, result2 error) {
   327  	fake.findByNameMutex.Lock()
   328  	defer fake.findByNameMutex.Unlock()
   329  	fake.FindByNameStub = nil
   330  	fake.findByNameReturns = struct {
   331  		result1 models.ServiceBroker
   332  		result2 error
   333  	}{result1, result2}
   334  }
   335  
   336  func (fake *FakeServiceBrokerRepository) FindByNameReturnsOnCall(i int, result1 models.ServiceBroker, result2 error) {
   337  	fake.findByNameMutex.Lock()
   338  	defer fake.findByNameMutex.Unlock()
   339  	fake.FindByNameStub = nil
   340  	if fake.findByNameReturnsOnCall == nil {
   341  		fake.findByNameReturnsOnCall = make(map[int]struct {
   342  			result1 models.ServiceBroker
   343  			result2 error
   344  		})
   345  	}
   346  	fake.findByNameReturnsOnCall[i] = struct {
   347  		result1 models.ServiceBroker
   348  		result2 error
   349  	}{result1, result2}
   350  }
   351  
   352  func (fake *FakeServiceBrokerRepository) ListServiceBrokers(arg1 func(models.ServiceBroker) bool) error {
   353  	fake.listServiceBrokersMutex.Lock()
   354  	ret, specificReturn := fake.listServiceBrokersReturnsOnCall[len(fake.listServiceBrokersArgsForCall)]
   355  	fake.listServiceBrokersArgsForCall = append(fake.listServiceBrokersArgsForCall, struct {
   356  		arg1 func(models.ServiceBroker) bool
   357  	}{arg1})
   358  	fake.recordInvocation("ListServiceBrokers", []interface{}{arg1})
   359  	fake.listServiceBrokersMutex.Unlock()
   360  	if fake.ListServiceBrokersStub != nil {
   361  		return fake.ListServiceBrokersStub(arg1)
   362  	}
   363  	if specificReturn {
   364  		return ret.result1
   365  	}
   366  	fakeReturns := fake.listServiceBrokersReturns
   367  	return fakeReturns.result1
   368  }
   369  
   370  func (fake *FakeServiceBrokerRepository) ListServiceBrokersCallCount() int {
   371  	fake.listServiceBrokersMutex.RLock()
   372  	defer fake.listServiceBrokersMutex.RUnlock()
   373  	return len(fake.listServiceBrokersArgsForCall)
   374  }
   375  
   376  func (fake *FakeServiceBrokerRepository) ListServiceBrokersCalls(stub func(func(models.ServiceBroker) bool) error) {
   377  	fake.listServiceBrokersMutex.Lock()
   378  	defer fake.listServiceBrokersMutex.Unlock()
   379  	fake.ListServiceBrokersStub = stub
   380  }
   381  
   382  func (fake *FakeServiceBrokerRepository) ListServiceBrokersArgsForCall(i int) func(models.ServiceBroker) bool {
   383  	fake.listServiceBrokersMutex.RLock()
   384  	defer fake.listServiceBrokersMutex.RUnlock()
   385  	argsForCall := fake.listServiceBrokersArgsForCall[i]
   386  	return argsForCall.arg1
   387  }
   388  
   389  func (fake *FakeServiceBrokerRepository) ListServiceBrokersReturns(result1 error) {
   390  	fake.listServiceBrokersMutex.Lock()
   391  	defer fake.listServiceBrokersMutex.Unlock()
   392  	fake.ListServiceBrokersStub = nil
   393  	fake.listServiceBrokersReturns = struct {
   394  		result1 error
   395  	}{result1}
   396  }
   397  
   398  func (fake *FakeServiceBrokerRepository) ListServiceBrokersReturnsOnCall(i int, result1 error) {
   399  	fake.listServiceBrokersMutex.Lock()
   400  	defer fake.listServiceBrokersMutex.Unlock()
   401  	fake.ListServiceBrokersStub = nil
   402  	if fake.listServiceBrokersReturnsOnCall == nil {
   403  		fake.listServiceBrokersReturnsOnCall = make(map[int]struct {
   404  			result1 error
   405  		})
   406  	}
   407  	fake.listServiceBrokersReturnsOnCall[i] = struct {
   408  		result1 error
   409  	}{result1}
   410  }
   411  
   412  func (fake *FakeServiceBrokerRepository) Rename(arg1 string, arg2 string) error {
   413  	fake.renameMutex.Lock()
   414  	ret, specificReturn := fake.renameReturnsOnCall[len(fake.renameArgsForCall)]
   415  	fake.renameArgsForCall = append(fake.renameArgsForCall, struct {
   416  		arg1 string
   417  		arg2 string
   418  	}{arg1, arg2})
   419  	fake.recordInvocation("Rename", []interface{}{arg1, arg2})
   420  	fake.renameMutex.Unlock()
   421  	if fake.RenameStub != nil {
   422  		return fake.RenameStub(arg1, arg2)
   423  	}
   424  	if specificReturn {
   425  		return ret.result1
   426  	}
   427  	fakeReturns := fake.renameReturns
   428  	return fakeReturns.result1
   429  }
   430  
   431  func (fake *FakeServiceBrokerRepository) RenameCallCount() int {
   432  	fake.renameMutex.RLock()
   433  	defer fake.renameMutex.RUnlock()
   434  	return len(fake.renameArgsForCall)
   435  }
   436  
   437  func (fake *FakeServiceBrokerRepository) RenameCalls(stub func(string, string) error) {
   438  	fake.renameMutex.Lock()
   439  	defer fake.renameMutex.Unlock()
   440  	fake.RenameStub = stub
   441  }
   442  
   443  func (fake *FakeServiceBrokerRepository) RenameArgsForCall(i int) (string, string) {
   444  	fake.renameMutex.RLock()
   445  	defer fake.renameMutex.RUnlock()
   446  	argsForCall := fake.renameArgsForCall[i]
   447  	return argsForCall.arg1, argsForCall.arg2
   448  }
   449  
   450  func (fake *FakeServiceBrokerRepository) RenameReturns(result1 error) {
   451  	fake.renameMutex.Lock()
   452  	defer fake.renameMutex.Unlock()
   453  	fake.RenameStub = nil
   454  	fake.renameReturns = struct {
   455  		result1 error
   456  	}{result1}
   457  }
   458  
   459  func (fake *FakeServiceBrokerRepository) RenameReturnsOnCall(i int, result1 error) {
   460  	fake.renameMutex.Lock()
   461  	defer fake.renameMutex.Unlock()
   462  	fake.RenameStub = nil
   463  	if fake.renameReturnsOnCall == nil {
   464  		fake.renameReturnsOnCall = make(map[int]struct {
   465  			result1 error
   466  		})
   467  	}
   468  	fake.renameReturnsOnCall[i] = struct {
   469  		result1 error
   470  	}{result1}
   471  }
   472  
   473  func (fake *FakeServiceBrokerRepository) Update(arg1 models.ServiceBroker) error {
   474  	fake.updateMutex.Lock()
   475  	ret, specificReturn := fake.updateReturnsOnCall[len(fake.updateArgsForCall)]
   476  	fake.updateArgsForCall = append(fake.updateArgsForCall, struct {
   477  		arg1 models.ServiceBroker
   478  	}{arg1})
   479  	fake.recordInvocation("Update", []interface{}{arg1})
   480  	fake.updateMutex.Unlock()
   481  	if fake.UpdateStub != nil {
   482  		return fake.UpdateStub(arg1)
   483  	}
   484  	if specificReturn {
   485  		return ret.result1
   486  	}
   487  	fakeReturns := fake.updateReturns
   488  	return fakeReturns.result1
   489  }
   490  
   491  func (fake *FakeServiceBrokerRepository) UpdateCallCount() int {
   492  	fake.updateMutex.RLock()
   493  	defer fake.updateMutex.RUnlock()
   494  	return len(fake.updateArgsForCall)
   495  }
   496  
   497  func (fake *FakeServiceBrokerRepository) UpdateCalls(stub func(models.ServiceBroker) error) {
   498  	fake.updateMutex.Lock()
   499  	defer fake.updateMutex.Unlock()
   500  	fake.UpdateStub = stub
   501  }
   502  
   503  func (fake *FakeServiceBrokerRepository) UpdateArgsForCall(i int) models.ServiceBroker {
   504  	fake.updateMutex.RLock()
   505  	defer fake.updateMutex.RUnlock()
   506  	argsForCall := fake.updateArgsForCall[i]
   507  	return argsForCall.arg1
   508  }
   509  
   510  func (fake *FakeServiceBrokerRepository) UpdateReturns(result1 error) {
   511  	fake.updateMutex.Lock()
   512  	defer fake.updateMutex.Unlock()
   513  	fake.UpdateStub = nil
   514  	fake.updateReturns = struct {
   515  		result1 error
   516  	}{result1}
   517  }
   518  
   519  func (fake *FakeServiceBrokerRepository) UpdateReturnsOnCall(i int, result1 error) {
   520  	fake.updateMutex.Lock()
   521  	defer fake.updateMutex.Unlock()
   522  	fake.UpdateStub = nil
   523  	if fake.updateReturnsOnCall == nil {
   524  		fake.updateReturnsOnCall = make(map[int]struct {
   525  			result1 error
   526  		})
   527  	}
   528  	fake.updateReturnsOnCall[i] = struct {
   529  		result1 error
   530  	}{result1}
   531  }
   532  
   533  func (fake *FakeServiceBrokerRepository) Invocations() map[string][][]interface{} {
   534  	fake.invocationsMutex.RLock()
   535  	defer fake.invocationsMutex.RUnlock()
   536  	fake.createMutex.RLock()
   537  	defer fake.createMutex.RUnlock()
   538  	fake.deleteMutex.RLock()
   539  	defer fake.deleteMutex.RUnlock()
   540  	fake.findByGUIDMutex.RLock()
   541  	defer fake.findByGUIDMutex.RUnlock()
   542  	fake.findByNameMutex.RLock()
   543  	defer fake.findByNameMutex.RUnlock()
   544  	fake.listServiceBrokersMutex.RLock()
   545  	defer fake.listServiceBrokersMutex.RUnlock()
   546  	fake.renameMutex.RLock()
   547  	defer fake.renameMutex.RUnlock()
   548  	fake.updateMutex.RLock()
   549  	defer fake.updateMutex.RUnlock()
   550  	copiedInvocations := map[string][][]interface{}{}
   551  	for key, value := range fake.invocations {
   552  		copiedInvocations[key] = value
   553  	}
   554  	return copiedInvocations
   555  }
   556  
   557  func (fake *FakeServiceBrokerRepository) recordInvocation(key string, args []interface{}) {
   558  	fake.invocationsMutex.Lock()
   559  	defer fake.invocationsMutex.Unlock()
   560  	if fake.invocations == nil {
   561  		fake.invocations = map[string][][]interface{}{}
   562  	}
   563  	if fake.invocations[key] == nil {
   564  		fake.invocations[key] = [][]interface{}{}
   565  	}
   566  	fake.invocations[key] = append(fake.invocations[key], args)
   567  }
   568  
   569  var _ api.ServiceBrokerRepository = new(FakeServiceBrokerRepository)