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

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package environmentvariablegroupsfakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"code.cloudfoundry.org/cli/cf/api/environmentvariablegroups"
     8  	"code.cloudfoundry.org/cli/cf/models"
     9  )
    10  
    11  type FakeRepository struct {
    12  	ListRunningStub        func() ([]models.EnvironmentVariable, error)
    13  	listRunningMutex       sync.RWMutex
    14  	listRunningArgsForCall []struct {
    15  	}
    16  	listRunningReturns struct {
    17  		result1 []models.EnvironmentVariable
    18  		result2 error
    19  	}
    20  	listRunningReturnsOnCall map[int]struct {
    21  		result1 []models.EnvironmentVariable
    22  		result2 error
    23  	}
    24  	ListStagingStub        func() ([]models.EnvironmentVariable, error)
    25  	listStagingMutex       sync.RWMutex
    26  	listStagingArgsForCall []struct {
    27  	}
    28  	listStagingReturns struct {
    29  		result1 []models.EnvironmentVariable
    30  		result2 error
    31  	}
    32  	listStagingReturnsOnCall map[int]struct {
    33  		result1 []models.EnvironmentVariable
    34  		result2 error
    35  	}
    36  	SetRunningStub        func(string) error
    37  	setRunningMutex       sync.RWMutex
    38  	setRunningArgsForCall []struct {
    39  		arg1 string
    40  	}
    41  	setRunningReturns struct {
    42  		result1 error
    43  	}
    44  	setRunningReturnsOnCall map[int]struct {
    45  		result1 error
    46  	}
    47  	SetStagingStub        func(string) error
    48  	setStagingMutex       sync.RWMutex
    49  	setStagingArgsForCall []struct {
    50  		arg1 string
    51  	}
    52  	setStagingReturns struct {
    53  		result1 error
    54  	}
    55  	setStagingReturnsOnCall map[int]struct {
    56  		result1 error
    57  	}
    58  	invocations      map[string][][]interface{}
    59  	invocationsMutex sync.RWMutex
    60  }
    61  
    62  func (fake *FakeRepository) ListRunning() ([]models.EnvironmentVariable, error) {
    63  	fake.listRunningMutex.Lock()
    64  	ret, specificReturn := fake.listRunningReturnsOnCall[len(fake.listRunningArgsForCall)]
    65  	fake.listRunningArgsForCall = append(fake.listRunningArgsForCall, struct {
    66  	}{})
    67  	fake.recordInvocation("ListRunning", []interface{}{})
    68  	fake.listRunningMutex.Unlock()
    69  	if fake.ListRunningStub != nil {
    70  		return fake.ListRunningStub()
    71  	}
    72  	if specificReturn {
    73  		return ret.result1, ret.result2
    74  	}
    75  	fakeReturns := fake.listRunningReturns
    76  	return fakeReturns.result1, fakeReturns.result2
    77  }
    78  
    79  func (fake *FakeRepository) ListRunningCallCount() int {
    80  	fake.listRunningMutex.RLock()
    81  	defer fake.listRunningMutex.RUnlock()
    82  	return len(fake.listRunningArgsForCall)
    83  }
    84  
    85  func (fake *FakeRepository) ListRunningCalls(stub func() ([]models.EnvironmentVariable, error)) {
    86  	fake.listRunningMutex.Lock()
    87  	defer fake.listRunningMutex.Unlock()
    88  	fake.ListRunningStub = stub
    89  }
    90  
    91  func (fake *FakeRepository) ListRunningReturns(result1 []models.EnvironmentVariable, result2 error) {
    92  	fake.listRunningMutex.Lock()
    93  	defer fake.listRunningMutex.Unlock()
    94  	fake.ListRunningStub = nil
    95  	fake.listRunningReturns = struct {
    96  		result1 []models.EnvironmentVariable
    97  		result2 error
    98  	}{result1, result2}
    99  }
   100  
   101  func (fake *FakeRepository) ListRunningReturnsOnCall(i int, result1 []models.EnvironmentVariable, result2 error) {
   102  	fake.listRunningMutex.Lock()
   103  	defer fake.listRunningMutex.Unlock()
   104  	fake.ListRunningStub = nil
   105  	if fake.listRunningReturnsOnCall == nil {
   106  		fake.listRunningReturnsOnCall = make(map[int]struct {
   107  			result1 []models.EnvironmentVariable
   108  			result2 error
   109  		})
   110  	}
   111  	fake.listRunningReturnsOnCall[i] = struct {
   112  		result1 []models.EnvironmentVariable
   113  		result2 error
   114  	}{result1, result2}
   115  }
   116  
   117  func (fake *FakeRepository) ListStaging() ([]models.EnvironmentVariable, error) {
   118  	fake.listStagingMutex.Lock()
   119  	ret, specificReturn := fake.listStagingReturnsOnCall[len(fake.listStagingArgsForCall)]
   120  	fake.listStagingArgsForCall = append(fake.listStagingArgsForCall, struct {
   121  	}{})
   122  	fake.recordInvocation("ListStaging", []interface{}{})
   123  	fake.listStagingMutex.Unlock()
   124  	if fake.ListStagingStub != nil {
   125  		return fake.ListStagingStub()
   126  	}
   127  	if specificReturn {
   128  		return ret.result1, ret.result2
   129  	}
   130  	fakeReturns := fake.listStagingReturns
   131  	return fakeReturns.result1, fakeReturns.result2
   132  }
   133  
   134  func (fake *FakeRepository) ListStagingCallCount() int {
   135  	fake.listStagingMutex.RLock()
   136  	defer fake.listStagingMutex.RUnlock()
   137  	return len(fake.listStagingArgsForCall)
   138  }
   139  
   140  func (fake *FakeRepository) ListStagingCalls(stub func() ([]models.EnvironmentVariable, error)) {
   141  	fake.listStagingMutex.Lock()
   142  	defer fake.listStagingMutex.Unlock()
   143  	fake.ListStagingStub = stub
   144  }
   145  
   146  func (fake *FakeRepository) ListStagingReturns(result1 []models.EnvironmentVariable, result2 error) {
   147  	fake.listStagingMutex.Lock()
   148  	defer fake.listStagingMutex.Unlock()
   149  	fake.ListStagingStub = nil
   150  	fake.listStagingReturns = struct {
   151  		result1 []models.EnvironmentVariable
   152  		result2 error
   153  	}{result1, result2}
   154  }
   155  
   156  func (fake *FakeRepository) ListStagingReturnsOnCall(i int, result1 []models.EnvironmentVariable, result2 error) {
   157  	fake.listStagingMutex.Lock()
   158  	defer fake.listStagingMutex.Unlock()
   159  	fake.ListStagingStub = nil
   160  	if fake.listStagingReturnsOnCall == nil {
   161  		fake.listStagingReturnsOnCall = make(map[int]struct {
   162  			result1 []models.EnvironmentVariable
   163  			result2 error
   164  		})
   165  	}
   166  	fake.listStagingReturnsOnCall[i] = struct {
   167  		result1 []models.EnvironmentVariable
   168  		result2 error
   169  	}{result1, result2}
   170  }
   171  
   172  func (fake *FakeRepository) SetRunning(arg1 string) error {
   173  	fake.setRunningMutex.Lock()
   174  	ret, specificReturn := fake.setRunningReturnsOnCall[len(fake.setRunningArgsForCall)]
   175  	fake.setRunningArgsForCall = append(fake.setRunningArgsForCall, struct {
   176  		arg1 string
   177  	}{arg1})
   178  	fake.recordInvocation("SetRunning", []interface{}{arg1})
   179  	fake.setRunningMutex.Unlock()
   180  	if fake.SetRunningStub != nil {
   181  		return fake.SetRunningStub(arg1)
   182  	}
   183  	if specificReturn {
   184  		return ret.result1
   185  	}
   186  	fakeReturns := fake.setRunningReturns
   187  	return fakeReturns.result1
   188  }
   189  
   190  func (fake *FakeRepository) SetRunningCallCount() int {
   191  	fake.setRunningMutex.RLock()
   192  	defer fake.setRunningMutex.RUnlock()
   193  	return len(fake.setRunningArgsForCall)
   194  }
   195  
   196  func (fake *FakeRepository) SetRunningCalls(stub func(string) error) {
   197  	fake.setRunningMutex.Lock()
   198  	defer fake.setRunningMutex.Unlock()
   199  	fake.SetRunningStub = stub
   200  }
   201  
   202  func (fake *FakeRepository) SetRunningArgsForCall(i int) string {
   203  	fake.setRunningMutex.RLock()
   204  	defer fake.setRunningMutex.RUnlock()
   205  	argsForCall := fake.setRunningArgsForCall[i]
   206  	return argsForCall.arg1
   207  }
   208  
   209  func (fake *FakeRepository) SetRunningReturns(result1 error) {
   210  	fake.setRunningMutex.Lock()
   211  	defer fake.setRunningMutex.Unlock()
   212  	fake.SetRunningStub = nil
   213  	fake.setRunningReturns = struct {
   214  		result1 error
   215  	}{result1}
   216  }
   217  
   218  func (fake *FakeRepository) SetRunningReturnsOnCall(i int, result1 error) {
   219  	fake.setRunningMutex.Lock()
   220  	defer fake.setRunningMutex.Unlock()
   221  	fake.SetRunningStub = nil
   222  	if fake.setRunningReturnsOnCall == nil {
   223  		fake.setRunningReturnsOnCall = make(map[int]struct {
   224  			result1 error
   225  		})
   226  	}
   227  	fake.setRunningReturnsOnCall[i] = struct {
   228  		result1 error
   229  	}{result1}
   230  }
   231  
   232  func (fake *FakeRepository) SetStaging(arg1 string) error {
   233  	fake.setStagingMutex.Lock()
   234  	ret, specificReturn := fake.setStagingReturnsOnCall[len(fake.setStagingArgsForCall)]
   235  	fake.setStagingArgsForCall = append(fake.setStagingArgsForCall, struct {
   236  		arg1 string
   237  	}{arg1})
   238  	fake.recordInvocation("SetStaging", []interface{}{arg1})
   239  	fake.setStagingMutex.Unlock()
   240  	if fake.SetStagingStub != nil {
   241  		return fake.SetStagingStub(arg1)
   242  	}
   243  	if specificReturn {
   244  		return ret.result1
   245  	}
   246  	fakeReturns := fake.setStagingReturns
   247  	return fakeReturns.result1
   248  }
   249  
   250  func (fake *FakeRepository) SetStagingCallCount() int {
   251  	fake.setStagingMutex.RLock()
   252  	defer fake.setStagingMutex.RUnlock()
   253  	return len(fake.setStagingArgsForCall)
   254  }
   255  
   256  func (fake *FakeRepository) SetStagingCalls(stub func(string) error) {
   257  	fake.setStagingMutex.Lock()
   258  	defer fake.setStagingMutex.Unlock()
   259  	fake.SetStagingStub = stub
   260  }
   261  
   262  func (fake *FakeRepository) SetStagingArgsForCall(i int) string {
   263  	fake.setStagingMutex.RLock()
   264  	defer fake.setStagingMutex.RUnlock()
   265  	argsForCall := fake.setStagingArgsForCall[i]
   266  	return argsForCall.arg1
   267  }
   268  
   269  func (fake *FakeRepository) SetStagingReturns(result1 error) {
   270  	fake.setStagingMutex.Lock()
   271  	defer fake.setStagingMutex.Unlock()
   272  	fake.SetStagingStub = nil
   273  	fake.setStagingReturns = struct {
   274  		result1 error
   275  	}{result1}
   276  }
   277  
   278  func (fake *FakeRepository) SetStagingReturnsOnCall(i int, result1 error) {
   279  	fake.setStagingMutex.Lock()
   280  	defer fake.setStagingMutex.Unlock()
   281  	fake.SetStagingStub = nil
   282  	if fake.setStagingReturnsOnCall == nil {
   283  		fake.setStagingReturnsOnCall = make(map[int]struct {
   284  			result1 error
   285  		})
   286  	}
   287  	fake.setStagingReturnsOnCall[i] = struct {
   288  		result1 error
   289  	}{result1}
   290  }
   291  
   292  func (fake *FakeRepository) Invocations() map[string][][]interface{} {
   293  	fake.invocationsMutex.RLock()
   294  	defer fake.invocationsMutex.RUnlock()
   295  	fake.listRunningMutex.RLock()
   296  	defer fake.listRunningMutex.RUnlock()
   297  	fake.listStagingMutex.RLock()
   298  	defer fake.listStagingMutex.RUnlock()
   299  	fake.setRunningMutex.RLock()
   300  	defer fake.setRunningMutex.RUnlock()
   301  	fake.setStagingMutex.RLock()
   302  	defer fake.setStagingMutex.RUnlock()
   303  	copiedInvocations := map[string][][]interface{}{}
   304  	for key, value := range fake.invocations {
   305  		copiedInvocations[key] = value
   306  	}
   307  	return copiedInvocations
   308  }
   309  
   310  func (fake *FakeRepository) recordInvocation(key string, args []interface{}) {
   311  	fake.invocationsMutex.Lock()
   312  	defer fake.invocationsMutex.Unlock()
   313  	if fake.invocations == nil {
   314  		fake.invocations = map[string][][]interface{}{}
   315  	}
   316  	if fake.invocations[key] == nil {
   317  		fake.invocations[key] = [][]interface{}{}
   318  	}
   319  	fake.invocations[key] = append(fake.invocations[key], args)
   320  }
   321  
   322  var _ environmentvariablegroups.Repository = new(FakeRepository)