code.cloudfoundry.org/cli@v7.1.0+incompatible/actor/v7pushaction/v7pushactionfakes/fake_shared_actor.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package v7pushactionfakes
     3  
     4  import (
     5  	"io"
     6  	"sync"
     7  
     8  	"code.cloudfoundry.org/cli/actor/sharedaction"
     9  	"code.cloudfoundry.org/cli/actor/v7pushaction"
    10  )
    11  
    12  type FakeSharedActor struct {
    13  	GatherArchiveResourcesStub        func(string) ([]sharedaction.Resource, error)
    14  	gatherArchiveResourcesMutex       sync.RWMutex
    15  	gatherArchiveResourcesArgsForCall []struct {
    16  		arg1 string
    17  	}
    18  	gatherArchiveResourcesReturns struct {
    19  		result1 []sharedaction.Resource
    20  		result2 error
    21  	}
    22  	gatherArchiveResourcesReturnsOnCall map[int]struct {
    23  		result1 []sharedaction.Resource
    24  		result2 error
    25  	}
    26  	GatherDirectoryResourcesStub        func(string) ([]sharedaction.Resource, error)
    27  	gatherDirectoryResourcesMutex       sync.RWMutex
    28  	gatherDirectoryResourcesArgsForCall []struct {
    29  		arg1 string
    30  	}
    31  	gatherDirectoryResourcesReturns struct {
    32  		result1 []sharedaction.Resource
    33  		result2 error
    34  	}
    35  	gatherDirectoryResourcesReturnsOnCall map[int]struct {
    36  		result1 []sharedaction.Resource
    37  		result2 error
    38  	}
    39  	ReadArchiveStub        func(string) (io.ReadCloser, int64, error)
    40  	readArchiveMutex       sync.RWMutex
    41  	readArchiveArgsForCall []struct {
    42  		arg1 string
    43  	}
    44  	readArchiveReturns struct {
    45  		result1 io.ReadCloser
    46  		result2 int64
    47  		result3 error
    48  	}
    49  	readArchiveReturnsOnCall map[int]struct {
    50  		result1 io.ReadCloser
    51  		result2 int64
    52  		result3 error
    53  	}
    54  	ZipArchiveResourcesStub        func(string, []sharedaction.Resource) (string, error)
    55  	zipArchiveResourcesMutex       sync.RWMutex
    56  	zipArchiveResourcesArgsForCall []struct {
    57  		arg1 string
    58  		arg2 []sharedaction.Resource
    59  	}
    60  	zipArchiveResourcesReturns struct {
    61  		result1 string
    62  		result2 error
    63  	}
    64  	zipArchiveResourcesReturnsOnCall map[int]struct {
    65  		result1 string
    66  		result2 error
    67  	}
    68  	ZipDirectoryResourcesStub        func(string, []sharedaction.Resource) (string, error)
    69  	zipDirectoryResourcesMutex       sync.RWMutex
    70  	zipDirectoryResourcesArgsForCall []struct {
    71  		arg1 string
    72  		arg2 []sharedaction.Resource
    73  	}
    74  	zipDirectoryResourcesReturns struct {
    75  		result1 string
    76  		result2 error
    77  	}
    78  	zipDirectoryResourcesReturnsOnCall map[int]struct {
    79  		result1 string
    80  		result2 error
    81  	}
    82  	invocations      map[string][][]interface{}
    83  	invocationsMutex sync.RWMutex
    84  }
    85  
    86  func (fake *FakeSharedActor) GatherArchiveResources(arg1 string) ([]sharedaction.Resource, error) {
    87  	fake.gatherArchiveResourcesMutex.Lock()
    88  	ret, specificReturn := fake.gatherArchiveResourcesReturnsOnCall[len(fake.gatherArchiveResourcesArgsForCall)]
    89  	fake.gatherArchiveResourcesArgsForCall = append(fake.gatherArchiveResourcesArgsForCall, struct {
    90  		arg1 string
    91  	}{arg1})
    92  	fake.recordInvocation("GatherArchiveResources", []interface{}{arg1})
    93  	fake.gatherArchiveResourcesMutex.Unlock()
    94  	if fake.GatherArchiveResourcesStub != nil {
    95  		return fake.GatherArchiveResourcesStub(arg1)
    96  	}
    97  	if specificReturn {
    98  		return ret.result1, ret.result2
    99  	}
   100  	fakeReturns := fake.gatherArchiveResourcesReturns
   101  	return fakeReturns.result1, fakeReturns.result2
   102  }
   103  
   104  func (fake *FakeSharedActor) GatherArchiveResourcesCallCount() int {
   105  	fake.gatherArchiveResourcesMutex.RLock()
   106  	defer fake.gatherArchiveResourcesMutex.RUnlock()
   107  	return len(fake.gatherArchiveResourcesArgsForCall)
   108  }
   109  
   110  func (fake *FakeSharedActor) GatherArchiveResourcesCalls(stub func(string) ([]sharedaction.Resource, error)) {
   111  	fake.gatherArchiveResourcesMutex.Lock()
   112  	defer fake.gatherArchiveResourcesMutex.Unlock()
   113  	fake.GatherArchiveResourcesStub = stub
   114  }
   115  
   116  func (fake *FakeSharedActor) GatherArchiveResourcesArgsForCall(i int) string {
   117  	fake.gatherArchiveResourcesMutex.RLock()
   118  	defer fake.gatherArchiveResourcesMutex.RUnlock()
   119  	argsForCall := fake.gatherArchiveResourcesArgsForCall[i]
   120  	return argsForCall.arg1
   121  }
   122  
   123  func (fake *FakeSharedActor) GatherArchiveResourcesReturns(result1 []sharedaction.Resource, result2 error) {
   124  	fake.gatherArchiveResourcesMutex.Lock()
   125  	defer fake.gatherArchiveResourcesMutex.Unlock()
   126  	fake.GatherArchiveResourcesStub = nil
   127  	fake.gatherArchiveResourcesReturns = struct {
   128  		result1 []sharedaction.Resource
   129  		result2 error
   130  	}{result1, result2}
   131  }
   132  
   133  func (fake *FakeSharedActor) GatherArchiveResourcesReturnsOnCall(i int, result1 []sharedaction.Resource, result2 error) {
   134  	fake.gatherArchiveResourcesMutex.Lock()
   135  	defer fake.gatherArchiveResourcesMutex.Unlock()
   136  	fake.GatherArchiveResourcesStub = nil
   137  	if fake.gatherArchiveResourcesReturnsOnCall == nil {
   138  		fake.gatherArchiveResourcesReturnsOnCall = make(map[int]struct {
   139  			result1 []sharedaction.Resource
   140  			result2 error
   141  		})
   142  	}
   143  	fake.gatherArchiveResourcesReturnsOnCall[i] = struct {
   144  		result1 []sharedaction.Resource
   145  		result2 error
   146  	}{result1, result2}
   147  }
   148  
   149  func (fake *FakeSharedActor) GatherDirectoryResources(arg1 string) ([]sharedaction.Resource, error) {
   150  	fake.gatherDirectoryResourcesMutex.Lock()
   151  	ret, specificReturn := fake.gatherDirectoryResourcesReturnsOnCall[len(fake.gatherDirectoryResourcesArgsForCall)]
   152  	fake.gatherDirectoryResourcesArgsForCall = append(fake.gatherDirectoryResourcesArgsForCall, struct {
   153  		arg1 string
   154  	}{arg1})
   155  	fake.recordInvocation("GatherDirectoryResources", []interface{}{arg1})
   156  	fake.gatherDirectoryResourcesMutex.Unlock()
   157  	if fake.GatherDirectoryResourcesStub != nil {
   158  		return fake.GatherDirectoryResourcesStub(arg1)
   159  	}
   160  	if specificReturn {
   161  		return ret.result1, ret.result2
   162  	}
   163  	fakeReturns := fake.gatherDirectoryResourcesReturns
   164  	return fakeReturns.result1, fakeReturns.result2
   165  }
   166  
   167  func (fake *FakeSharedActor) GatherDirectoryResourcesCallCount() int {
   168  	fake.gatherDirectoryResourcesMutex.RLock()
   169  	defer fake.gatherDirectoryResourcesMutex.RUnlock()
   170  	return len(fake.gatherDirectoryResourcesArgsForCall)
   171  }
   172  
   173  func (fake *FakeSharedActor) GatherDirectoryResourcesCalls(stub func(string) ([]sharedaction.Resource, error)) {
   174  	fake.gatherDirectoryResourcesMutex.Lock()
   175  	defer fake.gatherDirectoryResourcesMutex.Unlock()
   176  	fake.GatherDirectoryResourcesStub = stub
   177  }
   178  
   179  func (fake *FakeSharedActor) GatherDirectoryResourcesArgsForCall(i int) string {
   180  	fake.gatherDirectoryResourcesMutex.RLock()
   181  	defer fake.gatherDirectoryResourcesMutex.RUnlock()
   182  	argsForCall := fake.gatherDirectoryResourcesArgsForCall[i]
   183  	return argsForCall.arg1
   184  }
   185  
   186  func (fake *FakeSharedActor) GatherDirectoryResourcesReturns(result1 []sharedaction.Resource, result2 error) {
   187  	fake.gatherDirectoryResourcesMutex.Lock()
   188  	defer fake.gatherDirectoryResourcesMutex.Unlock()
   189  	fake.GatherDirectoryResourcesStub = nil
   190  	fake.gatherDirectoryResourcesReturns = struct {
   191  		result1 []sharedaction.Resource
   192  		result2 error
   193  	}{result1, result2}
   194  }
   195  
   196  func (fake *FakeSharedActor) GatherDirectoryResourcesReturnsOnCall(i int, result1 []sharedaction.Resource, result2 error) {
   197  	fake.gatherDirectoryResourcesMutex.Lock()
   198  	defer fake.gatherDirectoryResourcesMutex.Unlock()
   199  	fake.GatherDirectoryResourcesStub = nil
   200  	if fake.gatherDirectoryResourcesReturnsOnCall == nil {
   201  		fake.gatherDirectoryResourcesReturnsOnCall = make(map[int]struct {
   202  			result1 []sharedaction.Resource
   203  			result2 error
   204  		})
   205  	}
   206  	fake.gatherDirectoryResourcesReturnsOnCall[i] = struct {
   207  		result1 []sharedaction.Resource
   208  		result2 error
   209  	}{result1, result2}
   210  }
   211  
   212  func (fake *FakeSharedActor) ReadArchive(arg1 string) (io.ReadCloser, int64, error) {
   213  	fake.readArchiveMutex.Lock()
   214  	ret, specificReturn := fake.readArchiveReturnsOnCall[len(fake.readArchiveArgsForCall)]
   215  	fake.readArchiveArgsForCall = append(fake.readArchiveArgsForCall, struct {
   216  		arg1 string
   217  	}{arg1})
   218  	fake.recordInvocation("ReadArchive", []interface{}{arg1})
   219  	fake.readArchiveMutex.Unlock()
   220  	if fake.ReadArchiveStub != nil {
   221  		return fake.ReadArchiveStub(arg1)
   222  	}
   223  	if specificReturn {
   224  		return ret.result1, ret.result2, ret.result3
   225  	}
   226  	fakeReturns := fake.readArchiveReturns
   227  	return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3
   228  }
   229  
   230  func (fake *FakeSharedActor) ReadArchiveCallCount() int {
   231  	fake.readArchiveMutex.RLock()
   232  	defer fake.readArchiveMutex.RUnlock()
   233  	return len(fake.readArchiveArgsForCall)
   234  }
   235  
   236  func (fake *FakeSharedActor) ReadArchiveCalls(stub func(string) (io.ReadCloser, int64, error)) {
   237  	fake.readArchiveMutex.Lock()
   238  	defer fake.readArchiveMutex.Unlock()
   239  	fake.ReadArchiveStub = stub
   240  }
   241  
   242  func (fake *FakeSharedActor) ReadArchiveArgsForCall(i int) string {
   243  	fake.readArchiveMutex.RLock()
   244  	defer fake.readArchiveMutex.RUnlock()
   245  	argsForCall := fake.readArchiveArgsForCall[i]
   246  	return argsForCall.arg1
   247  }
   248  
   249  func (fake *FakeSharedActor) ReadArchiveReturns(result1 io.ReadCloser, result2 int64, result3 error) {
   250  	fake.readArchiveMutex.Lock()
   251  	defer fake.readArchiveMutex.Unlock()
   252  	fake.ReadArchiveStub = nil
   253  	fake.readArchiveReturns = struct {
   254  		result1 io.ReadCloser
   255  		result2 int64
   256  		result3 error
   257  	}{result1, result2, result3}
   258  }
   259  
   260  func (fake *FakeSharedActor) ReadArchiveReturnsOnCall(i int, result1 io.ReadCloser, result2 int64, result3 error) {
   261  	fake.readArchiveMutex.Lock()
   262  	defer fake.readArchiveMutex.Unlock()
   263  	fake.ReadArchiveStub = nil
   264  	if fake.readArchiveReturnsOnCall == nil {
   265  		fake.readArchiveReturnsOnCall = make(map[int]struct {
   266  			result1 io.ReadCloser
   267  			result2 int64
   268  			result3 error
   269  		})
   270  	}
   271  	fake.readArchiveReturnsOnCall[i] = struct {
   272  		result1 io.ReadCloser
   273  		result2 int64
   274  		result3 error
   275  	}{result1, result2, result3}
   276  }
   277  
   278  func (fake *FakeSharedActor) ZipArchiveResources(arg1 string, arg2 []sharedaction.Resource) (string, error) {
   279  	var arg2Copy []sharedaction.Resource
   280  	if arg2 != nil {
   281  		arg2Copy = make([]sharedaction.Resource, len(arg2))
   282  		copy(arg2Copy, arg2)
   283  	}
   284  	fake.zipArchiveResourcesMutex.Lock()
   285  	ret, specificReturn := fake.zipArchiveResourcesReturnsOnCall[len(fake.zipArchiveResourcesArgsForCall)]
   286  	fake.zipArchiveResourcesArgsForCall = append(fake.zipArchiveResourcesArgsForCall, struct {
   287  		arg1 string
   288  		arg2 []sharedaction.Resource
   289  	}{arg1, arg2Copy})
   290  	fake.recordInvocation("ZipArchiveResources", []interface{}{arg1, arg2Copy})
   291  	fake.zipArchiveResourcesMutex.Unlock()
   292  	if fake.ZipArchiveResourcesStub != nil {
   293  		return fake.ZipArchiveResourcesStub(arg1, arg2)
   294  	}
   295  	if specificReturn {
   296  		return ret.result1, ret.result2
   297  	}
   298  	fakeReturns := fake.zipArchiveResourcesReturns
   299  	return fakeReturns.result1, fakeReturns.result2
   300  }
   301  
   302  func (fake *FakeSharedActor) ZipArchiveResourcesCallCount() int {
   303  	fake.zipArchiveResourcesMutex.RLock()
   304  	defer fake.zipArchiveResourcesMutex.RUnlock()
   305  	return len(fake.zipArchiveResourcesArgsForCall)
   306  }
   307  
   308  func (fake *FakeSharedActor) ZipArchiveResourcesCalls(stub func(string, []sharedaction.Resource) (string, error)) {
   309  	fake.zipArchiveResourcesMutex.Lock()
   310  	defer fake.zipArchiveResourcesMutex.Unlock()
   311  	fake.ZipArchiveResourcesStub = stub
   312  }
   313  
   314  func (fake *FakeSharedActor) ZipArchiveResourcesArgsForCall(i int) (string, []sharedaction.Resource) {
   315  	fake.zipArchiveResourcesMutex.RLock()
   316  	defer fake.zipArchiveResourcesMutex.RUnlock()
   317  	argsForCall := fake.zipArchiveResourcesArgsForCall[i]
   318  	return argsForCall.arg1, argsForCall.arg2
   319  }
   320  
   321  func (fake *FakeSharedActor) ZipArchiveResourcesReturns(result1 string, result2 error) {
   322  	fake.zipArchiveResourcesMutex.Lock()
   323  	defer fake.zipArchiveResourcesMutex.Unlock()
   324  	fake.ZipArchiveResourcesStub = nil
   325  	fake.zipArchiveResourcesReturns = struct {
   326  		result1 string
   327  		result2 error
   328  	}{result1, result2}
   329  }
   330  
   331  func (fake *FakeSharedActor) ZipArchiveResourcesReturnsOnCall(i int, result1 string, result2 error) {
   332  	fake.zipArchiveResourcesMutex.Lock()
   333  	defer fake.zipArchiveResourcesMutex.Unlock()
   334  	fake.ZipArchiveResourcesStub = nil
   335  	if fake.zipArchiveResourcesReturnsOnCall == nil {
   336  		fake.zipArchiveResourcesReturnsOnCall = make(map[int]struct {
   337  			result1 string
   338  			result2 error
   339  		})
   340  	}
   341  	fake.zipArchiveResourcesReturnsOnCall[i] = struct {
   342  		result1 string
   343  		result2 error
   344  	}{result1, result2}
   345  }
   346  
   347  func (fake *FakeSharedActor) ZipDirectoryResources(arg1 string, arg2 []sharedaction.Resource) (string, error) {
   348  	var arg2Copy []sharedaction.Resource
   349  	if arg2 != nil {
   350  		arg2Copy = make([]sharedaction.Resource, len(arg2))
   351  		copy(arg2Copy, arg2)
   352  	}
   353  	fake.zipDirectoryResourcesMutex.Lock()
   354  	ret, specificReturn := fake.zipDirectoryResourcesReturnsOnCall[len(fake.zipDirectoryResourcesArgsForCall)]
   355  	fake.zipDirectoryResourcesArgsForCall = append(fake.zipDirectoryResourcesArgsForCall, struct {
   356  		arg1 string
   357  		arg2 []sharedaction.Resource
   358  	}{arg1, arg2Copy})
   359  	fake.recordInvocation("ZipDirectoryResources", []interface{}{arg1, arg2Copy})
   360  	fake.zipDirectoryResourcesMutex.Unlock()
   361  	if fake.ZipDirectoryResourcesStub != nil {
   362  		return fake.ZipDirectoryResourcesStub(arg1, arg2)
   363  	}
   364  	if specificReturn {
   365  		return ret.result1, ret.result2
   366  	}
   367  	fakeReturns := fake.zipDirectoryResourcesReturns
   368  	return fakeReturns.result1, fakeReturns.result2
   369  }
   370  
   371  func (fake *FakeSharedActor) ZipDirectoryResourcesCallCount() int {
   372  	fake.zipDirectoryResourcesMutex.RLock()
   373  	defer fake.zipDirectoryResourcesMutex.RUnlock()
   374  	return len(fake.zipDirectoryResourcesArgsForCall)
   375  }
   376  
   377  func (fake *FakeSharedActor) ZipDirectoryResourcesCalls(stub func(string, []sharedaction.Resource) (string, error)) {
   378  	fake.zipDirectoryResourcesMutex.Lock()
   379  	defer fake.zipDirectoryResourcesMutex.Unlock()
   380  	fake.ZipDirectoryResourcesStub = stub
   381  }
   382  
   383  func (fake *FakeSharedActor) ZipDirectoryResourcesArgsForCall(i int) (string, []sharedaction.Resource) {
   384  	fake.zipDirectoryResourcesMutex.RLock()
   385  	defer fake.zipDirectoryResourcesMutex.RUnlock()
   386  	argsForCall := fake.zipDirectoryResourcesArgsForCall[i]
   387  	return argsForCall.arg1, argsForCall.arg2
   388  }
   389  
   390  func (fake *FakeSharedActor) ZipDirectoryResourcesReturns(result1 string, result2 error) {
   391  	fake.zipDirectoryResourcesMutex.Lock()
   392  	defer fake.zipDirectoryResourcesMutex.Unlock()
   393  	fake.ZipDirectoryResourcesStub = nil
   394  	fake.zipDirectoryResourcesReturns = struct {
   395  		result1 string
   396  		result2 error
   397  	}{result1, result2}
   398  }
   399  
   400  func (fake *FakeSharedActor) ZipDirectoryResourcesReturnsOnCall(i int, result1 string, result2 error) {
   401  	fake.zipDirectoryResourcesMutex.Lock()
   402  	defer fake.zipDirectoryResourcesMutex.Unlock()
   403  	fake.ZipDirectoryResourcesStub = nil
   404  	if fake.zipDirectoryResourcesReturnsOnCall == nil {
   405  		fake.zipDirectoryResourcesReturnsOnCall = make(map[int]struct {
   406  			result1 string
   407  			result2 error
   408  		})
   409  	}
   410  	fake.zipDirectoryResourcesReturnsOnCall[i] = struct {
   411  		result1 string
   412  		result2 error
   413  	}{result1, result2}
   414  }
   415  
   416  func (fake *FakeSharedActor) Invocations() map[string][][]interface{} {
   417  	fake.invocationsMutex.RLock()
   418  	defer fake.invocationsMutex.RUnlock()
   419  	fake.gatherArchiveResourcesMutex.RLock()
   420  	defer fake.gatherArchiveResourcesMutex.RUnlock()
   421  	fake.gatherDirectoryResourcesMutex.RLock()
   422  	defer fake.gatherDirectoryResourcesMutex.RUnlock()
   423  	fake.readArchiveMutex.RLock()
   424  	defer fake.readArchiveMutex.RUnlock()
   425  	fake.zipArchiveResourcesMutex.RLock()
   426  	defer fake.zipArchiveResourcesMutex.RUnlock()
   427  	fake.zipDirectoryResourcesMutex.RLock()
   428  	defer fake.zipDirectoryResourcesMutex.RUnlock()
   429  	copiedInvocations := map[string][][]interface{}{}
   430  	for key, value := range fake.invocations {
   431  		copiedInvocations[key] = value
   432  	}
   433  	return copiedInvocations
   434  }
   435  
   436  func (fake *FakeSharedActor) recordInvocation(key string, args []interface{}) {
   437  	fake.invocationsMutex.Lock()
   438  	defer fake.invocationsMutex.Unlock()
   439  	if fake.invocations == nil {
   440  		fake.invocations = map[string][][]interface{}{}
   441  	}
   442  	if fake.invocations[key] == nil {
   443  		fake.invocations[key] = [][]interface{}{}
   444  	}
   445  	fake.invocations[key] = append(fake.invocations[key], args)
   446  }
   447  
   448  var _ v7pushaction.SharedActor = new(FakeSharedActor)