@@ -550,7 +550,7 @@ describe('OIDC Auth Spec Tests', function () {
550550 describe ( '4.4 Speculative Authentication should be ignored on Reauthentication' , function ( ) {
551551 let utilClient : MongoClient ;
552552 const callbackSpy = sinon . spy ( createCallback ( ) ) ;
553- const commands = [ ] ;
553+ const saslStarts = [ ] ;
554554 // - Create an OIDC configured client.
555555 // - Populate the *Client Cache* with a valid access token to enforce Speculative Authentication.
556556 // - Perform an `insert` operation that succeeds.
@@ -584,9 +584,8 @@ describe('OIDC Auth Spec Tests', function () {
584584 monitorCommands : true
585585 } ) ;
586586 client . on ( 'commandStarted' , event => {
587- console . log ( event ) ;
588587 if ( event . commandName === 'saslStart' ) {
589- commands . push ( event ) ;
588+ saslStarts . push ( event ) ;
590589 }
591590 } ) ;
592591 const provider = client . s . authProviders . getOrCreateProvider ( 'MONGODB-OIDC' , {
@@ -595,18 +594,21 @@ describe('OIDC Auth Spec Tests', function () {
595594 const token = await readFile ( path . join ( process . env . OIDC_TOKEN_DIR , 'test_user1' ) , {
596595 encoding : 'utf8'
597596 } ) ;
597+
598598 provider . workflow . cache . put ( { accessToken : token } ) ;
599599 collection = client . db ( 'test' ) . collection ( 'test' ) ;
600+
600601 await collection . insertOne ( { name : 'test' } ) ;
601602 expect ( callbackSpy ) . to . not . have . been . called ;
602- expect ( commands ) . to . be . empty ;
603+ expect ( saslStarts ) . to . be . empty ;
603604
604605 utilClient = new MongoClient ( uriSingle , {
605606 authMechanismProperties : {
606607 OIDC_CALLBACK : createCallback ( )
607608 } ,
608609 retryReads : false
609610 } ) ;
611+
610612 await utilClient
611613 . db ( )
612614 . admin ( )
@@ -633,7 +635,7 @@ describe('OIDC Auth Spec Tests', function () {
633635 it ( 'successfully authenticates' , async function ( ) {
634636 await collection . insertOne ( { name : 'test' } ) ;
635637 expect ( callbackSpy ) . to . have . been . calledOnce ;
636- expect ( commands . length ) . to . equal ( 1 ) ;
638+ expect ( saslStarts . length ) . to . equal ( 1 ) ;
637639 } ) ;
638640 } ) ;
639641 } ) ;
0 commit comments