@@ -11,6 +11,7 @@ import (
11
11
"golang.org/x/xerrors"
12
12
13
13
"github.com/coder/coder/v2/coderd/database/dbmock"
14
+ "github.com/coder/coder/v2/coderd/database/pubsub/psmock"
14
15
)
15
16
16
17
func TestNotifier_FetchHelpers (t * testing.T ) {
@@ -21,9 +22,11 @@ func TestNotifier_FetchHelpers(t *testing.T) {
21
22
22
23
ctrl := gomock .NewController (t )
23
24
dbmock := dbmock .NewMockStore (ctrl )
25
+ psmock := psmock .NewMockPubsub (ctrl )
24
26
25
27
n := & notifier {
26
28
store : dbmock ,
29
+ ps : psmock ,
27
30
helpers : template.FuncMap {},
28
31
}
29
32
@@ -48,9 +51,11 @@ func TestNotifier_FetchHelpers(t *testing.T) {
48
51
49
52
ctrl := gomock .NewController (t )
50
53
dbmock := dbmock .NewMockStore (ctrl )
54
+ psmock := psmock .NewMockPubsub (ctrl )
51
55
52
56
n := & notifier {
53
57
store : dbmock ,
58
+ ps : psmock ,
54
59
helpers : template.FuncMap {},
55
60
}
56
61
@@ -67,9 +72,11 @@ func TestNotifier_FetchHelpers(t *testing.T) {
67
72
68
73
ctrl := gomock .NewController (t )
69
74
dbmock := dbmock .NewMockStore (ctrl )
75
+ psmock := psmock .NewMockPubsub (ctrl )
70
76
71
77
n := & notifier {
72
78
store : dbmock ,
79
+ ps : psmock ,
73
80
helpers : template.FuncMap {},
74
81
}
75
82
@@ -90,9 +97,11 @@ func TestNotifier_FetchAppName(t *testing.T) {
90
97
91
98
ctrl := gomock .NewController (t )
92
99
dbmock := dbmock .NewMockStore (ctrl )
100
+ psmock := psmock .NewMockPubsub (ctrl )
93
101
94
102
n := & notifier {
95
103
store : dbmock ,
104
+ ps : psmock ,
96
105
}
97
106
98
107
dbmock .EXPECT ().GetApplicationName (gomock .Any ()).Return ("ACME Inc." , nil )
@@ -107,9 +116,11 @@ func TestNotifier_FetchAppName(t *testing.T) {
107
116
t .Parallel ()
108
117
ctrl := gomock .NewController (t )
109
118
dbmock := dbmock .NewMockStore (ctrl )
119
+ psmock := psmock .NewMockPubsub (ctrl )
110
120
111
121
n := & notifier {
112
122
store : dbmock ,
123
+ ps : psmock ,
113
124
}
114
125
115
126
dbmock .EXPECT ().GetApplicationName (gomock .Any ()).Return ("" , sql .ErrNoRows )
@@ -125,9 +136,11 @@ func TestNotifier_FetchAppName(t *testing.T) {
125
136
126
137
ctrl := gomock .NewController (t )
127
138
dbmock := dbmock .NewMockStore (ctrl )
139
+ psmock := psmock .NewMockPubsub (ctrl )
128
140
129
141
n := & notifier {
130
142
store : dbmock ,
143
+ ps : psmock ,
131
144
}
132
145
133
146
dbmock .EXPECT ().GetApplicationName (gomock .Any ()).Return ("" , nil )
@@ -143,9 +156,11 @@ func TestNotifier_FetchAppName(t *testing.T) {
143
156
144
157
ctrl := gomock .NewController (t )
145
158
dbmock := dbmock .NewMockStore (ctrl )
159
+ psmock := psmock .NewMockPubsub (ctrl )
146
160
147
161
n := & notifier {
148
162
store : dbmock ,
163
+ ps : psmock ,
149
164
}
150
165
151
166
dbmock .EXPECT ().GetApplicationName (gomock .Any ()).Return ("" , xerrors .New ("internal error" ))
@@ -164,9 +179,11 @@ func TestNotifier_FetchLogoURL(t *testing.T) {
164
179
165
180
ctrl := gomock .NewController (t )
166
181
dbmock := dbmock .NewMockStore (ctrl )
182
+ psmock := psmock .NewMockPubsub (ctrl )
167
183
168
184
n := & notifier {
169
185
store : dbmock ,
186
+ ps : psmock ,
170
187
}
171
188
172
189
dbmock .EXPECT ().GetLogoURL (gomock .Any ()).Return ("https://example.com/logo.png" , nil )
@@ -181,9 +198,11 @@ func TestNotifier_FetchLogoURL(t *testing.T) {
181
198
t .Parallel ()
182
199
ctrl := gomock .NewController (t )
183
200
dbmock := dbmock .NewMockStore (ctrl )
201
+ psmock := psmock .NewMockPubsub (ctrl )
184
202
185
203
n := & notifier {
186
204
store : dbmock ,
205
+ ps : psmock ,
187
206
}
188
207
189
208
dbmock .EXPECT ().GetLogoURL (gomock .Any ()).Return ("" , sql .ErrNoRows )
@@ -199,9 +218,11 @@ func TestNotifier_FetchLogoURL(t *testing.T) {
199
218
200
219
ctrl := gomock .NewController (t )
201
220
dbmock := dbmock .NewMockStore (ctrl )
221
+ psmock := psmock .NewMockPubsub (ctrl )
202
222
203
223
n := & notifier {
204
224
store : dbmock ,
225
+ ps : psmock ,
205
226
}
206
227
207
228
dbmock .EXPECT ().GetLogoURL (gomock .Any ()).Return ("" , nil )
@@ -217,9 +238,11 @@ func TestNotifier_FetchLogoURL(t *testing.T) {
217
238
218
239
ctrl := gomock .NewController (t )
219
240
dbmock := dbmock .NewMockStore (ctrl )
241
+ psmock := psmock .NewMockPubsub (ctrl )
220
242
221
243
n := & notifier {
222
244
store : dbmock ,
245
+ ps : psmock ,
223
246
}
224
247
225
248
dbmock .EXPECT ().GetLogoURL (gomock .Any ()).Return ("" , xerrors .New ("internal error" ))
0 commit comments