11import {
2- CloudserverClient ,
2+ BackbeatRoutesClient ,
33 MultipleBackendPutObjectInput ,
44 MultipleBackendPutObjectCommand ,
55 MultipleBackendDeleteObjectInput ,
@@ -25,10 +25,10 @@ import assert from 'assert';
2525import crypto from 'crypto' ;
2626
2727describe ( 'CloudServer Multiple Backend API Tests' , ( ) => {
28- let client : CloudserverClient ;
28+ let backbeatRoutesClient : BackbeatRoutesClient ;
2929
3030 beforeAll ( ( ) => {
31- ( { client } = createTestClient ( ) ) ;
31+ ( { backbeatRoutesClient } = createTestClient ( ) ) ;
3232 } ) ;
3333
3434 it ( 'should test MultipleBackendPutObject and delete API' , async ( ) => {
@@ -39,7 +39,7 @@ describe('CloudServer Multiple Backend API Tests', () => {
3939 RequestUids : '123' ,
4040 } ;
4141 const getCommand = new GetObjectCommand ( getInput ) ;
42- const getData = await client . send ( getCommand ) ;
42+ const getData = await backbeatRoutesClient . send ( getCommand ) ;
4343 const etag = getData . ETag ?. replace ( / " / g, '' ) || '' ;
4444
4545 const incomingMsg = getData . Body as any ;
@@ -69,7 +69,7 @@ describe('CloudServer Multiple Backend API Tests', () => {
6969 command ,
7070 contentLength
7171 ) ;
72- const result = await client . send ( command ) ;
72+ const result = await backbeatRoutesClient . send ( command ) ;
7373
7474 assert . ok ( result . location && result . location . length > 0 , 'Location should not be empty' ) ;
7575 const location = result . location [ 0 ] ;
@@ -87,7 +87,7 @@ describe('CloudServer Multiple Backend API Tests', () => {
8787 StorageType : 'file'
8888 } ;
8989 const commandDelete = new MultipleBackendDeleteObjectCommand ( deleteInput ) ;
90- const deleteResult = await client . send ( commandDelete ) ;
90+ const deleteResult = await backbeatRoutesClient . send ( commandDelete ) ;
9191 assert . strictEqual ( deleteResult . $metadata . httpStatusCode , 200 ) ;
9292 } ) ;
9393
@@ -97,7 +97,7 @@ describe('CloudServer Multiple Backend API Tests', () => {
9797 Key : testConfig . objectKey ,
9898 } ;
9999 const getCommand = new GetObjectCommand ( getInput ) ;
100- const getData = await client . send ( getCommand ) ;
100+ const getData = await backbeatRoutesClient . send ( getCommand ) ;
101101 const dataBody = await getData . Body . transformToString ( ) ;
102102 const bodyBuffer = Buffer . from ( dataBody ) ;
103103 const contentMD5 = crypto . createHash ( 'md5' ) . update ( bodyBuffer ) . digest ( 'hex' ) ;
@@ -121,7 +121,7 @@ describe('CloudServer Multiple Backend API Tests', () => {
121121 } ;
122122
123123 const command = new MultipleBackendPutObjectCommand ( putInput as any ) ;
124- const result = await client . send ( command ) ;
124+ const result = await backbeatRoutesClient . send ( command ) ;
125125 const locationKey = result . location ?. [ 0 ] ?. key || '' ;
126126
127127 const headInput : MultipleBackendHeadObjectInput = {
@@ -133,7 +133,7 @@ describe('CloudServer Multiple Backend API Tests', () => {
133133 } ] )
134134 } ;
135135 const headCommand = new MultipleBackendHeadObjectCommand ( headInput ) ;
136- const headResult = await client . send ( headCommand ) ;
136+ const headResult = await backbeatRoutesClient . send ( headCommand ) ;
137137 assert . strictEqual ( headResult . $metadata . httpStatusCode , 200 ) ;
138138 } ) ;
139139
@@ -162,7 +162,7 @@ describe('CloudServer Multiple Backend API Tests', () => {
162162 ReplicationEndpointSite : 'aVal'
163163 } ;
164164 const putTaggingCommand = new MultipleBackendPutObjectTaggingCommand ( putTaggingInput ) ;
165- const putTaggingResult = await client . send ( putTaggingCommand ) ;
165+ const putTaggingResult = await backbeatRoutesClient . send ( putTaggingCommand ) ;
166166 assert . strictEqual ( putTaggingResult . $metadata . httpStatusCode , 200 ) ;
167167 } ) ;
168168
@@ -179,7 +179,7 @@ describe('CloudServer Multiple Backend API Tests', () => {
179179 } ;
180180
181181 const deleteTaggingCommand = new MultipleBackendDeleteObjectTaggingCommand ( deleteTaggingInput ) ;
182- const deleteTaggingResult = await client . send ( deleteTaggingCommand ) ;
182+ const deleteTaggingResult = await backbeatRoutesClient . send ( deleteTaggingCommand ) ;
183183 assert . strictEqual ( deleteTaggingResult . $metadata . httpStatusCode , 200 ) ;
184184 } ) ;
185185
@@ -198,7 +198,7 @@ describe('CloudServer Multiple Backend API Tests', () => {
198198 } ;
199199
200200 const initiateMPUCommand = new MultipleBackendInitiateMPUCommand ( initiateMPUInput ) ;
201- const initiateMPUResult = await client . send ( initiateMPUCommand ) ;
201+ const initiateMPUResult = await backbeatRoutesClient . send ( initiateMPUCommand ) ;
202202 const uploadId = initiateMPUResult . uploadId ;
203203 assert . strictEqual ( initiateMPUResult . $metadata . httpStatusCode , 200 ) ;
204204
@@ -208,7 +208,7 @@ describe('CloudServer Multiple Backend API Tests', () => {
208208 Key : testConfig . objectKey ,
209209 } ;
210210 const getCommand = new GetObjectCommand ( getInput ) ;
211- const getData = await client . send ( getCommand ) ;
211+ const getData = await backbeatRoutesClient . send ( getCommand ) ;
212212 const putPartInput : MultipleBackendPutMPUPartInput = {
213213 Bucket : testConfig . bucketName ,
214214 Key : `${ testConfig . objectKey } -mpu` ,
@@ -220,7 +220,7 @@ describe('CloudServer Multiple Backend API Tests', () => {
220220 } ;
221221
222222 const putPartCommand = new MultipleBackendPutMPUPartCommand ( putPartInput as any ) ;
223- const putPartResult = await client . send ( putPartCommand ) ;
223+ const putPartResult = await backbeatRoutesClient . send ( putPartCommand ) ;
224224 assert . strictEqual ( putPartResult . $metadata . httpStatusCode , 200 ) ;
225225
226226 const completeMPUInput : MultipleBackendCompleteMPUInput = {
@@ -238,7 +238,7 @@ describe('CloudServer Multiple Backend API Tests', () => {
238238 } ) )
239239 } ;
240240 const completeMPUCommand = new MultipleBackendCompleteMPUCommand ( completeMPUInput ) ;
241- const completeMPUResult = await client . send ( completeMPUCommand ) ;
241+ const completeMPUResult = await backbeatRoutesClient . send ( completeMPUCommand ) ;
242242 assert . strictEqual ( completeMPUResult . $metadata . httpStatusCode , 200 ) ;
243243 } ) ;
244244} ) ;
0 commit comments