@@ -16,8 +16,14 @@ func TestGetFloatingIP(t *testing.T) {
16
16
testEnv := testutils .SetupTestEnv ()
17
17
defer testEnv .TearDownTestEnv ()
18
18
testEnv .NewTestResellV2Client ()
19
- testutils .HandleReqWithoutBody (testEnv .Mux , "/resell/v2/floatingips/5232d5f3-4950-454b-bd41-78c5295622cd" ,
20
- TestGetFloatingIPResponseRaw , http .MethodGet , http .StatusOK , & endpointCalled , t )
19
+ testutils .HandleReqWithoutBody (t , & testutils.HandleReqOpts {
20
+ Mux : testEnv .Mux ,
21
+ URL : "/resell/v2/floatingips/5232d5f3-4950-454b-bd41-78c5295622cd" ,
22
+ RawResponse : TestGetFloatingIPResponseRaw ,
23
+ Method : http .MethodGet ,
24
+ Status : http .StatusOK ,
25
+ CallFlag : & endpointCalled ,
26
+ })
21
27
22
28
ctx := context .Background ()
23
29
actual , _ , err := floatingips .Get (ctx , testEnv .Client , "5232d5f3-4950-454b-bd41-78c5295622cd" )
@@ -41,9 +47,14 @@ func TestGetFloatingIPHTTPError(t *testing.T) {
41
47
testEnv := testutils .SetupTestEnv ()
42
48
defer testEnv .TearDownTestEnv ()
43
49
testEnv .NewTestResellV2Client ()
44
- testutils .HandleReqWithoutBody (testEnv .Mux , "/resell/v2/floatingips/5232d5f3-4950-454b-bd41-78c5295622cd" ,
45
- TestGetFloatingIPResponseRaw , http .MethodGet , http .StatusBadGateway ,
46
- & endpointCalled , t )
50
+ testutils .HandleReqWithoutBody (t , & testutils.HandleReqOpts {
51
+ Mux : testEnv .Mux ,
52
+ URL : "/resell/v2/floatingips/5232d5f3-4950-454b-bd41-78c5295622cd" ,
53
+ RawResponse : TestGetFloatingIPResponseRaw ,
54
+ Method : http .MethodGet ,
55
+ Status : http .StatusBadGateway ,
56
+ CallFlag : & endpointCalled ,
57
+ })
47
58
48
59
ctx := context .Background ()
49
60
floatingIP , httpResponse , err := floatingips .Get (ctx , testEnv .Client , "5232d5f3-4950-454b-bd41-78c5295622cd" )
@@ -86,9 +97,14 @@ func TestGetFloatingIPUnmarshalError(t *testing.T) {
86
97
testEnv := testutils .SetupTestEnv ()
87
98
defer testEnv .TearDownTestEnv ()
88
99
testEnv .NewTestResellV2Client ()
89
- testutils .HandleReqWithoutBody (testEnv .Mux , "/resell/v2/floatingips/5232d5f3-4950-454b-bd41-78c5295622cd" ,
90
- TestSingleFloatingIPInvalidResponseRaw , http .MethodGet , http .StatusOK ,
91
- & endpointCalled , t )
100
+ testutils .HandleReqWithoutBody (t , & testutils.HandleReqOpts {
101
+ Mux : testEnv .Mux ,
102
+ URL : "/resell/v2/floatingips/5232d5f3-4950-454b-bd41-78c5295622cd" ,
103
+ RawResponse : TestSingleFloatingIPInvalidResponseRaw ,
104
+ Method : http .MethodGet ,
105
+ Status : http .StatusOK ,
106
+ CallFlag : & endpointCalled ,
107
+ })
92
108
93
109
ctx := context .Background ()
94
110
floatingIP , _ , err := floatingips .Get (ctx , testEnv .Client , "5232d5f3-4950-454b-bd41-78c5295622cd" )
@@ -110,8 +126,14 @@ func TestListFloatingIPs(t *testing.T) {
110
126
testEnv := testutils .SetupTestEnv ()
111
127
defer testEnv .TearDownTestEnv ()
112
128
testEnv .NewTestResellV2Client ()
113
- testutils .HandleReqWithoutBody (testEnv .Mux , "/resell/v2/floatingips" ,
114
- TestListFloatingIPsResponseRaw , http .MethodGet , http .StatusOK , & endpointCalled , t )
129
+ testutils .HandleReqWithoutBody (t , & testutils.HandleReqOpts {
130
+ Mux : testEnv .Mux ,
131
+ URL : "/resell/v2/floatingips" ,
132
+ RawResponse : TestListFloatingIPsResponseRaw ,
133
+ Method : http .MethodGet ,
134
+ Status : http .StatusOK ,
135
+ CallFlag : & endpointCalled ,
136
+ })
115
137
116
138
ctx := context .Background ()
117
139
actual , _ , err := floatingips .List (ctx , testEnv .Client , floatingips.ListOpts {})
@@ -140,8 +162,14 @@ func TestListFloatingIPsSingle(t *testing.T) {
140
162
testEnv := testutils .SetupTestEnv ()
141
163
defer testEnv .TearDownTestEnv ()
142
164
testEnv .NewTestResellV2Client ()
143
- testutils .HandleReqWithoutBody (testEnv .Mux , "/resell/v2/floatingips" ,
144
- TestListFloatingIPsSingleResponseRaw , http .MethodGet , http .StatusOK , & endpointCalled , t )
165
+ testutils .HandleReqWithoutBody (t , & testutils.HandleReqOpts {
166
+ Mux : testEnv .Mux ,
167
+ URL : "/resell/v2/floatingips" ,
168
+ RawResponse : TestListFloatingIPsSingleResponseRaw ,
169
+ Method : http .MethodGet ,
170
+ Status : http .StatusOK ,
171
+ CallFlag : & endpointCalled ,
172
+ })
145
173
146
174
ctx := context .Background ()
147
175
actual , _ , err := floatingips .List (ctx , testEnv .Client , floatingips.ListOpts {})
@@ -165,9 +193,14 @@ func TestListFloatingIPsHTTPError(t *testing.T) {
165
193
testEnv := testutils .SetupTestEnv ()
166
194
defer testEnv .TearDownTestEnv ()
167
195
testEnv .NewTestResellV2Client ()
168
- testutils .HandleReqWithoutBody (testEnv .Mux , "/resell/v2/floatingips" ,
169
- TestListFloatingIPsResponseRaw , http .MethodGet , http .StatusBadGateway ,
170
- & endpointCalled , t )
196
+ testutils .HandleReqWithoutBody (t , & testutils.HandleReqOpts {
197
+ Mux : testEnv .Mux ,
198
+ URL : "/resell/v2/floatingips" ,
199
+ RawResponse : TestListFloatingIPsResponseRaw ,
200
+ Method : http .MethodGet ,
201
+ Status : http .StatusBadGateway ,
202
+ CallFlag : & endpointCalled ,
203
+ })
171
204
172
205
ctx := context .Background ()
173
206
allFloatingIPs , httpResponse , err := floatingips .List (ctx , testEnv .Client , floatingips.ListOpts {})
@@ -210,9 +243,14 @@ func TestListFloatingIPsUnmarshalError(t *testing.T) {
210
243
testEnv := testutils .SetupTestEnv ()
211
244
defer testEnv .TearDownTestEnv ()
212
245
testEnv .NewTestResellV2Client ()
213
- testutils .HandleReqWithoutBody (testEnv .Mux , "/resell/v2/floatingips" ,
214
- TestManyFloatingIPsInvalidResponseRaw , http .MethodGet , http .StatusOK ,
215
- & endpointCalled , t )
246
+ testutils .HandleReqWithoutBody (t , & testutils.HandleReqOpts {
247
+ Mux : testEnv .Mux ,
248
+ URL : "/resell/v2/floatingips" ,
249
+ RawResponse : TestManyFloatingIPsInvalidResponseRaw ,
250
+ Method : http .MethodGet ,
251
+ Status : http .StatusOK ,
252
+ CallFlag : & endpointCalled ,
253
+ })
216
254
217
255
ctx := context .Background ()
218
256
allFloatingIPs , _ , err := floatingips .List (ctx , testEnv .Client , floatingips.ListOpts {})
@@ -234,9 +272,15 @@ func TestCreateFloatingIPs(t *testing.T) {
234
272
testEnv := testutils .SetupTestEnv ()
235
273
defer testEnv .TearDownTestEnv ()
236
274
testEnv .NewTestResellV2Client ()
237
- testutils .HandleReqWithBody (testEnv .Mux , "/resell/v2/floatingips/projects/49338ac045f448e294b25d013f890317" ,
238
- TestCreateFloatingIPResponseRaw , TestCreateFloatingIPOptsRaw , http .MethodPost , http .StatusOK ,
239
- & endpointCalled , t )
275
+ testutils .HandleReqWithBody (t , & testutils.HandleReqOpts {
276
+ Mux : testEnv .Mux ,
277
+ URL : "/resell/v2/floatingips/projects/49338ac045f448e294b25d013f890317" ,
278
+ RawResponse : TestCreateFloatingIPResponseRaw ,
279
+ RawRequest : TestCreateFloatingIPOptsRaw ,
280
+ Method : http .MethodPost ,
281
+ Status : http .StatusOK ,
282
+ CallFlag : & endpointCalled ,
283
+ })
240
284
241
285
ctx := context .Background ()
242
286
createOpts := TestCreateFloatingIPOpts
@@ -261,9 +305,15 @@ func TestCreateFloatingIPsHTTPError(t *testing.T) {
261
305
testEnv := testutils .SetupTestEnv ()
262
306
defer testEnv .TearDownTestEnv ()
263
307
testEnv .NewTestResellV2Client ()
264
- testutils .HandleReqWithBody (testEnv .Mux , "/resell/v2/floatingips/projects/49338ac045f448e294b25d013f890317" ,
265
- TestCreateFloatingIPResponseRaw , TestCreateFloatingIPOptsRaw , http .MethodPost ,
266
- http .StatusBadRequest , & endpointCalled , t )
308
+ testutils .HandleReqWithBody (t , & testutils.HandleReqOpts {
309
+ Mux : testEnv .Mux ,
310
+ URL : "/resell/v2/floatingips/projects/49338ac045f448e294b25d013f890317" ,
311
+ RawResponse : TestCreateFloatingIPResponseRaw ,
312
+ RawRequest : TestCreateFloatingIPOptsRaw ,
313
+ Method : http .MethodPost ,
314
+ Status : http .StatusBadRequest ,
315
+ CallFlag : & endpointCalled ,
316
+ })
267
317
268
318
ctx := context .Background ()
269
319
createOpts := TestCreateFloatingIPOpts
@@ -308,8 +358,15 @@ func TestCreateFloatingIPsUnmarshalError(t *testing.T) {
308
358
testEnv := testutils .SetupTestEnv ()
309
359
defer testEnv .TearDownTestEnv ()
310
360
testEnv .NewTestResellV2Client ()
311
- testutils .HandleReqWithBody (testEnv .Mux , "/resell/v2/floatingips/projects/49338ac045f448e294b25d013f890317" ,
312
- TestManyFloatingIPsInvalidResponseRaw , TestCreateFloatingIPOptsRaw , http .MethodPost , http .StatusOK , & endpointCalled , t )
361
+ testutils .HandleReqWithBody (t , & testutils.HandleReqOpts {
362
+ Mux : testEnv .Mux ,
363
+ URL : "/resell/v2/floatingips/projects/49338ac045f448e294b25d013f890317" ,
364
+ RawResponse : TestManyFloatingIPsInvalidResponseRaw ,
365
+ RawRequest : TestCreateFloatingIPOptsRaw ,
366
+ Method : http .MethodPost ,
367
+ Status : http .StatusOK ,
368
+ CallFlag : & endpointCalled ,
369
+ })
313
370
314
371
ctx := context .Background ()
315
372
createOpts := TestCreateFloatingIPOpts
@@ -332,8 +389,13 @@ func TestDeleteFloatingIP(t *testing.T) {
332
389
testEnv := testutils .SetupTestEnv ()
333
390
defer testEnv .TearDownTestEnv ()
334
391
testEnv .NewTestResellV2Client ()
335
- testutils .HandleReqWithoutBody (testEnv .Mux , "/resell/v2/floatingips/5232d5f3-4950-454b-bd41-78c5295622cd" ,
336
- "" , http .MethodDelete , http .StatusOK , & endpointCalled , t )
392
+ testutils .HandleReqWithoutBody (t , & testutils.HandleReqOpts {
393
+ Mux : testEnv .Mux ,
394
+ URL : "/resell/v2/floatingips/5232d5f3-4950-454b-bd41-78c5295622cd" ,
395
+ Method : http .MethodDelete ,
396
+ Status : http .StatusOK ,
397
+ CallFlag : & endpointCalled ,
398
+ })
337
399
338
400
ctx := context .Background ()
339
401
_ , err := floatingips .Delete (ctx , testEnv .Client , "5232d5f3-4950-454b-bd41-78c5295622cd" )
@@ -351,8 +413,13 @@ func TestDeleteFloatingIPHTTPError(t *testing.T) {
351
413
testEnv := testutils .SetupTestEnv ()
352
414
defer testEnv .TearDownTestEnv ()
353
415
testEnv .NewTestResellV2Client ()
354
- testutils .HandleReqWithoutBody (testEnv .Mux , "/resell/v2/floatingips/5232d5f3-4950-454b-bd41-78c5295622cd" ,
355
- "" , http .MethodDelete , http .StatusBadGateway , & endpointCalled , t )
416
+ testutils .HandleReqWithoutBody (t , & testutils.HandleReqOpts {
417
+ Mux : testEnv .Mux ,
418
+ URL : "/resell/v2/floatingips/5232d5f3-4950-454b-bd41-78c5295622cd" ,
419
+ Method : http .MethodDelete ,
420
+ Status : http .StatusBadGateway ,
421
+ CallFlag : & endpointCalled ,
422
+ })
356
423
357
424
ctx := context .Background ()
358
425
httpResponse , err := floatingips .Delete (ctx , testEnv .Client , "5232d5f3-4950-454b-bd41-78c5295622cd" )
0 commit comments