github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/cf/actors/actorsfakes/fake_push_actor.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package actorsfakes
     3  
     4  import (
     5  	"os"
     6  	"sync"
     7  
     8  	"code.cloudfoundry.org/cli/cf/actors"
     9  	"code.cloudfoundry.org/cli/cf/api/resources"
    10  	"code.cloudfoundry.org/cli/cf/models"
    11  )
    12  
    13  type FakePushActor struct {
    14  	GatherFilesStub        func([]models.AppFileFields, string, string, bool) ([]resources.AppFileResource, bool, error)
    15  	gatherFilesMutex       sync.RWMutex
    16  	gatherFilesArgsForCall []struct {
    17  		arg1 []models.AppFileFields
    18  		arg2 string
    19  		arg3 string
    20  		arg4 bool
    21  	}
    22  	gatherFilesReturns struct {
    23  		result1 []resources.AppFileResource
    24  		result2 bool
    25  		result3 error
    26  	}
    27  	gatherFilesReturnsOnCall map[int]struct {
    28  		result1 []resources.AppFileResource
    29  		result2 bool
    30  		result3 error
    31  	}
    32  	MapManifestRouteStub        func(string, models.Application, models.AppParams) error
    33  	mapManifestRouteMutex       sync.RWMutex
    34  	mapManifestRouteArgsForCall []struct {
    35  		arg1 string
    36  		arg2 models.Application
    37  		arg3 models.AppParams
    38  	}
    39  	mapManifestRouteReturns struct {
    40  		result1 error
    41  	}
    42  	mapManifestRouteReturnsOnCall map[int]struct {
    43  		result1 error
    44  	}
    45  	ProcessPathStub        func(string, func(string) error) error
    46  	processPathMutex       sync.RWMutex
    47  	processPathArgsForCall []struct {
    48  		arg1 string
    49  		arg2 func(string) error
    50  	}
    51  	processPathReturns struct {
    52  		result1 error
    53  	}
    54  	processPathReturnsOnCall map[int]struct {
    55  		result1 error
    56  	}
    57  	UploadAppStub        func(string, *os.File, []resources.AppFileResource) error
    58  	uploadAppMutex       sync.RWMutex
    59  	uploadAppArgsForCall []struct {
    60  		arg1 string
    61  		arg2 *os.File
    62  		arg3 []resources.AppFileResource
    63  	}
    64  	uploadAppReturns struct {
    65  		result1 error
    66  	}
    67  	uploadAppReturnsOnCall map[int]struct {
    68  		result1 error
    69  	}
    70  	ValidateAppParamsStub        func([]models.AppParams) []error
    71  	validateAppParamsMutex       sync.RWMutex
    72  	validateAppParamsArgsForCall []struct {
    73  		arg1 []models.AppParams
    74  	}
    75  	validateAppParamsReturns struct {
    76  		result1 []error
    77  	}
    78  	validateAppParamsReturnsOnCall map[int]struct {
    79  		result1 []error
    80  	}
    81  	invocations      map[string][][]interface{}
    82  	invocationsMutex sync.RWMutex
    83  }
    84  
    85  func (fake *FakePushActor) GatherFiles(arg1 []models.AppFileFields, arg2 string, arg3 string, arg4 bool) ([]resources.AppFileResource, bool, error) {
    86  	var arg1Copy []models.AppFileFields
    87  	if arg1 != nil {
    88  		arg1Copy = make([]models.AppFileFields, len(arg1))
    89  		copy(arg1Copy, arg1)
    90  	}
    91  	fake.gatherFilesMutex.Lock()
    92  	ret, specificReturn := fake.gatherFilesReturnsOnCall[len(fake.gatherFilesArgsForCall)]
    93  	fake.gatherFilesArgsForCall = append(fake.gatherFilesArgsForCall, struct {
    94  		arg1 []models.AppFileFields
    95  		arg2 string
    96  		arg3 string
    97  		arg4 bool
    98  	}{arg1Copy, arg2, arg3, arg4})
    99  	fake.recordInvocation("GatherFiles", []interface{}{arg1Copy, arg2, arg3, arg4})
   100  	fake.gatherFilesMutex.Unlock()
   101  	if fake.GatherFilesStub != nil {
   102  		return fake.GatherFilesStub(arg1, arg2, arg3, arg4)
   103  	}
   104  	if specificReturn {
   105  		return ret.result1, ret.result2, ret.result3
   106  	}
   107  	fakeReturns := fake.gatherFilesReturns
   108  	return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3
   109  }
   110  
   111  func (fake *FakePushActor) GatherFilesCallCount() int {
   112  	fake.gatherFilesMutex.RLock()
   113  	defer fake.gatherFilesMutex.RUnlock()
   114  	return len(fake.gatherFilesArgsForCall)
   115  }
   116  
   117  func (fake *FakePushActor) GatherFilesCalls(stub func([]models.AppFileFields, string, string, bool) ([]resources.AppFileResource, bool, error)) {
   118  	fake.gatherFilesMutex.Lock()
   119  	defer fake.gatherFilesMutex.Unlock()
   120  	fake.GatherFilesStub = stub
   121  }
   122  
   123  func (fake *FakePushActor) GatherFilesArgsForCall(i int) ([]models.AppFileFields, string, string, bool) {
   124  	fake.gatherFilesMutex.RLock()
   125  	defer fake.gatherFilesMutex.RUnlock()
   126  	argsForCall := fake.gatherFilesArgsForCall[i]
   127  	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4
   128  }
   129  
   130  func (fake *FakePushActor) GatherFilesReturns(result1 []resources.AppFileResource, result2 bool, result3 error) {
   131  	fake.gatherFilesMutex.Lock()
   132  	defer fake.gatherFilesMutex.Unlock()
   133  	fake.GatherFilesStub = nil
   134  	fake.gatherFilesReturns = struct {
   135  		result1 []resources.AppFileResource
   136  		result2 bool
   137  		result3 error
   138  	}{result1, result2, result3}
   139  }
   140  
   141  func (fake *FakePushActor) GatherFilesReturnsOnCall(i int, result1 []resources.AppFileResource, result2 bool, result3 error) {
   142  	fake.gatherFilesMutex.Lock()
   143  	defer fake.gatherFilesMutex.Unlock()
   144  	fake.GatherFilesStub = nil
   145  	if fake.gatherFilesReturnsOnCall == nil {
   146  		fake.gatherFilesReturnsOnCall = make(map[int]struct {
   147  			result1 []resources.AppFileResource
   148  			result2 bool
   149  			result3 error
   150  		})
   151  	}
   152  	fake.gatherFilesReturnsOnCall[i] = struct {
   153  		result1 []resources.AppFileResource
   154  		result2 bool
   155  		result3 error
   156  	}{result1, result2, result3}
   157  }
   158  
   159  func (fake *FakePushActor) MapManifestRoute(arg1 string, arg2 models.Application, arg3 models.AppParams) error {
   160  	fake.mapManifestRouteMutex.Lock()
   161  	ret, specificReturn := fake.mapManifestRouteReturnsOnCall[len(fake.mapManifestRouteArgsForCall)]
   162  	fake.mapManifestRouteArgsForCall = append(fake.mapManifestRouteArgsForCall, struct {
   163  		arg1 string
   164  		arg2 models.Application
   165  		arg3 models.AppParams
   166  	}{arg1, arg2, arg3})
   167  	fake.recordInvocation("MapManifestRoute", []interface{}{arg1, arg2, arg3})
   168  	fake.mapManifestRouteMutex.Unlock()
   169  	if fake.MapManifestRouteStub != nil {
   170  		return fake.MapManifestRouteStub(arg1, arg2, arg3)
   171  	}
   172  	if specificReturn {
   173  		return ret.result1
   174  	}
   175  	fakeReturns := fake.mapManifestRouteReturns
   176  	return fakeReturns.result1
   177  }
   178  
   179  func (fake *FakePushActor) MapManifestRouteCallCount() int {
   180  	fake.mapManifestRouteMutex.RLock()
   181  	defer fake.mapManifestRouteMutex.RUnlock()
   182  	return len(fake.mapManifestRouteArgsForCall)
   183  }
   184  
   185  func (fake *FakePushActor) MapManifestRouteCalls(stub func(string, models.Application, models.AppParams) error) {
   186  	fake.mapManifestRouteMutex.Lock()
   187  	defer fake.mapManifestRouteMutex.Unlock()
   188  	fake.MapManifestRouteStub = stub
   189  }
   190  
   191  func (fake *FakePushActor) MapManifestRouteArgsForCall(i int) (string, models.Application, models.AppParams) {
   192  	fake.mapManifestRouteMutex.RLock()
   193  	defer fake.mapManifestRouteMutex.RUnlock()
   194  	argsForCall := fake.mapManifestRouteArgsForCall[i]
   195  	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
   196  }
   197  
   198  func (fake *FakePushActor) MapManifestRouteReturns(result1 error) {
   199  	fake.mapManifestRouteMutex.Lock()
   200  	defer fake.mapManifestRouteMutex.Unlock()
   201  	fake.MapManifestRouteStub = nil
   202  	fake.mapManifestRouteReturns = struct {
   203  		result1 error
   204  	}{result1}
   205  }
   206  
   207  func (fake *FakePushActor) MapManifestRouteReturnsOnCall(i int, result1 error) {
   208  	fake.mapManifestRouteMutex.Lock()
   209  	defer fake.mapManifestRouteMutex.Unlock()
   210  	fake.MapManifestRouteStub = nil
   211  	if fake.mapManifestRouteReturnsOnCall == nil {
   212  		fake.mapManifestRouteReturnsOnCall = make(map[int]struct {
   213  			result1 error
   214  		})
   215  	}
   216  	fake.mapManifestRouteReturnsOnCall[i] = struct {
   217  		result1 error
   218  	}{result1}
   219  }
   220  
   221  func (fake *FakePushActor) ProcessPath(arg1 string, arg2 func(string) error) error {
   222  	fake.processPathMutex.Lock()
   223  	ret, specificReturn := fake.processPathReturnsOnCall[len(fake.processPathArgsForCall)]
   224  	fake.processPathArgsForCall = append(fake.processPathArgsForCall, struct {
   225  		arg1 string
   226  		arg2 func(string) error
   227  	}{arg1, arg2})
   228  	fake.recordInvocation("ProcessPath", []interface{}{arg1, arg2})
   229  	fake.processPathMutex.Unlock()
   230  	if fake.ProcessPathStub != nil {
   231  		return fake.ProcessPathStub(arg1, arg2)
   232  	}
   233  	if specificReturn {
   234  		return ret.result1
   235  	}
   236  	fakeReturns := fake.processPathReturns
   237  	return fakeReturns.result1
   238  }
   239  
   240  func (fake *FakePushActor) ProcessPathCallCount() int {
   241  	fake.processPathMutex.RLock()
   242  	defer fake.processPathMutex.RUnlock()
   243  	return len(fake.processPathArgsForCall)
   244  }
   245  
   246  func (fake *FakePushActor) ProcessPathCalls(stub func(string, func(string) error) error) {
   247  	fake.processPathMutex.Lock()
   248  	defer fake.processPathMutex.Unlock()
   249  	fake.ProcessPathStub = stub
   250  }
   251  
   252  func (fake *FakePushActor) ProcessPathArgsForCall(i int) (string, func(string) error) {
   253  	fake.processPathMutex.RLock()
   254  	defer fake.processPathMutex.RUnlock()
   255  	argsForCall := fake.processPathArgsForCall[i]
   256  	return argsForCall.arg1, argsForCall.arg2
   257  }
   258  
   259  func (fake *FakePushActor) ProcessPathReturns(result1 error) {
   260  	fake.processPathMutex.Lock()
   261  	defer fake.processPathMutex.Unlock()
   262  	fake.ProcessPathStub = nil
   263  	fake.processPathReturns = struct {
   264  		result1 error
   265  	}{result1}
   266  }
   267  
   268  func (fake *FakePushActor) ProcessPathReturnsOnCall(i int, result1 error) {
   269  	fake.processPathMutex.Lock()
   270  	defer fake.processPathMutex.Unlock()
   271  	fake.ProcessPathStub = nil
   272  	if fake.processPathReturnsOnCall == nil {
   273  		fake.processPathReturnsOnCall = make(map[int]struct {
   274  			result1 error
   275  		})
   276  	}
   277  	fake.processPathReturnsOnCall[i] = struct {
   278  		result1 error
   279  	}{result1}
   280  }
   281  
   282  func (fake *FakePushActor) UploadApp(arg1 string, arg2 *os.File, arg3 []resources.AppFileResource) error {
   283  	var arg3Copy []resources.AppFileResource
   284  	if arg3 != nil {
   285  		arg3Copy = make([]resources.AppFileResource, len(arg3))
   286  		copy(arg3Copy, arg3)
   287  	}
   288  	fake.uploadAppMutex.Lock()
   289  	ret, specificReturn := fake.uploadAppReturnsOnCall[len(fake.uploadAppArgsForCall)]
   290  	fake.uploadAppArgsForCall = append(fake.uploadAppArgsForCall, struct {
   291  		arg1 string
   292  		arg2 *os.File
   293  		arg3 []resources.AppFileResource
   294  	}{arg1, arg2, arg3Copy})
   295  	fake.recordInvocation("UploadApp", []interface{}{arg1, arg2, arg3Copy})
   296  	fake.uploadAppMutex.Unlock()
   297  	if fake.UploadAppStub != nil {
   298  		return fake.UploadAppStub(arg1, arg2, arg3)
   299  	}
   300  	if specificReturn {
   301  		return ret.result1
   302  	}
   303  	fakeReturns := fake.uploadAppReturns
   304  	return fakeReturns.result1
   305  }
   306  
   307  func (fake *FakePushActor) UploadAppCallCount() int {
   308  	fake.uploadAppMutex.RLock()
   309  	defer fake.uploadAppMutex.RUnlock()
   310  	return len(fake.uploadAppArgsForCall)
   311  }
   312  
   313  func (fake *FakePushActor) UploadAppCalls(stub func(string, *os.File, []resources.AppFileResource) error) {
   314  	fake.uploadAppMutex.Lock()
   315  	defer fake.uploadAppMutex.Unlock()
   316  	fake.UploadAppStub = stub
   317  }
   318  
   319  func (fake *FakePushActor) UploadAppArgsForCall(i int) (string, *os.File, []resources.AppFileResource) {
   320  	fake.uploadAppMutex.RLock()
   321  	defer fake.uploadAppMutex.RUnlock()
   322  	argsForCall := fake.uploadAppArgsForCall[i]
   323  	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
   324  }
   325  
   326  func (fake *FakePushActor) UploadAppReturns(result1 error) {
   327  	fake.uploadAppMutex.Lock()
   328  	defer fake.uploadAppMutex.Unlock()
   329  	fake.UploadAppStub = nil
   330  	fake.uploadAppReturns = struct {
   331  		result1 error
   332  	}{result1}
   333  }
   334  
   335  func (fake *FakePushActor) UploadAppReturnsOnCall(i int, result1 error) {
   336  	fake.uploadAppMutex.Lock()
   337  	defer fake.uploadAppMutex.Unlock()
   338  	fake.UploadAppStub = nil
   339  	if fake.uploadAppReturnsOnCall == nil {
   340  		fake.uploadAppReturnsOnCall = make(map[int]struct {
   341  			result1 error
   342  		})
   343  	}
   344  	fake.uploadAppReturnsOnCall[i] = struct {
   345  		result1 error
   346  	}{result1}
   347  }
   348  
   349  func (fake *FakePushActor) ValidateAppParams(arg1 []models.AppParams) []error {
   350  	var arg1Copy []models.AppParams
   351  	if arg1 != nil {
   352  		arg1Copy = make([]models.AppParams, len(arg1))
   353  		copy(arg1Copy, arg1)
   354  	}
   355  	fake.validateAppParamsMutex.Lock()
   356  	ret, specificReturn := fake.validateAppParamsReturnsOnCall[len(fake.validateAppParamsArgsForCall)]
   357  	fake.validateAppParamsArgsForCall = append(fake.validateAppParamsArgsForCall, struct {
   358  		arg1 []models.AppParams
   359  	}{arg1Copy})
   360  	fake.recordInvocation("ValidateAppParams", []interface{}{arg1Copy})
   361  	fake.validateAppParamsMutex.Unlock()
   362  	if fake.ValidateAppParamsStub != nil {
   363  		return fake.ValidateAppParamsStub(arg1)
   364  	}
   365  	if specificReturn {
   366  		return ret.result1
   367  	}
   368  	fakeReturns := fake.validateAppParamsReturns
   369  	return fakeReturns.result1
   370  }
   371  
   372  func (fake *FakePushActor) ValidateAppParamsCallCount() int {
   373  	fake.validateAppParamsMutex.RLock()
   374  	defer fake.validateAppParamsMutex.RUnlock()
   375  	return len(fake.validateAppParamsArgsForCall)
   376  }
   377  
   378  func (fake *FakePushActor) ValidateAppParamsCalls(stub func([]models.AppParams) []error) {
   379  	fake.validateAppParamsMutex.Lock()
   380  	defer fake.validateAppParamsMutex.Unlock()
   381  	fake.ValidateAppParamsStub = stub
   382  }
   383  
   384  func (fake *FakePushActor) ValidateAppParamsArgsForCall(i int) []models.AppParams {
   385  	fake.validateAppParamsMutex.RLock()
   386  	defer fake.validateAppParamsMutex.RUnlock()
   387  	argsForCall := fake.validateAppParamsArgsForCall[i]
   388  	return argsForCall.arg1
   389  }
   390  
   391  func (fake *FakePushActor) ValidateAppParamsReturns(result1 []error) {
   392  	fake.validateAppParamsMutex.Lock()
   393  	defer fake.validateAppParamsMutex.Unlock()
   394  	fake.ValidateAppParamsStub = nil
   395  	fake.validateAppParamsReturns = struct {
   396  		result1 []error
   397  	}{result1}
   398  }
   399  
   400  func (fake *FakePushActor) ValidateAppParamsReturnsOnCall(i int, result1 []error) {
   401  	fake.validateAppParamsMutex.Lock()
   402  	defer fake.validateAppParamsMutex.Unlock()
   403  	fake.ValidateAppParamsStub = nil
   404  	if fake.validateAppParamsReturnsOnCall == nil {
   405  		fake.validateAppParamsReturnsOnCall = make(map[int]struct {
   406  			result1 []error
   407  		})
   408  	}
   409  	fake.validateAppParamsReturnsOnCall[i] = struct {
   410  		result1 []error
   411  	}{result1}
   412  }
   413  
   414  func (fake *FakePushActor) Invocations() map[string][][]interface{} {
   415  	fake.invocationsMutex.RLock()
   416  	defer fake.invocationsMutex.RUnlock()
   417  	fake.gatherFilesMutex.RLock()
   418  	defer fake.gatherFilesMutex.RUnlock()
   419  	fake.mapManifestRouteMutex.RLock()
   420  	defer fake.mapManifestRouteMutex.RUnlock()
   421  	fake.processPathMutex.RLock()
   422  	defer fake.processPathMutex.RUnlock()
   423  	fake.uploadAppMutex.RLock()
   424  	defer fake.uploadAppMutex.RUnlock()
   425  	fake.validateAppParamsMutex.RLock()
   426  	defer fake.validateAppParamsMutex.RUnlock()
   427  	copiedInvocations := map[string][][]interface{}{}
   428  	for key, value := range fake.invocations {
   429  		copiedInvocations[key] = value
   430  	}
   431  	return copiedInvocations
   432  }
   433  
   434  func (fake *FakePushActor) recordInvocation(key string, args []interface{}) {
   435  	fake.invocationsMutex.Lock()
   436  	defer fake.invocationsMutex.Unlock()
   437  	if fake.invocations == nil {
   438  		fake.invocations = map[string][][]interface{}{}
   439  	}
   440  	if fake.invocations[key] == nil {
   441  		fake.invocations[key] = [][]interface{}{}
   442  	}
   443  	fake.invocations[key] = append(fake.invocations[key], args)
   444  }
   445  
   446  var _ actors.PushActor = new(FakePushActor)