forked from cloudfoundry/gorouter
/
fake_validator.go
97 lines (85 loc) · 2.84 KB
/
fake_validator.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
// This file was generated by counterfeiter
package fakes
import (
"sync"
"github.com/cloudfoundry-incubator/routing-api"
"github.com/cloudfoundry-incubator/routing-api/db"
"github.com/cloudfoundry-incubator/routing-api/handlers"
)
type FakeRouteValidator struct {
ValidateCreateStub func(routes []db.Route, maxTTL int) *routing_api.Error
validateCreateMutex sync.RWMutex
validateCreateArgsForCall []struct {
routes []db.Route
maxTTL int
}
validateCreateReturns struct {
result1 *routing_api.Error
}
ValidateDeleteStub func(routes []db.Route) *routing_api.Error
validateDeleteMutex sync.RWMutex
validateDeleteArgsForCall []struct {
routes []db.Route
}
validateDeleteReturns struct {
result1 *routing_api.Error
}
}
func (fake *FakeRouteValidator) ValidateCreate(routes []db.Route, maxTTL int) *routing_api.Error {
fake.validateCreateMutex.Lock()
fake.validateCreateArgsForCall = append(fake.validateCreateArgsForCall, struct {
routes []db.Route
maxTTL int
}{routes, maxTTL})
fake.validateCreateMutex.Unlock()
if fake.ValidateCreateStub != nil {
return fake.ValidateCreateStub(routes, maxTTL)
} else {
return fake.validateCreateReturns.result1
}
}
func (fake *FakeRouteValidator) ValidateCreateCallCount() int {
fake.validateCreateMutex.RLock()
defer fake.validateCreateMutex.RUnlock()
return len(fake.validateCreateArgsForCall)
}
func (fake *FakeRouteValidator) ValidateCreateArgsForCall(i int) ([]db.Route, int) {
fake.validateCreateMutex.RLock()
defer fake.validateCreateMutex.RUnlock()
return fake.validateCreateArgsForCall[i].routes, fake.validateCreateArgsForCall[i].maxTTL
}
func (fake *FakeRouteValidator) ValidateCreateReturns(result1 *routing_api.Error) {
fake.ValidateCreateStub = nil
fake.validateCreateReturns = struct {
result1 *routing_api.Error
}{result1}
}
func (fake *FakeRouteValidator) ValidateDelete(routes []db.Route) *routing_api.Error {
fake.validateDeleteMutex.Lock()
fake.validateDeleteArgsForCall = append(fake.validateDeleteArgsForCall, struct {
routes []db.Route
}{routes})
fake.validateDeleteMutex.Unlock()
if fake.ValidateDeleteStub != nil {
return fake.ValidateDeleteStub(routes)
} else {
return fake.validateDeleteReturns.result1
}
}
func (fake *FakeRouteValidator) ValidateDeleteCallCount() int {
fake.validateDeleteMutex.RLock()
defer fake.validateDeleteMutex.RUnlock()
return len(fake.validateDeleteArgsForCall)
}
func (fake *FakeRouteValidator) ValidateDeleteArgsForCall(i int) []db.Route {
fake.validateDeleteMutex.RLock()
defer fake.validateDeleteMutex.RUnlock()
return fake.validateDeleteArgsForCall[i].routes
}
func (fake *FakeRouteValidator) ValidateDeleteReturns(result1 *routing_api.Error) {
fake.ValidateDeleteStub = nil
fake.validateDeleteReturns = struct {
result1 *routing_api.Error
}{result1}
}
var _ handlers.RouteValidator = new(FakeRouteValidator)