@@ -1063,7 +1063,7 @@ describe('Sailor', () => {
1063
1063
beforeEach ( async ( ) => {
1064
1064
const getObjectStub = sandbox . stub ( sailor . objectStorage , 'getAsJSON' ) ;
1065
1065
bodyRequestStub = getObjectStub
1066
- . withArgs ( bodyObjectId , settings . OBJECT_STORAGE_TOKEN )
1066
+ . withArgs ( bodyObjectId , { jwtPayloadOrToken : settings . OBJECT_STORAGE_TOKEN } )
1067
1067
. resolves ( body ) ;
1068
1068
passthroughRequestStub = bodyRequestStub
1069
1069
. withArgs ( passthroughObjectId )
@@ -1144,7 +1144,7 @@ describe('Sailor', () => {
1144
1144
beforeEach ( async ( ) => {
1145
1145
const getObjectStub = sandbox . stub ( sailor . objectStorage , 'getAsJSON' ) ;
1146
1146
bodyRequestStub = getObjectStub
1147
- . withArgs ( bodyObjectId , settings . OBJECT_STORAGE_TOKEN )
1147
+ . withArgs ( bodyObjectId , { jwtPayloadOrToken : settings . OBJECT_STORAGE_TOKEN } )
1148
1148
. resolves ( body ) ;
1149
1149
passthroughRequestStub = bodyRequestStub . withArgs ( passthroughObjectId ) . rejects ( new Error ( ) ) ;
1150
1150
@@ -1195,7 +1195,7 @@ describe('Sailor', () => {
1195
1195
1196
1196
passthroughRequestStub = sandbox
1197
1197
. stub ( sailor . objectStorage , 'getAsJSON' )
1198
- . withArgs ( passthroughObjectId , settings . OBJECT_STORAGE_TOKEN )
1198
+ . withArgs ( passthroughObjectId , { jwtPayloadOrToken : settings . OBJECT_STORAGE_TOKEN } )
1199
1199
. resolves ( passThroughBody ) ;
1200
1200
1201
1201
await sailor . connect ( ) ;
@@ -1310,7 +1310,7 @@ describe('Sailor', () => {
1310
1310
} ) ;
1311
1311
1312
1312
sandbox . stub ( sailor . objectStorage , 'getAsJSON' )
1313
- . withArgs ( passthroughObjectId , settings . OBJECT_STORAGE_TOKEN )
1313
+ . withArgs ( passthroughObjectId , { jwtPayloadOrToken : settings . OBJECT_STORAGE_TOKEN } )
1314
1314
. resolves ( { passthrough : 'body' } ) ;
1315
1315
1316
1316
await sailor . connect ( ) ;
@@ -1391,46 +1391,13 @@ describe('Sailor', () => {
1391
1391
expect ( sailor . apiClient . tasks . retrieveStep ) . to . have . been . calledOnce ;
1392
1392
expect ( fakeAMQPConnection . connect ) . to . have . been . calledOnce ;
1393
1393
sinon . assert . calledTwice ( addObjectStub ) ;
1394
- sinon . assert . notCalled ( fakeAMQPConnection . sendError ) ;
1395
- sinon . assert . calledOnce ( fakeAMQPConnection . sendData ) ;
1396
- sinon . assert . calledWith (
1397
- fakeAMQPConnection . sendData ,
1398
- {
1399
- body : { items : [ 1 , 2 , 3 , 4 , 5 , 6 ] } ,
1400
- headers : { } ,
1401
- passthrough : {
1402
- ...payload . passthrough ,
1403
- step_2 : {
1404
- body : { } ,
1405
- headers : {
1406
- [ Sailor . OBJECT_ID_HEADER ] : passthroughObjectId //reuse already uploaded
1407
- }
1408
- } ,
1409
- step_1 : {
1410
- headers : { } ,
1411
- body : { items : [ 1 , 2 , 3 , 4 , 5 , 6 ] }
1412
- }
1413
- }
1414
- } ,
1394
+ expect ( fakeAMQPConnection . sendError ) . to . have . been . calledOnce . and . calledWith (
1415
1395
sinon . match ( {
1416
- compId : '5559edd38968ec0736000456' ,
1417
- containerId : 'dc1c8c3f-f9cb-49e1-a6b8-716af9e15948' ,
1418
- end : sinon . match . number ,
1419
- execId : 'some-exec-id' ,
1420
- function : 'data_trigger' ,
1421
- messageId : sinon . match . string ,
1422
- parentMessageId : message . properties . headers . messageId ,
1423
- start : sinon . match . number ,
1424
- stepId : 'step_1' ,
1425
- taskId : '5559edd38968ec0736000003' ,
1426
- threadId : message . properties . headers . threadId ,
1427
- userId : '5559edd38968ec0736000002' ,
1428
- workspaceId : '5559edd38968ec073600683'
1429
- } )
1396
+ message : 'Lightweight message/passthrough body upload error' ,
1397
+ stack : sinon . match . string
1398
+ } ) ,
1430
1399
) ;
1431
-
1432
1400
expect ( fakeAMQPConnection . ack ) . to . have . been . calledOnce . and . calledWith ( message ) ;
1433
- const [ { headers, passthrough } ] = fakeAMQPConnection . sendData . getCall ( 0 ) . args ;
1434
1401
} ) ;
1435
1402
} ) ;
1436
1403
} ) ;
@@ -1450,7 +1417,7 @@ describe('Sailor', () => {
1450
1417
} ) ;
1451
1418
1452
1419
sandbox . stub ( sailor . objectStorage , 'getAsJSON' )
1453
- . withArgs ( passthroughObjectId , settings . OBJECT_STORAGE_TOKEN )
1420
+ . withArgs ( passthroughObjectId , { jwtPayloadOrToken : settings . OBJECT_STORAGE_TOKEN } )
1454
1421
. resolves ( { passthrough : 'body' } ) ;
1455
1422
1456
1423
await sailor . connect ( ) ;
0 commit comments