@@ -195,31 +195,36 @@ func TestHTTPClientDownload(t *testing.T) {
195
195
expectederror : "" ,
196
196
},
197
197
// case 4
198
+ {
199
+ endpoint : "https://unknown-transfer-adapter.io" ,
200
+ expectederror : "TransferAdapter not found: " ,
201
+ },
202
+ // case 5
198
203
{
199
204
endpoint : "https://error-in-response-objects.io" ,
200
205
expectederror : "Object not found" ,
201
206
},
202
- // case 5
207
+ // case 6
203
208
{
204
209
endpoint : "https://empty-actions-map.io" ,
205
210
expectederror : "missing action 'download'" ,
206
211
},
207
- // case 6
212
+ // case 7
208
213
{
209
214
endpoint : "https://download-actions-map.io" ,
210
215
expectederror : "" ,
211
216
},
212
- // case 7
217
+ // case 8
213
218
{
214
219
endpoint : "https://upload-actions-map.io" ,
215
220
expectederror : "missing action 'download'" ,
216
221
},
217
- // case 8
222
+ // case 9
218
223
{
219
224
endpoint : "https://verify-actions-map.io" ,
220
225
expectederror : "missing action 'download'" ,
221
226
},
222
- // case 9
227
+ // case 10
223
228
{
224
229
endpoint : "https://unknown-actions-map.io" ,
225
230
expectederror : "missing action 'download'" ,
@@ -228,10 +233,12 @@ func TestHTTPClientDownload(t *testing.T) {
228
233
229
234
for n , c := range cases {
230
235
client := & HTTPClient {
231
- client : hc ,
232
- endpoint : c .endpoint ,
233
- transfers : []string {"dummy" },
234
- activeAdapter : dummy ,
236
+ client : hc ,
237
+ endpoint : c .endpoint ,
238
+ transfers : map [string ]TransferAdapter {
239
+ "dummy" : dummy ,
240
+ },
241
+ transferNames : []string {"dummy" },
235
242
}
236
243
237
244
err := client .Download (context .Background (), []Pointer {p }, func (p Pointer , content io.ReadCloser , objectError error ) error {
@@ -297,31 +304,36 @@ func TestHTTPClientUpload(t *testing.T) {
297
304
expectederror : "" ,
298
305
},
299
306
// case 4
307
+ {
308
+ endpoint : "https://unknown-transfer-adapter.io" ,
309
+ expectederror : "TransferAdapter not found: " ,
310
+ },
311
+ // case 5
300
312
{
301
313
endpoint : "https://error-in-response-objects.io" ,
302
314
expectederror : "Object not found" ,
303
315
},
304
- // case 5
316
+ // case 6
305
317
{
306
318
endpoint : "https://empty-actions-map.io" ,
307
319
expectederror : "" ,
308
320
},
309
- // case 6
321
+ // case 7
310
322
{
311
323
endpoint : "https://download-actions-map.io" ,
312
324
expectederror : "missing action 'upload'" ,
313
325
},
314
- // case 7
326
+ // case 8
315
327
{
316
328
endpoint : "https://upload-actions-map.io" ,
317
329
expectederror : "" ,
318
330
},
319
- // case 8
331
+ // case 9
320
332
{
321
333
endpoint : "https://verify-actions-map.io" ,
322
334
expectederror : "missing action 'upload'" ,
323
335
},
324
- // case 9
336
+ // case 10
325
337
{
326
338
endpoint : "https://unknown-actions-map.io" ,
327
339
expectederror : "missing action 'upload'" ,
@@ -330,10 +342,12 @@ func TestHTTPClientUpload(t *testing.T) {
330
342
331
343
for n , c := range cases {
332
344
client := & HTTPClient {
333
- client : hc ,
334
- endpoint : c .endpoint ,
335
- transfers : []string {"dummy" },
336
- activeAdapter : dummy ,
345
+ client : hc ,
346
+ endpoint : c .endpoint ,
347
+ transfers : map [string ]TransferAdapter {
348
+ "dummy" : dummy ,
349
+ },
350
+ transferNames : []string {"dummy" },
337
351
}
338
352
339
353
err := client .Upload (context .Background (), []Pointer {p }, func (p Pointer , objectError error ) (io.ReadCloser , error ) {
0 commit comments