github.com/loggregator/cli@v6.33.1-0.20180224010324-82334f081791+incompatible/cf/api/appevents/appeventsfakes/fake_app_events_repository.go (about)

     1  // This file was generated by counterfeiter
     2  package appeventsfakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"code.cloudfoundry.org/cli/cf/api/appevents"
     8  	"code.cloudfoundry.org/cli/cf/models"
     9  )
    10  
    11  type FakeAppEventsRepository struct {
    12  	RecentEventsStub        func(appGUID string, limit int64) ([]models.EventFields, error)
    13  	recentEventsMutex       sync.RWMutex
    14  	recentEventsArgsForCall []struct {
    15  		appGUID string
    16  		limit   int64
    17  	}
    18  	recentEventsReturns struct {
    19  		result1 []models.EventFields
    20  		result2 error
    21  	}
    22  }
    23  
    24  func (fake *FakeAppEventsRepository) RecentEvents(appGUID string, limit int64) ([]models.EventFields, error) {
    25  	fake.recentEventsMutex.Lock()
    26  	fake.recentEventsArgsForCall = append(fake.recentEventsArgsForCall, struct {
    27  		appGUID string
    28  		limit   int64
    29  	}{appGUID, limit})
    30  	fake.recentEventsMutex.Unlock()
    31  	if fake.RecentEventsStub != nil {
    32  		return fake.RecentEventsStub(appGUID, limit)
    33  	} else {
    34  		return fake.recentEventsReturns.result1, fake.recentEventsReturns.result2
    35  	}
    36  }
    37  
    38  func (fake *FakeAppEventsRepository) RecentEventsCallCount() int {
    39  	fake.recentEventsMutex.RLock()
    40  	defer fake.recentEventsMutex.RUnlock()
    41  	return len(fake.recentEventsArgsForCall)
    42  }
    43  
    44  func (fake *FakeAppEventsRepository) RecentEventsArgsForCall(i int) (string, int64) {
    45  	fake.recentEventsMutex.RLock()
    46  	defer fake.recentEventsMutex.RUnlock()
    47  	return fake.recentEventsArgsForCall[i].appGUID, fake.recentEventsArgsForCall[i].limit
    48  }
    49  
    50  func (fake *FakeAppEventsRepository) RecentEventsReturns(result1 []models.EventFields, result2 error) {
    51  	fake.RecentEventsStub = nil
    52  	fake.recentEventsReturns = struct {
    53  		result1 []models.EventFields
    54  		result2 error
    55  	}{result1, result2}
    56  }
    57  
    58  var _ appevents.Repository = new(FakeAppEventsRepository)