/
context_mock.go
88 lines (70 loc) · 2.03 KB
/
context_mock.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
package context
import (
"github.com/Apicurio/apicurio-registry-operator/controllers/client"
c "github.com/Apicurio/apicurio-registry-operator/controllers/common"
"github.com/Apicurio/apicurio-registry-operator/controllers/svc/env"
"github.com/Apicurio/apicurio-registry-operator/controllers/svc/resources"
"go.uber.org/zap"
"time"
)
var _ LoopContext = &LoopContextMock{}
type LoopContextMock struct {
appName c.Name
appNamespace c.Namespace
log *zap.Logger
resourceCache resources.ResourceCache
envCache env.EnvCache
attempts int
}
func NewLoopContextMock() *LoopContextMock {
res := &LoopContextMock{
appName: c.Name("mock"),
appNamespace: c.Namespace("mock"),
}
res.log = c.GetRootLogger(true)
res.resourceCache = resources.NewResourceCache()
res.envCache = env.NewEnvCache(res.log)
return res
}
func (this *LoopContextMock) GetLog() *zap.Logger {
return this.log
}
func (this *LoopContextMock) GetAppName() c.Name {
return this.appName
}
func (this *LoopContextMock) GetAppNamespace() c.Namespace {
return this.appNamespace
}
func (this *LoopContextMock) SetRequeueNow() {
panic("Not implemented")
}
func (this *LoopContextMock) SetRequeueDelaySoon() {
panic("Not implemented")
}
func (this *LoopContextMock) SetRequeueDelaySec(delay uint) {
panic("Not implemented")
}
func (this *LoopContextMock) GetAndResetRequeue() (bool, time.Duration) {
panic("Not implemented")
}
func (this *LoopContextMock) GetResourceCache() resources.ResourceCache {
return this.resourceCache
}
func (this *LoopContextMock) GetClients() *client.Clients {
panic("Not implemented")
}
func (this *LoopContextMock) GetEnvCache() env.EnvCache {
return this.envCache
}
func (this *LoopContextMock) SetAttempts(attempts int) {
this.attempts = attempts
}
func (this *LoopContextMock) GetAttempts() int {
return this.attempts
}
func (this *LoopContextMock) GetTestingSupport() *c.TestSupport {
panic("Not implemented")
}
func (this *LoopContextMock) GetSupportedFeatures() *c.SupportedFeatures {
panic("Not implemented")
}