github.com/franc20/ayesa_sap@v7.0.0-beta.28.0.20200124003224-302d4d52fa6c+incompatible/command/v7/v7fakes/fake_logs_actor.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package v7fakes
     3  
     4  import (
     5  	"context"
     6  	"sync"
     7  
     8  	"code.cloudfoundry.org/cli/actor/sharedaction"
     9  	"code.cloudfoundry.org/cli/actor/v7action"
    10  	v7 "code.cloudfoundry.org/cli/command/v7"
    11  )
    12  
    13  type FakeLogsActor struct {
    14  	GetRecentLogsForApplicationByNameAndSpaceStub        func(string, string, sharedaction.LogCacheClient) ([]sharedaction.LogMessage, v7action.Warnings, error)
    15  	getRecentLogsForApplicationByNameAndSpaceMutex       sync.RWMutex
    16  	getRecentLogsForApplicationByNameAndSpaceArgsForCall []struct {
    17  		arg1 string
    18  		arg2 string
    19  		arg3 sharedaction.LogCacheClient
    20  	}
    21  	getRecentLogsForApplicationByNameAndSpaceReturns struct {
    22  		result1 []sharedaction.LogMessage
    23  		result2 v7action.Warnings
    24  		result3 error
    25  	}
    26  	getRecentLogsForApplicationByNameAndSpaceReturnsOnCall map[int]struct {
    27  		result1 []sharedaction.LogMessage
    28  		result2 v7action.Warnings
    29  		result3 error
    30  	}
    31  	GetStreamingLogsForApplicationByNameAndSpaceStub        func(string, string, sharedaction.LogCacheClient) (<-chan sharedaction.LogMessage, <-chan error, context.CancelFunc, v7action.Warnings, error)
    32  	getStreamingLogsForApplicationByNameAndSpaceMutex       sync.RWMutex
    33  	getStreamingLogsForApplicationByNameAndSpaceArgsForCall []struct {
    34  		arg1 string
    35  		arg2 string
    36  		arg3 sharedaction.LogCacheClient
    37  	}
    38  	getStreamingLogsForApplicationByNameAndSpaceReturns struct {
    39  		result1 <-chan sharedaction.LogMessage
    40  		result2 <-chan error
    41  		result3 context.CancelFunc
    42  		result4 v7action.Warnings
    43  		result5 error
    44  	}
    45  	getStreamingLogsForApplicationByNameAndSpaceReturnsOnCall map[int]struct {
    46  		result1 <-chan sharedaction.LogMessage
    47  		result2 <-chan error
    48  		result3 context.CancelFunc
    49  		result4 v7action.Warnings
    50  		result5 error
    51  	}
    52  	ScheduleTokenRefreshStub        func() (chan bool, error)
    53  	scheduleTokenRefreshMutex       sync.RWMutex
    54  	scheduleTokenRefreshArgsForCall []struct {
    55  	}
    56  	scheduleTokenRefreshReturns struct {
    57  		result1 chan bool
    58  		result2 error
    59  	}
    60  	scheduleTokenRefreshReturnsOnCall map[int]struct {
    61  		result1 chan bool
    62  		result2 error
    63  	}
    64  	invocations      map[string][][]interface{}
    65  	invocationsMutex sync.RWMutex
    66  }
    67  
    68  func (fake *FakeLogsActor) GetRecentLogsForApplicationByNameAndSpace(arg1 string, arg2 string, arg3 sharedaction.LogCacheClient) ([]sharedaction.LogMessage, v7action.Warnings, error) {
    69  	fake.getRecentLogsForApplicationByNameAndSpaceMutex.Lock()
    70  	ret, specificReturn := fake.getRecentLogsForApplicationByNameAndSpaceReturnsOnCall[len(fake.getRecentLogsForApplicationByNameAndSpaceArgsForCall)]
    71  	fake.getRecentLogsForApplicationByNameAndSpaceArgsForCall = append(fake.getRecentLogsForApplicationByNameAndSpaceArgsForCall, struct {
    72  		arg1 string
    73  		arg2 string
    74  		arg3 sharedaction.LogCacheClient
    75  	}{arg1, arg2, arg3})
    76  	fake.recordInvocation("GetRecentLogsForApplicationByNameAndSpace", []interface{}{arg1, arg2, arg3})
    77  	fake.getRecentLogsForApplicationByNameAndSpaceMutex.Unlock()
    78  	if fake.GetRecentLogsForApplicationByNameAndSpaceStub != nil {
    79  		return fake.GetRecentLogsForApplicationByNameAndSpaceStub(arg1, arg2, arg3)
    80  	}
    81  	if specificReturn {
    82  		return ret.result1, ret.result2, ret.result3
    83  	}
    84  	fakeReturns := fake.getRecentLogsForApplicationByNameAndSpaceReturns
    85  	return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3
    86  }
    87  
    88  func (fake *FakeLogsActor) GetRecentLogsForApplicationByNameAndSpaceCallCount() int {
    89  	fake.getRecentLogsForApplicationByNameAndSpaceMutex.RLock()
    90  	defer fake.getRecentLogsForApplicationByNameAndSpaceMutex.RUnlock()
    91  	return len(fake.getRecentLogsForApplicationByNameAndSpaceArgsForCall)
    92  }
    93  
    94  func (fake *FakeLogsActor) GetRecentLogsForApplicationByNameAndSpaceCalls(stub func(string, string, sharedaction.LogCacheClient) ([]sharedaction.LogMessage, v7action.Warnings, error)) {
    95  	fake.getRecentLogsForApplicationByNameAndSpaceMutex.Lock()
    96  	defer fake.getRecentLogsForApplicationByNameAndSpaceMutex.Unlock()
    97  	fake.GetRecentLogsForApplicationByNameAndSpaceStub = stub
    98  }
    99  
   100  func (fake *FakeLogsActor) GetRecentLogsForApplicationByNameAndSpaceArgsForCall(i int) (string, string, sharedaction.LogCacheClient) {
   101  	fake.getRecentLogsForApplicationByNameAndSpaceMutex.RLock()
   102  	defer fake.getRecentLogsForApplicationByNameAndSpaceMutex.RUnlock()
   103  	argsForCall := fake.getRecentLogsForApplicationByNameAndSpaceArgsForCall[i]
   104  	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
   105  }
   106  
   107  func (fake *FakeLogsActor) GetRecentLogsForApplicationByNameAndSpaceReturns(result1 []sharedaction.LogMessage, result2 v7action.Warnings, result3 error) {
   108  	fake.getRecentLogsForApplicationByNameAndSpaceMutex.Lock()
   109  	defer fake.getRecentLogsForApplicationByNameAndSpaceMutex.Unlock()
   110  	fake.GetRecentLogsForApplicationByNameAndSpaceStub = nil
   111  	fake.getRecentLogsForApplicationByNameAndSpaceReturns = struct {
   112  		result1 []sharedaction.LogMessage
   113  		result2 v7action.Warnings
   114  		result3 error
   115  	}{result1, result2, result3}
   116  }
   117  
   118  func (fake *FakeLogsActor) GetRecentLogsForApplicationByNameAndSpaceReturnsOnCall(i int, result1 []sharedaction.LogMessage, result2 v7action.Warnings, result3 error) {
   119  	fake.getRecentLogsForApplicationByNameAndSpaceMutex.Lock()
   120  	defer fake.getRecentLogsForApplicationByNameAndSpaceMutex.Unlock()
   121  	fake.GetRecentLogsForApplicationByNameAndSpaceStub = nil
   122  	if fake.getRecentLogsForApplicationByNameAndSpaceReturnsOnCall == nil {
   123  		fake.getRecentLogsForApplicationByNameAndSpaceReturnsOnCall = make(map[int]struct {
   124  			result1 []sharedaction.LogMessage
   125  			result2 v7action.Warnings
   126  			result3 error
   127  		})
   128  	}
   129  	fake.getRecentLogsForApplicationByNameAndSpaceReturnsOnCall[i] = struct {
   130  		result1 []sharedaction.LogMessage
   131  		result2 v7action.Warnings
   132  		result3 error
   133  	}{result1, result2, result3}
   134  }
   135  
   136  func (fake *FakeLogsActor) GetStreamingLogsForApplicationByNameAndSpace(arg1 string, arg2 string, arg3 sharedaction.LogCacheClient) (<-chan sharedaction.LogMessage, <-chan error, context.CancelFunc, v7action.Warnings, error) {
   137  	fake.getStreamingLogsForApplicationByNameAndSpaceMutex.Lock()
   138  	ret, specificReturn := fake.getStreamingLogsForApplicationByNameAndSpaceReturnsOnCall[len(fake.getStreamingLogsForApplicationByNameAndSpaceArgsForCall)]
   139  	fake.getStreamingLogsForApplicationByNameAndSpaceArgsForCall = append(fake.getStreamingLogsForApplicationByNameAndSpaceArgsForCall, struct {
   140  		arg1 string
   141  		arg2 string
   142  		arg3 sharedaction.LogCacheClient
   143  	}{arg1, arg2, arg3})
   144  	fake.recordInvocation("GetStreamingLogsForApplicationByNameAndSpace", []interface{}{arg1, arg2, arg3})
   145  	fake.getStreamingLogsForApplicationByNameAndSpaceMutex.Unlock()
   146  	if fake.GetStreamingLogsForApplicationByNameAndSpaceStub != nil {
   147  		return fake.GetStreamingLogsForApplicationByNameAndSpaceStub(arg1, arg2, arg3)
   148  	}
   149  	if specificReturn {
   150  		return ret.result1, ret.result2, ret.result3, ret.result4, ret.result5
   151  	}
   152  	fakeReturns := fake.getStreamingLogsForApplicationByNameAndSpaceReturns
   153  	return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3, fakeReturns.result4, fakeReturns.result5
   154  }
   155  
   156  func (fake *FakeLogsActor) GetStreamingLogsForApplicationByNameAndSpaceCallCount() int {
   157  	fake.getStreamingLogsForApplicationByNameAndSpaceMutex.RLock()
   158  	defer fake.getStreamingLogsForApplicationByNameAndSpaceMutex.RUnlock()
   159  	return len(fake.getStreamingLogsForApplicationByNameAndSpaceArgsForCall)
   160  }
   161  
   162  func (fake *FakeLogsActor) GetStreamingLogsForApplicationByNameAndSpaceCalls(stub func(string, string, sharedaction.LogCacheClient) (<-chan sharedaction.LogMessage, <-chan error, context.CancelFunc, v7action.Warnings, error)) {
   163  	fake.getStreamingLogsForApplicationByNameAndSpaceMutex.Lock()
   164  	defer fake.getStreamingLogsForApplicationByNameAndSpaceMutex.Unlock()
   165  	fake.GetStreamingLogsForApplicationByNameAndSpaceStub = stub
   166  }
   167  
   168  func (fake *FakeLogsActor) GetStreamingLogsForApplicationByNameAndSpaceArgsForCall(i int) (string, string, sharedaction.LogCacheClient) {
   169  	fake.getStreamingLogsForApplicationByNameAndSpaceMutex.RLock()
   170  	defer fake.getStreamingLogsForApplicationByNameAndSpaceMutex.RUnlock()
   171  	argsForCall := fake.getStreamingLogsForApplicationByNameAndSpaceArgsForCall[i]
   172  	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
   173  }
   174  
   175  func (fake *FakeLogsActor) GetStreamingLogsForApplicationByNameAndSpaceReturns(result1 <-chan sharedaction.LogMessage, result2 <-chan error, result3 context.CancelFunc, result4 v7action.Warnings, result5 error) {
   176  	fake.getStreamingLogsForApplicationByNameAndSpaceMutex.Lock()
   177  	defer fake.getStreamingLogsForApplicationByNameAndSpaceMutex.Unlock()
   178  	fake.GetStreamingLogsForApplicationByNameAndSpaceStub = nil
   179  	fake.getStreamingLogsForApplicationByNameAndSpaceReturns = struct {
   180  		result1 <-chan sharedaction.LogMessage
   181  		result2 <-chan error
   182  		result3 context.CancelFunc
   183  		result4 v7action.Warnings
   184  		result5 error
   185  	}{result1, result2, result3, result4, result5}
   186  }
   187  
   188  func (fake *FakeLogsActor) GetStreamingLogsForApplicationByNameAndSpaceReturnsOnCall(i int, result1 <-chan sharedaction.LogMessage, result2 <-chan error, result3 context.CancelFunc, result4 v7action.Warnings, result5 error) {
   189  	fake.getStreamingLogsForApplicationByNameAndSpaceMutex.Lock()
   190  	defer fake.getStreamingLogsForApplicationByNameAndSpaceMutex.Unlock()
   191  	fake.GetStreamingLogsForApplicationByNameAndSpaceStub = nil
   192  	if fake.getStreamingLogsForApplicationByNameAndSpaceReturnsOnCall == nil {
   193  		fake.getStreamingLogsForApplicationByNameAndSpaceReturnsOnCall = make(map[int]struct {
   194  			result1 <-chan sharedaction.LogMessage
   195  			result2 <-chan error
   196  			result3 context.CancelFunc
   197  			result4 v7action.Warnings
   198  			result5 error
   199  		})
   200  	}
   201  	fake.getStreamingLogsForApplicationByNameAndSpaceReturnsOnCall[i] = struct {
   202  		result1 <-chan sharedaction.LogMessage
   203  		result2 <-chan error
   204  		result3 context.CancelFunc
   205  		result4 v7action.Warnings
   206  		result5 error
   207  	}{result1, result2, result3, result4, result5}
   208  }
   209  
   210  func (fake *FakeLogsActor) ScheduleTokenRefresh() (chan bool, error) {
   211  	fake.scheduleTokenRefreshMutex.Lock()
   212  	ret, specificReturn := fake.scheduleTokenRefreshReturnsOnCall[len(fake.scheduleTokenRefreshArgsForCall)]
   213  	fake.scheduleTokenRefreshArgsForCall = append(fake.scheduleTokenRefreshArgsForCall, struct {
   214  	}{})
   215  	fake.recordInvocation("ScheduleTokenRefresh", []interface{}{})
   216  	fake.scheduleTokenRefreshMutex.Unlock()
   217  	if fake.ScheduleTokenRefreshStub != nil {
   218  		return fake.ScheduleTokenRefreshStub()
   219  	}
   220  	if specificReturn {
   221  		return ret.result1, ret.result2
   222  	}
   223  	fakeReturns := fake.scheduleTokenRefreshReturns
   224  	return fakeReturns.result1, fakeReturns.result2
   225  }
   226  
   227  func (fake *FakeLogsActor) ScheduleTokenRefreshCallCount() int {
   228  	fake.scheduleTokenRefreshMutex.RLock()
   229  	defer fake.scheduleTokenRefreshMutex.RUnlock()
   230  	return len(fake.scheduleTokenRefreshArgsForCall)
   231  }
   232  
   233  func (fake *FakeLogsActor) ScheduleTokenRefreshCalls(stub func() (chan bool, error)) {
   234  	fake.scheduleTokenRefreshMutex.Lock()
   235  	defer fake.scheduleTokenRefreshMutex.Unlock()
   236  	fake.ScheduleTokenRefreshStub = stub
   237  }
   238  
   239  func (fake *FakeLogsActor) ScheduleTokenRefreshReturns(result1 chan bool, result2 error) {
   240  	fake.scheduleTokenRefreshMutex.Lock()
   241  	defer fake.scheduleTokenRefreshMutex.Unlock()
   242  	fake.ScheduleTokenRefreshStub = nil
   243  	fake.scheduleTokenRefreshReturns = struct {
   244  		result1 chan bool
   245  		result2 error
   246  	}{result1, result2}
   247  }
   248  
   249  func (fake *FakeLogsActor) ScheduleTokenRefreshReturnsOnCall(i int, result1 chan bool, result2 error) {
   250  	fake.scheduleTokenRefreshMutex.Lock()
   251  	defer fake.scheduleTokenRefreshMutex.Unlock()
   252  	fake.ScheduleTokenRefreshStub = nil
   253  	if fake.scheduleTokenRefreshReturnsOnCall == nil {
   254  		fake.scheduleTokenRefreshReturnsOnCall = make(map[int]struct {
   255  			result1 chan bool
   256  			result2 error
   257  		})
   258  	}
   259  	fake.scheduleTokenRefreshReturnsOnCall[i] = struct {
   260  		result1 chan bool
   261  		result2 error
   262  	}{result1, result2}
   263  }
   264  
   265  func (fake *FakeLogsActor) Invocations() map[string][][]interface{} {
   266  	fake.invocationsMutex.RLock()
   267  	defer fake.invocationsMutex.RUnlock()
   268  	fake.getRecentLogsForApplicationByNameAndSpaceMutex.RLock()
   269  	defer fake.getRecentLogsForApplicationByNameAndSpaceMutex.RUnlock()
   270  	fake.getStreamingLogsForApplicationByNameAndSpaceMutex.RLock()
   271  	defer fake.getStreamingLogsForApplicationByNameAndSpaceMutex.RUnlock()
   272  	fake.scheduleTokenRefreshMutex.RLock()
   273  	defer fake.scheduleTokenRefreshMutex.RUnlock()
   274  	copiedInvocations := map[string][][]interface{}{}
   275  	for key, value := range fake.invocations {
   276  		copiedInvocations[key] = value
   277  	}
   278  	return copiedInvocations
   279  }
   280  
   281  func (fake *FakeLogsActor) recordInvocation(key string, args []interface{}) {
   282  	fake.invocationsMutex.Lock()
   283  	defer fake.invocationsMutex.Unlock()
   284  	if fake.invocations == nil {
   285  		fake.invocations = map[string][][]interface{}{}
   286  	}
   287  	if fake.invocations[key] == nil {
   288  		fake.invocations[key] = [][]interface{}{}
   289  	}
   290  	fake.invocations[key] = append(fake.invocations[key], args)
   291  }
   292  
   293  var _ v7.LogsActor = new(FakeLogsActor)