Skip to content

Commit

Permalink
removing Roots deprecated Subjects field in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
miledxz authored and MileTildeloop committed Jan 12, 2024
1 parent 953d12a commit 4d029ef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions credentials/tls/certprovider/pemfile/watcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ import (
"testing"
"time"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"google.golang.org/grpc/credentials/tls/certprovider"
"google.golang.org/grpc/internal/grpctest"
"google.golang.org/grpc/internal/testutils"
Expand Down Expand Up @@ -69,7 +67,7 @@ func compareKeyMaterial(got, want *certprovider.KeyMaterial) error {
// library does not provide a way to compare CertPool values. Comparing the
// subjects field of the certs in the CertPool seems like a reasonable
// approach.
if gotR, wantR := got.Roots.Subjects(), want.Roots.Subjects(); !cmp.Equal(gotR, wantR, cmpopts.EquateEmpty()) {
if gotR, wantR := got.Roots, want.Roots; !gotR.Equal(wantR) {
return fmt.Errorf("keyMaterial roots = %v, want %v", gotR, wantR)
}
return nil
Expand Down
4 changes: 1 addition & 3 deletions credentials/tls/certprovider/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ import (
"testing"
"time"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"google.golang.org/grpc/internal/grpctest"
"google.golang.org/grpc/internal/testutils"
"google.golang.org/grpc/testdata"
Expand Down Expand Up @@ -168,7 +166,7 @@ func compareKeyMaterial(got, want *KeyMaterial) error {
// library does not provide a way to compare CertPool values. Comparing the
// subjects field of the certs in the CertPool seems like a reasonable
// approach.
if gotR, wantR := got.Roots.Subjects(), want.Roots.Subjects(); !cmp.Equal(gotR, wantR, cmpopts.EquateEmpty()) {
if gotR, wantR := got.Roots, want.Roots; !gotR.Equal(wantR) {
return fmt.Errorf("keyMaterial roots = %v, want %v", gotR, wantR)
}
return nil
Expand Down

0 comments on commit 4d029ef

Please sign in to comment.