-
Notifications
You must be signed in to change notification settings - Fork 35
/
FeatureFlagFetcher.go
130 lines (104 loc) · 4.71 KB
/
FeatureFlagFetcher.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
// Code generated by mockery. DO NOT EDIT.
package mocks
import (
context "context"
appcontext "github.com/transcom/mymove/pkg/appcontext"
mock "github.com/stretchr/testify/mock"
services "github.com/transcom/mymove/pkg/services"
zap "go.uber.org/zap"
)
// FeatureFlagFetcher is an autogenerated mock type for the FeatureFlagFetcher type
type FeatureFlagFetcher struct {
mock.Mock
}
// GetBooleanFlag provides a mock function with given fields: ctx, logger, entityID, key, flagContext
func (_m *FeatureFlagFetcher) GetBooleanFlag(ctx context.Context, logger *zap.Logger, entityID string, key string, flagContext map[string]string) (services.FeatureFlag, error) {
ret := _m.Called(ctx, logger, entityID, key, flagContext)
var r0 services.FeatureFlag
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *zap.Logger, string, string, map[string]string) (services.FeatureFlag, error)); ok {
return rf(ctx, logger, entityID, key, flagContext)
}
if rf, ok := ret.Get(0).(func(context.Context, *zap.Logger, string, string, map[string]string) services.FeatureFlag); ok {
r0 = rf(ctx, logger, entityID, key, flagContext)
} else {
r0 = ret.Get(0).(services.FeatureFlag)
}
if rf, ok := ret.Get(1).(func(context.Context, *zap.Logger, string, string, map[string]string) error); ok {
r1 = rf(ctx, logger, entityID, key, flagContext)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetBooleanFlagForUser provides a mock function with given fields: ctx, appCtx, key, flagContext
func (_m *FeatureFlagFetcher) GetBooleanFlagForUser(ctx context.Context, appCtx appcontext.AppContext, key string, flagContext map[string]string) (services.FeatureFlag, error) {
ret := _m.Called(ctx, appCtx, key, flagContext)
var r0 services.FeatureFlag
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, appcontext.AppContext, string, map[string]string) (services.FeatureFlag, error)); ok {
return rf(ctx, appCtx, key, flagContext)
}
if rf, ok := ret.Get(0).(func(context.Context, appcontext.AppContext, string, map[string]string) services.FeatureFlag); ok {
r0 = rf(ctx, appCtx, key, flagContext)
} else {
r0 = ret.Get(0).(services.FeatureFlag)
}
if rf, ok := ret.Get(1).(func(context.Context, appcontext.AppContext, string, map[string]string) error); ok {
r1 = rf(ctx, appCtx, key, flagContext)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetVariantFlag provides a mock function with given fields: ctx, logger, entityID, key, flagContext
func (_m *FeatureFlagFetcher) GetVariantFlag(ctx context.Context, logger *zap.Logger, entityID string, key string, flagContext map[string]string) (services.FeatureFlag, error) {
ret := _m.Called(ctx, logger, entityID, key, flagContext)
var r0 services.FeatureFlag
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *zap.Logger, string, string, map[string]string) (services.FeatureFlag, error)); ok {
return rf(ctx, logger, entityID, key, flagContext)
}
if rf, ok := ret.Get(0).(func(context.Context, *zap.Logger, string, string, map[string]string) services.FeatureFlag); ok {
r0 = rf(ctx, logger, entityID, key, flagContext)
} else {
r0 = ret.Get(0).(services.FeatureFlag)
}
if rf, ok := ret.Get(1).(func(context.Context, *zap.Logger, string, string, map[string]string) error); ok {
r1 = rf(ctx, logger, entityID, key, flagContext)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetVariantFlagForUser provides a mock function with given fields: ctx, appCtx, key, flagContext
func (_m *FeatureFlagFetcher) GetVariantFlagForUser(ctx context.Context, appCtx appcontext.AppContext, key string, flagContext map[string]string) (services.FeatureFlag, error) {
ret := _m.Called(ctx, appCtx, key, flagContext)
var r0 services.FeatureFlag
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, appcontext.AppContext, string, map[string]string) (services.FeatureFlag, error)); ok {
return rf(ctx, appCtx, key, flagContext)
}
if rf, ok := ret.Get(0).(func(context.Context, appcontext.AppContext, string, map[string]string) services.FeatureFlag); ok {
r0 = rf(ctx, appCtx, key, flagContext)
} else {
r0 = ret.Get(0).(services.FeatureFlag)
}
if rf, ok := ret.Get(1).(func(context.Context, appcontext.AppContext, string, map[string]string) error); ok {
r1 = rf(ctx, appCtx, key, flagContext)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// NewFeatureFlagFetcher creates a new instance of FeatureFlagFetcher. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewFeatureFlagFetcher(t interface {
mock.TestingT
Cleanup(func())
}) *FeatureFlagFetcher {
mock := &FeatureFlagFetcher{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}