github.com/swisscom/cloudfoundry-cli@v7.1.0+incompatible/cf/appfiles/appfilesfakes/fake_app_files.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package appfilesfakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"code.cloudfoundry.org/cli/cf/appfiles"
     8  	"code.cloudfoundry.org/cli/cf/models"
     9  )
    10  
    11  type FakeAppFiles struct {
    12  	AppFilesInDirStub        func(string) ([]models.AppFileFields, error)
    13  	appFilesInDirMutex       sync.RWMutex
    14  	appFilesInDirArgsForCall []struct {
    15  		arg1 string
    16  	}
    17  	appFilesInDirReturns struct {
    18  		result1 []models.AppFileFields
    19  		result2 error
    20  	}
    21  	appFilesInDirReturnsOnCall map[int]struct {
    22  		result1 []models.AppFileFields
    23  		result2 error
    24  	}
    25  	CopyFilesStub        func([]models.AppFileFields, string, string) error
    26  	copyFilesMutex       sync.RWMutex
    27  	copyFilesArgsForCall []struct {
    28  		arg1 []models.AppFileFields
    29  		arg2 string
    30  		arg3 string
    31  	}
    32  	copyFilesReturns struct {
    33  		result1 error
    34  	}
    35  	copyFilesReturnsOnCall map[int]struct {
    36  		result1 error
    37  	}
    38  	CountFilesStub        func(string) int64
    39  	countFilesMutex       sync.RWMutex
    40  	countFilesArgsForCall []struct {
    41  		arg1 string
    42  	}
    43  	countFilesReturns struct {
    44  		result1 int64
    45  	}
    46  	countFilesReturnsOnCall map[int]struct {
    47  		result1 int64
    48  	}
    49  	WalkAppFilesStub        func(string, func(string, string) error) error
    50  	walkAppFilesMutex       sync.RWMutex
    51  	walkAppFilesArgsForCall []struct {
    52  		arg1 string
    53  		arg2 func(string, string) error
    54  	}
    55  	walkAppFilesReturns struct {
    56  		result1 error
    57  	}
    58  	walkAppFilesReturnsOnCall map[int]struct {
    59  		result1 error
    60  	}
    61  	invocations      map[string][][]interface{}
    62  	invocationsMutex sync.RWMutex
    63  }
    64  
    65  func (fake *FakeAppFiles) AppFilesInDir(arg1 string) ([]models.AppFileFields, error) {
    66  	fake.appFilesInDirMutex.Lock()
    67  	ret, specificReturn := fake.appFilesInDirReturnsOnCall[len(fake.appFilesInDirArgsForCall)]
    68  	fake.appFilesInDirArgsForCall = append(fake.appFilesInDirArgsForCall, struct {
    69  		arg1 string
    70  	}{arg1})
    71  	fake.recordInvocation("AppFilesInDir", []interface{}{arg1})
    72  	fake.appFilesInDirMutex.Unlock()
    73  	if fake.AppFilesInDirStub != nil {
    74  		return fake.AppFilesInDirStub(arg1)
    75  	}
    76  	if specificReturn {
    77  		return ret.result1, ret.result2
    78  	}
    79  	fakeReturns := fake.appFilesInDirReturns
    80  	return fakeReturns.result1, fakeReturns.result2
    81  }
    82  
    83  func (fake *FakeAppFiles) AppFilesInDirCallCount() int {
    84  	fake.appFilesInDirMutex.RLock()
    85  	defer fake.appFilesInDirMutex.RUnlock()
    86  	return len(fake.appFilesInDirArgsForCall)
    87  }
    88  
    89  func (fake *FakeAppFiles) AppFilesInDirCalls(stub func(string) ([]models.AppFileFields, error)) {
    90  	fake.appFilesInDirMutex.Lock()
    91  	defer fake.appFilesInDirMutex.Unlock()
    92  	fake.AppFilesInDirStub = stub
    93  }
    94  
    95  func (fake *FakeAppFiles) AppFilesInDirArgsForCall(i int) string {
    96  	fake.appFilesInDirMutex.RLock()
    97  	defer fake.appFilesInDirMutex.RUnlock()
    98  	argsForCall := fake.appFilesInDirArgsForCall[i]
    99  	return argsForCall.arg1
   100  }
   101  
   102  func (fake *FakeAppFiles) AppFilesInDirReturns(result1 []models.AppFileFields, result2 error) {
   103  	fake.appFilesInDirMutex.Lock()
   104  	defer fake.appFilesInDirMutex.Unlock()
   105  	fake.AppFilesInDirStub = nil
   106  	fake.appFilesInDirReturns = struct {
   107  		result1 []models.AppFileFields
   108  		result2 error
   109  	}{result1, result2}
   110  }
   111  
   112  func (fake *FakeAppFiles) AppFilesInDirReturnsOnCall(i int, result1 []models.AppFileFields, result2 error) {
   113  	fake.appFilesInDirMutex.Lock()
   114  	defer fake.appFilesInDirMutex.Unlock()
   115  	fake.AppFilesInDirStub = nil
   116  	if fake.appFilesInDirReturnsOnCall == nil {
   117  		fake.appFilesInDirReturnsOnCall = make(map[int]struct {
   118  			result1 []models.AppFileFields
   119  			result2 error
   120  		})
   121  	}
   122  	fake.appFilesInDirReturnsOnCall[i] = struct {
   123  		result1 []models.AppFileFields
   124  		result2 error
   125  	}{result1, result2}
   126  }
   127  
   128  func (fake *FakeAppFiles) CopyFiles(arg1 []models.AppFileFields, arg2 string, arg3 string) error {
   129  	var arg1Copy []models.AppFileFields
   130  	if arg1 != nil {
   131  		arg1Copy = make([]models.AppFileFields, len(arg1))
   132  		copy(arg1Copy, arg1)
   133  	}
   134  	fake.copyFilesMutex.Lock()
   135  	ret, specificReturn := fake.copyFilesReturnsOnCall[len(fake.copyFilesArgsForCall)]
   136  	fake.copyFilesArgsForCall = append(fake.copyFilesArgsForCall, struct {
   137  		arg1 []models.AppFileFields
   138  		arg2 string
   139  		arg3 string
   140  	}{arg1Copy, arg2, arg3})
   141  	fake.recordInvocation("CopyFiles", []interface{}{arg1Copy, arg2, arg3})
   142  	fake.copyFilesMutex.Unlock()
   143  	if fake.CopyFilesStub != nil {
   144  		return fake.CopyFilesStub(arg1, arg2, arg3)
   145  	}
   146  	if specificReturn {
   147  		return ret.result1
   148  	}
   149  	fakeReturns := fake.copyFilesReturns
   150  	return fakeReturns.result1
   151  }
   152  
   153  func (fake *FakeAppFiles) CopyFilesCallCount() int {
   154  	fake.copyFilesMutex.RLock()
   155  	defer fake.copyFilesMutex.RUnlock()
   156  	return len(fake.copyFilesArgsForCall)
   157  }
   158  
   159  func (fake *FakeAppFiles) CopyFilesCalls(stub func([]models.AppFileFields, string, string) error) {
   160  	fake.copyFilesMutex.Lock()
   161  	defer fake.copyFilesMutex.Unlock()
   162  	fake.CopyFilesStub = stub
   163  }
   164  
   165  func (fake *FakeAppFiles) CopyFilesArgsForCall(i int) ([]models.AppFileFields, string, string) {
   166  	fake.copyFilesMutex.RLock()
   167  	defer fake.copyFilesMutex.RUnlock()
   168  	argsForCall := fake.copyFilesArgsForCall[i]
   169  	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
   170  }
   171  
   172  func (fake *FakeAppFiles) CopyFilesReturns(result1 error) {
   173  	fake.copyFilesMutex.Lock()
   174  	defer fake.copyFilesMutex.Unlock()
   175  	fake.CopyFilesStub = nil
   176  	fake.copyFilesReturns = struct {
   177  		result1 error
   178  	}{result1}
   179  }
   180  
   181  func (fake *FakeAppFiles) CopyFilesReturnsOnCall(i int, result1 error) {
   182  	fake.copyFilesMutex.Lock()
   183  	defer fake.copyFilesMutex.Unlock()
   184  	fake.CopyFilesStub = nil
   185  	if fake.copyFilesReturnsOnCall == nil {
   186  		fake.copyFilesReturnsOnCall = make(map[int]struct {
   187  			result1 error
   188  		})
   189  	}
   190  	fake.copyFilesReturnsOnCall[i] = struct {
   191  		result1 error
   192  	}{result1}
   193  }
   194  
   195  func (fake *FakeAppFiles) CountFiles(arg1 string) int64 {
   196  	fake.countFilesMutex.Lock()
   197  	ret, specificReturn := fake.countFilesReturnsOnCall[len(fake.countFilesArgsForCall)]
   198  	fake.countFilesArgsForCall = append(fake.countFilesArgsForCall, struct {
   199  		arg1 string
   200  	}{arg1})
   201  	fake.recordInvocation("CountFiles", []interface{}{arg1})
   202  	fake.countFilesMutex.Unlock()
   203  	if fake.CountFilesStub != nil {
   204  		return fake.CountFilesStub(arg1)
   205  	}
   206  	if specificReturn {
   207  		return ret.result1
   208  	}
   209  	fakeReturns := fake.countFilesReturns
   210  	return fakeReturns.result1
   211  }
   212  
   213  func (fake *FakeAppFiles) CountFilesCallCount() int {
   214  	fake.countFilesMutex.RLock()
   215  	defer fake.countFilesMutex.RUnlock()
   216  	return len(fake.countFilesArgsForCall)
   217  }
   218  
   219  func (fake *FakeAppFiles) CountFilesCalls(stub func(string) int64) {
   220  	fake.countFilesMutex.Lock()
   221  	defer fake.countFilesMutex.Unlock()
   222  	fake.CountFilesStub = stub
   223  }
   224  
   225  func (fake *FakeAppFiles) CountFilesArgsForCall(i int) string {
   226  	fake.countFilesMutex.RLock()
   227  	defer fake.countFilesMutex.RUnlock()
   228  	argsForCall := fake.countFilesArgsForCall[i]
   229  	return argsForCall.arg1
   230  }
   231  
   232  func (fake *FakeAppFiles) CountFilesReturns(result1 int64) {
   233  	fake.countFilesMutex.Lock()
   234  	defer fake.countFilesMutex.Unlock()
   235  	fake.CountFilesStub = nil
   236  	fake.countFilesReturns = struct {
   237  		result1 int64
   238  	}{result1}
   239  }
   240  
   241  func (fake *FakeAppFiles) CountFilesReturnsOnCall(i int, result1 int64) {
   242  	fake.countFilesMutex.Lock()
   243  	defer fake.countFilesMutex.Unlock()
   244  	fake.CountFilesStub = nil
   245  	if fake.countFilesReturnsOnCall == nil {
   246  		fake.countFilesReturnsOnCall = make(map[int]struct {
   247  			result1 int64
   248  		})
   249  	}
   250  	fake.countFilesReturnsOnCall[i] = struct {
   251  		result1 int64
   252  	}{result1}
   253  }
   254  
   255  func (fake *FakeAppFiles) WalkAppFiles(arg1 string, arg2 func(string, string) error) error {
   256  	fake.walkAppFilesMutex.Lock()
   257  	ret, specificReturn := fake.walkAppFilesReturnsOnCall[len(fake.walkAppFilesArgsForCall)]
   258  	fake.walkAppFilesArgsForCall = append(fake.walkAppFilesArgsForCall, struct {
   259  		arg1 string
   260  		arg2 func(string, string) error
   261  	}{arg1, arg2})
   262  	fake.recordInvocation("WalkAppFiles", []interface{}{arg1, arg2})
   263  	fake.walkAppFilesMutex.Unlock()
   264  	if fake.WalkAppFilesStub != nil {
   265  		return fake.WalkAppFilesStub(arg1, arg2)
   266  	}
   267  	if specificReturn {
   268  		return ret.result1
   269  	}
   270  	fakeReturns := fake.walkAppFilesReturns
   271  	return fakeReturns.result1
   272  }
   273  
   274  func (fake *FakeAppFiles) WalkAppFilesCallCount() int {
   275  	fake.walkAppFilesMutex.RLock()
   276  	defer fake.walkAppFilesMutex.RUnlock()
   277  	return len(fake.walkAppFilesArgsForCall)
   278  }
   279  
   280  func (fake *FakeAppFiles) WalkAppFilesCalls(stub func(string, func(string, string) error) error) {
   281  	fake.walkAppFilesMutex.Lock()
   282  	defer fake.walkAppFilesMutex.Unlock()
   283  	fake.WalkAppFilesStub = stub
   284  }
   285  
   286  func (fake *FakeAppFiles) WalkAppFilesArgsForCall(i int) (string, func(string, string) error) {
   287  	fake.walkAppFilesMutex.RLock()
   288  	defer fake.walkAppFilesMutex.RUnlock()
   289  	argsForCall := fake.walkAppFilesArgsForCall[i]
   290  	return argsForCall.arg1, argsForCall.arg2
   291  }
   292  
   293  func (fake *FakeAppFiles) WalkAppFilesReturns(result1 error) {
   294  	fake.walkAppFilesMutex.Lock()
   295  	defer fake.walkAppFilesMutex.Unlock()
   296  	fake.WalkAppFilesStub = nil
   297  	fake.walkAppFilesReturns = struct {
   298  		result1 error
   299  	}{result1}
   300  }
   301  
   302  func (fake *FakeAppFiles) WalkAppFilesReturnsOnCall(i int, result1 error) {
   303  	fake.walkAppFilesMutex.Lock()
   304  	defer fake.walkAppFilesMutex.Unlock()
   305  	fake.WalkAppFilesStub = nil
   306  	if fake.walkAppFilesReturnsOnCall == nil {
   307  		fake.walkAppFilesReturnsOnCall = make(map[int]struct {
   308  			result1 error
   309  		})
   310  	}
   311  	fake.walkAppFilesReturnsOnCall[i] = struct {
   312  		result1 error
   313  	}{result1}
   314  }
   315  
   316  func (fake *FakeAppFiles) Invocations() map[string][][]interface{} {
   317  	fake.invocationsMutex.RLock()
   318  	defer fake.invocationsMutex.RUnlock()
   319  	fake.appFilesInDirMutex.RLock()
   320  	defer fake.appFilesInDirMutex.RUnlock()
   321  	fake.copyFilesMutex.RLock()
   322  	defer fake.copyFilesMutex.RUnlock()
   323  	fake.countFilesMutex.RLock()
   324  	defer fake.countFilesMutex.RUnlock()
   325  	fake.walkAppFilesMutex.RLock()
   326  	defer fake.walkAppFilesMutex.RUnlock()
   327  	copiedInvocations := map[string][][]interface{}{}
   328  	for key, value := range fake.invocations {
   329  		copiedInvocations[key] = value
   330  	}
   331  	return copiedInvocations
   332  }
   333  
   334  func (fake *FakeAppFiles) recordInvocation(key string, args []interface{}) {
   335  	fake.invocationsMutex.Lock()
   336  	defer fake.invocationsMutex.Unlock()
   337  	if fake.invocations == nil {
   338  		fake.invocations = map[string][][]interface{}{}
   339  	}
   340  	if fake.invocations[key] == nil {
   341  		fake.invocations[key] = [][]interface{}{}
   342  	}
   343  	fake.invocations[key] = append(fake.invocations[key], args)
   344  }
   345  
   346  var _ appfiles.AppFiles = new(FakeAppFiles)