@@ -11,7 +11,6 @@ import (
11
11
"errors"
12
12
"math"
13
13
"os"
14
- "reflect"
15
14
"testing"
16
15
"time"
17
16
@@ -20,13 +19,11 @@ import (
20
19
"go.mongodb.org/mongo-driver/v2/internal/assert"
21
20
"go.mongodb.org/mongo-driver/v2/internal/integtest"
22
21
"go.mongodb.org/mongo-driver/v2/internal/mongoutil"
23
- "go.mongodb.org/mongo-driver/v2/internal/require"
24
22
"go.mongodb.org/mongo-driver/v2/mongo/options"
25
23
"go.mongodb.org/mongo-driver/v2/mongo/readconcern"
26
24
"go.mongodb.org/mongo-driver/v2/mongo/readpref"
27
25
"go.mongodb.org/mongo-driver/v2/mongo/writeconcern"
28
26
"go.mongodb.org/mongo-driver/v2/tag"
29
- "go.mongodb.org/mongo-driver/v2/x/mongo/driver"
30
27
"go.mongodb.org/mongo-driver/v2/x/mongo/driver/mongocrypt"
31
28
"go.mongodb.org/mongo-driver/v2/x/mongo/driver/session"
32
29
"go.mongodb.org/mongo-driver/v2/x/mongo/driver/topology"
@@ -519,76 +516,3 @@ func TestClient(t *testing.T) {
519
516
assert .Equal (t , errmsg , err .Error (), "expected error %v, got %v" , errmsg , err .Error ())
520
517
})
521
518
}
522
-
523
- // Test that convertOIDCArgs exhaustively copies all fields of a driver.OIDCArgs
524
- // into an options.OIDCArgs.
525
- func TestConvertOIDCArgs (t * testing.T ) {
526
- refreshToken := "test refresh token"
527
-
528
- testCases := []struct {
529
- desc string
530
- args * driver.OIDCArgs
531
- }{
532
- {
533
- desc : "populated args" ,
534
- args : & driver.OIDCArgs {
535
- Version : 9 ,
536
- IDPInfo : & driver.IDPInfo {
537
- Issuer : "test issuer" ,
538
- ClientID : "test client ID" ,
539
- RequestScopes : []string {"test scope 1" , "test scope 2" },
540
- },
541
- RefreshToken : & refreshToken ,
542
- },
543
- },
544
- {
545
- desc : "nil" ,
546
- args : nil ,
547
- },
548
- {
549
- desc : "nil IDPInfo and RefreshToken" ,
550
- args : & driver.OIDCArgs {
551
- Version : 9 ,
552
- IDPInfo : nil ,
553
- RefreshToken : nil ,
554
- },
555
- },
556
- }
557
-
558
- for _ , tc := range testCases {
559
- tc := tc // Capture range variable.
560
-
561
- t .Run (tc .desc , func (t * testing.T ) {
562
- t .Parallel ()
563
-
564
- got := convertOIDCArgs (tc .args )
565
-
566
- if tc .args == nil {
567
- assert .Nil (t , got , "expected nil when input is nil" )
568
- return
569
- }
570
-
571
- require .Equal (t ,
572
- 3 ,
573
- reflect .ValueOf (* tc .args ).NumField (),
574
- "expected the driver.OIDCArgs struct to have exactly 3 fields" )
575
- require .Equal (t ,
576
- 3 ,
577
- reflect .ValueOf (* got ).NumField (),
578
- "expected the options.OIDCArgs struct to have exactly 3 fields" )
579
-
580
- assert .Equal (t ,
581
- tc .args .Version ,
582
- got .Version ,
583
- "expected Version field to be equal" )
584
- assert .EqualValues (t ,
585
- tc .args .IDPInfo ,
586
- got .IDPInfo ,
587
- "expected IDPInfo field to be convertible to equal values" )
588
- assert .Equal (t ,
589
- tc .args .RefreshToken ,
590
- got .RefreshToken ,
591
- "expected RefreshToken field to be equal" )
592
- })
593
- }
594
- }
0 commit comments