(expectedBackend, objectKey, cb)
| 236 | } |
| 237 | |
| 238 | function assertObjOnBackend(expectedBackend, objectKey, cb) { |
| 239 | const zenkoObjectKey = _getZenkoObjectKey(objectKey); |
| 240 | return objectGet(authInfo, getObjectGetRequest(zenkoObjectKey), false, log, |
| 241 | async (err, result, metaHeaders) => { |
| 242 | assert.equal(err, null, `Error getting object on S3: ${err}`); |
| 243 | assert.strictEqual(metaHeaders[`x-amz-meta-${locMetaHeader}`], expectedBackend); |
| 244 | if (expectedBackend === awsLocation) { |
| 245 | return s3.send(new HeadObjectCommand({ Bucket: awsBucket, Key: objectKey })) |
| 246 | .then(result => { |
| 247 | assert.strictEqual(result.Metadata[locMetaHeader], awsLocation); |
| 248 | return cb(); |
| 249 | }).catch(err => { |
| 250 | assert.equal(err, null, 'Error on headObject call to AWS: ' + |
| 251 | `${err}`); |
| 252 | return cb(); |
| 253 | }); |
| 254 | } |
| 255 | return process.nextTick(cb); |
| 256 | }); |
| 257 | } |
| 258 | |
| 259 | function putParts(uploadId, key, cb) { |
| 260 | const putPartParam1 = getPartParams(key, uploadId, 1); |
no test coverage detected