github.com/pf-qiu/concourse/v6@v6.7.3-0.20201207032516-1f455d73275f/atc/api/accessor/accessorfakes/fake_access.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package accessorfakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"github.com/pf-qiu/concourse/v6/atc/api/accessor"
     8  )
     9  
    10  type FakeAccess struct {
    11  	ClaimsStub        func() accessor.Claims
    12  	claimsMutex       sync.RWMutex
    13  	claimsArgsForCall []struct {
    14  	}
    15  	claimsReturns struct {
    16  		result1 accessor.Claims
    17  	}
    18  	claimsReturnsOnCall map[int]struct {
    19  		result1 accessor.Claims
    20  	}
    21  	HasTokenStub        func() bool
    22  	hasTokenMutex       sync.RWMutex
    23  	hasTokenArgsForCall []struct {
    24  	}
    25  	hasTokenReturns struct {
    26  		result1 bool
    27  	}
    28  	hasTokenReturnsOnCall map[int]struct {
    29  		result1 bool
    30  	}
    31  	IsAdminStub        func() bool
    32  	isAdminMutex       sync.RWMutex
    33  	isAdminArgsForCall []struct {
    34  	}
    35  	isAdminReturns struct {
    36  		result1 bool
    37  	}
    38  	isAdminReturnsOnCall map[int]struct {
    39  		result1 bool
    40  	}
    41  	IsAuthenticatedStub        func() bool
    42  	isAuthenticatedMutex       sync.RWMutex
    43  	isAuthenticatedArgsForCall []struct {
    44  	}
    45  	isAuthenticatedReturns struct {
    46  		result1 bool
    47  	}
    48  	isAuthenticatedReturnsOnCall map[int]struct {
    49  		result1 bool
    50  	}
    51  	IsAuthorizedStub        func(string) bool
    52  	isAuthorizedMutex       sync.RWMutex
    53  	isAuthorizedArgsForCall []struct {
    54  		arg1 string
    55  	}
    56  	isAuthorizedReturns struct {
    57  		result1 bool
    58  	}
    59  	isAuthorizedReturnsOnCall map[int]struct {
    60  		result1 bool
    61  	}
    62  	IsSystemStub        func() bool
    63  	isSystemMutex       sync.RWMutex
    64  	isSystemArgsForCall []struct {
    65  	}
    66  	isSystemReturns struct {
    67  		result1 bool
    68  	}
    69  	isSystemReturnsOnCall map[int]struct {
    70  		result1 bool
    71  	}
    72  	TeamNamesStub        func() []string
    73  	teamNamesMutex       sync.RWMutex
    74  	teamNamesArgsForCall []struct {
    75  	}
    76  	teamNamesReturns struct {
    77  		result1 []string
    78  	}
    79  	teamNamesReturnsOnCall map[int]struct {
    80  		result1 []string
    81  	}
    82  	TeamRolesStub        func() map[string][]string
    83  	teamRolesMutex       sync.RWMutex
    84  	teamRolesArgsForCall []struct {
    85  	}
    86  	teamRolesReturns struct {
    87  		result1 map[string][]string
    88  	}
    89  	teamRolesReturnsOnCall map[int]struct {
    90  		result1 map[string][]string
    91  	}
    92  	invocations      map[string][][]interface{}
    93  	invocationsMutex sync.RWMutex
    94  }
    95  
    96  func (fake *FakeAccess) Claims() accessor.Claims {
    97  	fake.claimsMutex.Lock()
    98  	ret, specificReturn := fake.claimsReturnsOnCall[len(fake.claimsArgsForCall)]
    99  	fake.claimsArgsForCall = append(fake.claimsArgsForCall, struct {
   100  	}{})
   101  	fake.recordInvocation("Claims", []interface{}{})
   102  	fake.claimsMutex.Unlock()
   103  	if fake.ClaimsStub != nil {
   104  		return fake.ClaimsStub()
   105  	}
   106  	if specificReturn {
   107  		return ret.result1
   108  	}
   109  	fakeReturns := fake.claimsReturns
   110  	return fakeReturns.result1
   111  }
   112  
   113  func (fake *FakeAccess) ClaimsCallCount() int {
   114  	fake.claimsMutex.RLock()
   115  	defer fake.claimsMutex.RUnlock()
   116  	return len(fake.claimsArgsForCall)
   117  }
   118  
   119  func (fake *FakeAccess) ClaimsCalls(stub func() accessor.Claims) {
   120  	fake.claimsMutex.Lock()
   121  	defer fake.claimsMutex.Unlock()
   122  	fake.ClaimsStub = stub
   123  }
   124  
   125  func (fake *FakeAccess) ClaimsReturns(result1 accessor.Claims) {
   126  	fake.claimsMutex.Lock()
   127  	defer fake.claimsMutex.Unlock()
   128  	fake.ClaimsStub = nil
   129  	fake.claimsReturns = struct {
   130  		result1 accessor.Claims
   131  	}{result1}
   132  }
   133  
   134  func (fake *FakeAccess) ClaimsReturnsOnCall(i int, result1 accessor.Claims) {
   135  	fake.claimsMutex.Lock()
   136  	defer fake.claimsMutex.Unlock()
   137  	fake.ClaimsStub = nil
   138  	if fake.claimsReturnsOnCall == nil {
   139  		fake.claimsReturnsOnCall = make(map[int]struct {
   140  			result1 accessor.Claims
   141  		})
   142  	}
   143  	fake.claimsReturnsOnCall[i] = struct {
   144  		result1 accessor.Claims
   145  	}{result1}
   146  }
   147  
   148  func (fake *FakeAccess) HasToken() bool {
   149  	fake.hasTokenMutex.Lock()
   150  	ret, specificReturn := fake.hasTokenReturnsOnCall[len(fake.hasTokenArgsForCall)]
   151  	fake.hasTokenArgsForCall = append(fake.hasTokenArgsForCall, struct {
   152  	}{})
   153  	fake.recordInvocation("HasToken", []interface{}{})
   154  	fake.hasTokenMutex.Unlock()
   155  	if fake.HasTokenStub != nil {
   156  		return fake.HasTokenStub()
   157  	}
   158  	if specificReturn {
   159  		return ret.result1
   160  	}
   161  	fakeReturns := fake.hasTokenReturns
   162  	return fakeReturns.result1
   163  }
   164  
   165  func (fake *FakeAccess) HasTokenCallCount() int {
   166  	fake.hasTokenMutex.RLock()
   167  	defer fake.hasTokenMutex.RUnlock()
   168  	return len(fake.hasTokenArgsForCall)
   169  }
   170  
   171  func (fake *FakeAccess) HasTokenCalls(stub func() bool) {
   172  	fake.hasTokenMutex.Lock()
   173  	defer fake.hasTokenMutex.Unlock()
   174  	fake.HasTokenStub = stub
   175  }
   176  
   177  func (fake *FakeAccess) HasTokenReturns(result1 bool) {
   178  	fake.hasTokenMutex.Lock()
   179  	defer fake.hasTokenMutex.Unlock()
   180  	fake.HasTokenStub = nil
   181  	fake.hasTokenReturns = struct {
   182  		result1 bool
   183  	}{result1}
   184  }
   185  
   186  func (fake *FakeAccess) HasTokenReturnsOnCall(i int, result1 bool) {
   187  	fake.hasTokenMutex.Lock()
   188  	defer fake.hasTokenMutex.Unlock()
   189  	fake.HasTokenStub = nil
   190  	if fake.hasTokenReturnsOnCall == nil {
   191  		fake.hasTokenReturnsOnCall = make(map[int]struct {
   192  			result1 bool
   193  		})
   194  	}
   195  	fake.hasTokenReturnsOnCall[i] = struct {
   196  		result1 bool
   197  	}{result1}
   198  }
   199  
   200  func (fake *FakeAccess) IsAdmin() bool {
   201  	fake.isAdminMutex.Lock()
   202  	ret, specificReturn := fake.isAdminReturnsOnCall[len(fake.isAdminArgsForCall)]
   203  	fake.isAdminArgsForCall = append(fake.isAdminArgsForCall, struct {
   204  	}{})
   205  	fake.recordInvocation("IsAdmin", []interface{}{})
   206  	fake.isAdminMutex.Unlock()
   207  	if fake.IsAdminStub != nil {
   208  		return fake.IsAdminStub()
   209  	}
   210  	if specificReturn {
   211  		return ret.result1
   212  	}
   213  	fakeReturns := fake.isAdminReturns
   214  	return fakeReturns.result1
   215  }
   216  
   217  func (fake *FakeAccess) IsAdminCallCount() int {
   218  	fake.isAdminMutex.RLock()
   219  	defer fake.isAdminMutex.RUnlock()
   220  	return len(fake.isAdminArgsForCall)
   221  }
   222  
   223  func (fake *FakeAccess) IsAdminCalls(stub func() bool) {
   224  	fake.isAdminMutex.Lock()
   225  	defer fake.isAdminMutex.Unlock()
   226  	fake.IsAdminStub = stub
   227  }
   228  
   229  func (fake *FakeAccess) IsAdminReturns(result1 bool) {
   230  	fake.isAdminMutex.Lock()
   231  	defer fake.isAdminMutex.Unlock()
   232  	fake.IsAdminStub = nil
   233  	fake.isAdminReturns = struct {
   234  		result1 bool
   235  	}{result1}
   236  }
   237  
   238  func (fake *FakeAccess) IsAdminReturnsOnCall(i int, result1 bool) {
   239  	fake.isAdminMutex.Lock()
   240  	defer fake.isAdminMutex.Unlock()
   241  	fake.IsAdminStub = nil
   242  	if fake.isAdminReturnsOnCall == nil {
   243  		fake.isAdminReturnsOnCall = make(map[int]struct {
   244  			result1 bool
   245  		})
   246  	}
   247  	fake.isAdminReturnsOnCall[i] = struct {
   248  		result1 bool
   249  	}{result1}
   250  }
   251  
   252  func (fake *FakeAccess) IsAuthenticated() bool {
   253  	fake.isAuthenticatedMutex.Lock()
   254  	ret, specificReturn := fake.isAuthenticatedReturnsOnCall[len(fake.isAuthenticatedArgsForCall)]
   255  	fake.isAuthenticatedArgsForCall = append(fake.isAuthenticatedArgsForCall, struct {
   256  	}{})
   257  	fake.recordInvocation("IsAuthenticated", []interface{}{})
   258  	fake.isAuthenticatedMutex.Unlock()
   259  	if fake.IsAuthenticatedStub != nil {
   260  		return fake.IsAuthenticatedStub()
   261  	}
   262  	if specificReturn {
   263  		return ret.result1
   264  	}
   265  	fakeReturns := fake.isAuthenticatedReturns
   266  	return fakeReturns.result1
   267  }
   268  
   269  func (fake *FakeAccess) IsAuthenticatedCallCount() int {
   270  	fake.isAuthenticatedMutex.RLock()
   271  	defer fake.isAuthenticatedMutex.RUnlock()
   272  	return len(fake.isAuthenticatedArgsForCall)
   273  }
   274  
   275  func (fake *FakeAccess) IsAuthenticatedCalls(stub func() bool) {
   276  	fake.isAuthenticatedMutex.Lock()
   277  	defer fake.isAuthenticatedMutex.Unlock()
   278  	fake.IsAuthenticatedStub = stub
   279  }
   280  
   281  func (fake *FakeAccess) IsAuthenticatedReturns(result1 bool) {
   282  	fake.isAuthenticatedMutex.Lock()
   283  	defer fake.isAuthenticatedMutex.Unlock()
   284  	fake.IsAuthenticatedStub = nil
   285  	fake.isAuthenticatedReturns = struct {
   286  		result1 bool
   287  	}{result1}
   288  }
   289  
   290  func (fake *FakeAccess) IsAuthenticatedReturnsOnCall(i int, result1 bool) {
   291  	fake.isAuthenticatedMutex.Lock()
   292  	defer fake.isAuthenticatedMutex.Unlock()
   293  	fake.IsAuthenticatedStub = nil
   294  	if fake.isAuthenticatedReturnsOnCall == nil {
   295  		fake.isAuthenticatedReturnsOnCall = make(map[int]struct {
   296  			result1 bool
   297  		})
   298  	}
   299  	fake.isAuthenticatedReturnsOnCall[i] = struct {
   300  		result1 bool
   301  	}{result1}
   302  }
   303  
   304  func (fake *FakeAccess) IsAuthorized(arg1 string) bool {
   305  	fake.isAuthorizedMutex.Lock()
   306  	ret, specificReturn := fake.isAuthorizedReturnsOnCall[len(fake.isAuthorizedArgsForCall)]
   307  	fake.isAuthorizedArgsForCall = append(fake.isAuthorizedArgsForCall, struct {
   308  		arg1 string
   309  	}{arg1})
   310  	fake.recordInvocation("IsAuthorized", []interface{}{arg1})
   311  	fake.isAuthorizedMutex.Unlock()
   312  	if fake.IsAuthorizedStub != nil {
   313  		return fake.IsAuthorizedStub(arg1)
   314  	}
   315  	if specificReturn {
   316  		return ret.result1
   317  	}
   318  	fakeReturns := fake.isAuthorizedReturns
   319  	return fakeReturns.result1
   320  }
   321  
   322  func (fake *FakeAccess) IsAuthorizedCallCount() int {
   323  	fake.isAuthorizedMutex.RLock()
   324  	defer fake.isAuthorizedMutex.RUnlock()
   325  	return len(fake.isAuthorizedArgsForCall)
   326  }
   327  
   328  func (fake *FakeAccess) IsAuthorizedCalls(stub func(string) bool) {
   329  	fake.isAuthorizedMutex.Lock()
   330  	defer fake.isAuthorizedMutex.Unlock()
   331  	fake.IsAuthorizedStub = stub
   332  }
   333  
   334  func (fake *FakeAccess) IsAuthorizedArgsForCall(i int) string {
   335  	fake.isAuthorizedMutex.RLock()
   336  	defer fake.isAuthorizedMutex.RUnlock()
   337  	argsForCall := fake.isAuthorizedArgsForCall[i]
   338  	return argsForCall.arg1
   339  }
   340  
   341  func (fake *FakeAccess) IsAuthorizedReturns(result1 bool) {
   342  	fake.isAuthorizedMutex.Lock()
   343  	defer fake.isAuthorizedMutex.Unlock()
   344  	fake.IsAuthorizedStub = nil
   345  	fake.isAuthorizedReturns = struct {
   346  		result1 bool
   347  	}{result1}
   348  }
   349  
   350  func (fake *FakeAccess) IsAuthorizedReturnsOnCall(i int, result1 bool) {
   351  	fake.isAuthorizedMutex.Lock()
   352  	defer fake.isAuthorizedMutex.Unlock()
   353  	fake.IsAuthorizedStub = nil
   354  	if fake.isAuthorizedReturnsOnCall == nil {
   355  		fake.isAuthorizedReturnsOnCall = make(map[int]struct {
   356  			result1 bool
   357  		})
   358  	}
   359  	fake.isAuthorizedReturnsOnCall[i] = struct {
   360  		result1 bool
   361  	}{result1}
   362  }
   363  
   364  func (fake *FakeAccess) IsSystem() bool {
   365  	fake.isSystemMutex.Lock()
   366  	ret, specificReturn := fake.isSystemReturnsOnCall[len(fake.isSystemArgsForCall)]
   367  	fake.isSystemArgsForCall = append(fake.isSystemArgsForCall, struct {
   368  	}{})
   369  	fake.recordInvocation("IsSystem", []interface{}{})
   370  	fake.isSystemMutex.Unlock()
   371  	if fake.IsSystemStub != nil {
   372  		return fake.IsSystemStub()
   373  	}
   374  	if specificReturn {
   375  		return ret.result1
   376  	}
   377  	fakeReturns := fake.isSystemReturns
   378  	return fakeReturns.result1
   379  }
   380  
   381  func (fake *FakeAccess) IsSystemCallCount() int {
   382  	fake.isSystemMutex.RLock()
   383  	defer fake.isSystemMutex.RUnlock()
   384  	return len(fake.isSystemArgsForCall)
   385  }
   386  
   387  func (fake *FakeAccess) IsSystemCalls(stub func() bool) {
   388  	fake.isSystemMutex.Lock()
   389  	defer fake.isSystemMutex.Unlock()
   390  	fake.IsSystemStub = stub
   391  }
   392  
   393  func (fake *FakeAccess) IsSystemReturns(result1 bool) {
   394  	fake.isSystemMutex.Lock()
   395  	defer fake.isSystemMutex.Unlock()
   396  	fake.IsSystemStub = nil
   397  	fake.isSystemReturns = struct {
   398  		result1 bool
   399  	}{result1}
   400  }
   401  
   402  func (fake *FakeAccess) IsSystemReturnsOnCall(i int, result1 bool) {
   403  	fake.isSystemMutex.Lock()
   404  	defer fake.isSystemMutex.Unlock()
   405  	fake.IsSystemStub = nil
   406  	if fake.isSystemReturnsOnCall == nil {
   407  		fake.isSystemReturnsOnCall = make(map[int]struct {
   408  			result1 bool
   409  		})
   410  	}
   411  	fake.isSystemReturnsOnCall[i] = struct {
   412  		result1 bool
   413  	}{result1}
   414  }
   415  
   416  func (fake *FakeAccess) TeamNames() []string {
   417  	fake.teamNamesMutex.Lock()
   418  	ret, specificReturn := fake.teamNamesReturnsOnCall[len(fake.teamNamesArgsForCall)]
   419  	fake.teamNamesArgsForCall = append(fake.teamNamesArgsForCall, struct {
   420  	}{})
   421  	fake.recordInvocation("TeamNames", []interface{}{})
   422  	fake.teamNamesMutex.Unlock()
   423  	if fake.TeamNamesStub != nil {
   424  		return fake.TeamNamesStub()
   425  	}
   426  	if specificReturn {
   427  		return ret.result1
   428  	}
   429  	fakeReturns := fake.teamNamesReturns
   430  	return fakeReturns.result1
   431  }
   432  
   433  func (fake *FakeAccess) TeamNamesCallCount() int {
   434  	fake.teamNamesMutex.RLock()
   435  	defer fake.teamNamesMutex.RUnlock()
   436  	return len(fake.teamNamesArgsForCall)
   437  }
   438  
   439  func (fake *FakeAccess) TeamNamesCalls(stub func() []string) {
   440  	fake.teamNamesMutex.Lock()
   441  	defer fake.teamNamesMutex.Unlock()
   442  	fake.TeamNamesStub = stub
   443  }
   444  
   445  func (fake *FakeAccess) TeamNamesReturns(result1 []string) {
   446  	fake.teamNamesMutex.Lock()
   447  	defer fake.teamNamesMutex.Unlock()
   448  	fake.TeamNamesStub = nil
   449  	fake.teamNamesReturns = struct {
   450  		result1 []string
   451  	}{result1}
   452  }
   453  
   454  func (fake *FakeAccess) TeamNamesReturnsOnCall(i int, result1 []string) {
   455  	fake.teamNamesMutex.Lock()
   456  	defer fake.teamNamesMutex.Unlock()
   457  	fake.TeamNamesStub = nil
   458  	if fake.teamNamesReturnsOnCall == nil {
   459  		fake.teamNamesReturnsOnCall = make(map[int]struct {
   460  			result1 []string
   461  		})
   462  	}
   463  	fake.teamNamesReturnsOnCall[i] = struct {
   464  		result1 []string
   465  	}{result1}
   466  }
   467  
   468  func (fake *FakeAccess) TeamRoles() map[string][]string {
   469  	fake.teamRolesMutex.Lock()
   470  	ret, specificReturn := fake.teamRolesReturnsOnCall[len(fake.teamRolesArgsForCall)]
   471  	fake.teamRolesArgsForCall = append(fake.teamRolesArgsForCall, struct {
   472  	}{})
   473  	fake.recordInvocation("TeamRoles", []interface{}{})
   474  	fake.teamRolesMutex.Unlock()
   475  	if fake.TeamRolesStub != nil {
   476  		return fake.TeamRolesStub()
   477  	}
   478  	if specificReturn {
   479  		return ret.result1
   480  	}
   481  	fakeReturns := fake.teamRolesReturns
   482  	return fakeReturns.result1
   483  }
   484  
   485  func (fake *FakeAccess) TeamRolesCallCount() int {
   486  	fake.teamRolesMutex.RLock()
   487  	defer fake.teamRolesMutex.RUnlock()
   488  	return len(fake.teamRolesArgsForCall)
   489  }
   490  
   491  func (fake *FakeAccess) TeamRolesCalls(stub func() map[string][]string) {
   492  	fake.teamRolesMutex.Lock()
   493  	defer fake.teamRolesMutex.Unlock()
   494  	fake.TeamRolesStub = stub
   495  }
   496  
   497  func (fake *FakeAccess) TeamRolesReturns(result1 map[string][]string) {
   498  	fake.teamRolesMutex.Lock()
   499  	defer fake.teamRolesMutex.Unlock()
   500  	fake.TeamRolesStub = nil
   501  	fake.teamRolesReturns = struct {
   502  		result1 map[string][]string
   503  	}{result1}
   504  }
   505  
   506  func (fake *FakeAccess) TeamRolesReturnsOnCall(i int, result1 map[string][]string) {
   507  	fake.teamRolesMutex.Lock()
   508  	defer fake.teamRolesMutex.Unlock()
   509  	fake.TeamRolesStub = nil
   510  	if fake.teamRolesReturnsOnCall == nil {
   511  		fake.teamRolesReturnsOnCall = make(map[int]struct {
   512  			result1 map[string][]string
   513  		})
   514  	}
   515  	fake.teamRolesReturnsOnCall[i] = struct {
   516  		result1 map[string][]string
   517  	}{result1}
   518  }
   519  
   520  func (fake *FakeAccess) Invocations() map[string][][]interface{} {
   521  	fake.invocationsMutex.RLock()
   522  	defer fake.invocationsMutex.RUnlock()
   523  	fake.claimsMutex.RLock()
   524  	defer fake.claimsMutex.RUnlock()
   525  	fake.hasTokenMutex.RLock()
   526  	defer fake.hasTokenMutex.RUnlock()
   527  	fake.isAdminMutex.RLock()
   528  	defer fake.isAdminMutex.RUnlock()
   529  	fake.isAuthenticatedMutex.RLock()
   530  	defer fake.isAuthenticatedMutex.RUnlock()
   531  	fake.isAuthorizedMutex.RLock()
   532  	defer fake.isAuthorizedMutex.RUnlock()
   533  	fake.isSystemMutex.RLock()
   534  	defer fake.isSystemMutex.RUnlock()
   535  	fake.teamNamesMutex.RLock()
   536  	defer fake.teamNamesMutex.RUnlock()
   537  	fake.teamRolesMutex.RLock()
   538  	defer fake.teamRolesMutex.RUnlock()
   539  	copiedInvocations := map[string][][]interface{}{}
   540  	for key, value := range fake.invocations {
   541  		copiedInvocations[key] = value
   542  	}
   543  	return copiedInvocations
   544  }
   545  
   546  func (fake *FakeAccess) recordInvocation(key string, args []interface{}) {
   547  	fake.invocationsMutex.Lock()
   548  	defer fake.invocationsMutex.Unlock()
   549  	if fake.invocations == nil {
   550  		fake.invocations = map[string][][]interface{}{}
   551  	}
   552  	if fake.invocations[key] == nil {
   553  		fake.invocations[key] = [][]interface{}{}
   554  	}
   555  	fake.invocations[key] = append(fake.invocations[key], args)
   556  }
   557  
   558  var _ accessor.Access = new(FakeAccess)