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