@@ -40,7 +40,7 @@ const tokenId = 'test-token'
40
40
describe ( 'LanguageClientAuth' , ( ) => {
41
41
let client : sinon . SinonStubbedInstance < LanguageClient >
42
42
let auth : LanguageClientAuth
43
- const encryptionKey = Buffer . from ( 'test-key' )
43
+ const encryptionKey = Buffer . from ( 'test-key' . padEnd ( 32 , '0' ) )
44
44
let useDeviceFlowStub : sinon . SinonStub
45
45
46
46
beforeEach ( ( ) => {
@@ -61,6 +61,16 @@ describe('LanguageClientAuth', () => {
61
61
}
62
62
useDeviceFlowStub . returns ( useDeviceFlow ? true : false )
63
63
64
+ client . sendRequest . resolves ( {
65
+ ssoToken : {
66
+ id : 'my-id' ,
67
+ accessToken : 'my-access-token' ,
68
+ } ,
69
+ updateCredentialsParams : {
70
+ data : 'my-data' ,
71
+ } ,
72
+ } satisfies GetSsoTokenResult )
73
+
64
74
await auth . getSsoToken ( tokenSource , true )
65
75
66
76
sinon . assert . calledOnce ( client . sendRequest )
@@ -215,6 +225,21 @@ describe('LanguageClientAuth', () => {
215
225
it ( 'sends correct request parameters' , async ( ) => {
216
226
await auth . getIamCredential ( profileName , true )
217
227
228
+ client . sendRequest . resolves ( {
229
+ credential : {
230
+ id : 'my-id' ,
231
+ kinds : [ ] ,
232
+ credentials : {
233
+ accessKeyId : 'my-access-key' ,
234
+ secretAccessKey : 'my-secret-key' ,
235
+ sessionToken : 'my-session-token' ,
236
+ } ,
237
+ } ,
238
+ updateCredentialsParams : {
239
+ data : 'my-data' ,
240
+ } ,
241
+ } satisfies GetIamCredentialResult )
242
+
218
243
sinon . assert . calledOnce ( client . sendRequest )
219
244
sinon . assert . calledWith (
220
245
client . sendRequest ,
0 commit comments