-
Notifications
You must be signed in to change notification settings - Fork 927
/
fake_service_summary_repository.go
69 lines (60 loc) · 2.39 KB
/
fake_service_summary_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
59
60
61
62
63
64
65
66
67
68
69
// This file was generated by counterfeiter
package apifakes
import (
"sync"
"code.cloudfoundry.org/cli/cf/api"
"code.cloudfoundry.org/cli/cf/models"
)
type FakeServiceSummaryRepository struct {
GetSummariesInCurrentSpaceStub func() ([]models.ServiceInstance, error)
getSummariesInCurrentSpaceMutex sync.RWMutex
getSummariesInCurrentSpaceArgsForCall []struct{}
getSummariesInCurrentSpaceReturns struct {
result1 []models.ServiceInstance
result2 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeServiceSummaryRepository) GetSummariesInCurrentSpace() ([]models.ServiceInstance, error) {
fake.getSummariesInCurrentSpaceMutex.Lock()
fake.getSummariesInCurrentSpaceArgsForCall = append(fake.getSummariesInCurrentSpaceArgsForCall, struct{}{})
fake.recordInvocation("GetSummariesInCurrentSpace", []interface{}{})
fake.getSummariesInCurrentSpaceMutex.Unlock()
if fake.GetSummariesInCurrentSpaceStub != nil {
return fake.GetSummariesInCurrentSpaceStub()
} else {
return fake.getSummariesInCurrentSpaceReturns.result1, fake.getSummariesInCurrentSpaceReturns.result2
}
}
func (fake *FakeServiceSummaryRepository) GetSummariesInCurrentSpaceCallCount() int {
fake.getSummariesInCurrentSpaceMutex.RLock()
defer fake.getSummariesInCurrentSpaceMutex.RUnlock()
return len(fake.getSummariesInCurrentSpaceArgsForCall)
}
func (fake *FakeServiceSummaryRepository) GetSummariesInCurrentSpaceReturns(result1 []models.ServiceInstance, result2 error) {
fake.GetSummariesInCurrentSpaceStub = nil
fake.getSummariesInCurrentSpaceReturns = struct {
result1 []models.ServiceInstance
result2 error
}{result1, result2}
}
func (fake *FakeServiceSummaryRepository) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.getSummariesInCurrentSpaceMutex.RLock()
defer fake.getSummariesInCurrentSpaceMutex.RUnlock()
return fake.invocations
}
func (fake *FakeServiceSummaryRepository) recordInvocation(key string, args []interface{}) {
fake.invocationsMutex.Lock()
defer fake.invocationsMutex.Unlock()
if fake.invocations == nil {
fake.invocations = map[string][][]interface{}{}
}
if fake.invocations[key] == nil {
fake.invocations[key] = [][]interface{}{}
}
fake.invocations[key] = append(fake.invocations[key], args)
}
var _ api.ServiceSummaryRepository = new(FakeServiceSummaryRepository)