mirror of https://github.com/grpc/grpc-go.git
				
				
				
			credentials/google: use grpctest.Tester for tests in this package (#5098)
This commit is contained in:
		
							parent
							
								
									fbaf7c5582
								
							
						
					
					
						commit
						b069440926
					
				|  | @ -26,9 +26,18 @@ import ( | ||||||
| 	"google.golang.org/grpc/credentials" | 	"google.golang.org/grpc/credentials" | ||||||
| 	"google.golang.org/grpc/internal" | 	"google.golang.org/grpc/internal" | ||||||
| 	icredentials "google.golang.org/grpc/internal/credentials" | 	icredentials "google.golang.org/grpc/internal/credentials" | ||||||
|  | 	"google.golang.org/grpc/internal/grpctest" | ||||||
| 	"google.golang.org/grpc/resolver" | 	"google.golang.org/grpc/resolver" | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
|  | type s struct { | ||||||
|  | 	grpctest.Tester | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | func Test(t *testing.T) { | ||||||
|  | 	grpctest.RunSubTests(t, s{}) | ||||||
|  | } | ||||||
|  | 
 | ||||||
| type testCreds struct { | type testCreds struct { | ||||||
| 	credentials.TransportCredentials | 	credentials.TransportCredentials | ||||||
| 	typ string | 	typ string | ||||||
|  | @ -73,7 +82,7 @@ func overrideNewCredsFuncs() func() { | ||||||
| // TestClientHandshakeBasedOnClusterName that by default (without switching
 | // TestClientHandshakeBasedOnClusterName that by default (without switching
 | ||||||
| // modes), ClientHandshake does either tls or alts base on the cluster name in
 | // modes), ClientHandshake does either tls or alts base on the cluster name in
 | ||||||
| // attributes.
 | // attributes.
 | ||||||
| func TestClientHandshakeBasedOnClusterName(t *testing.T) { | func (s) TestClientHandshakeBasedOnClusterName(t *testing.T) { | ||||||
| 	defer overrideNewCredsFuncs()() | 	defer overrideNewCredsFuncs()() | ||||||
| 	for bundleTyp, tc := range map[string]credentials.Bundle{ | 	for bundleTyp, tc := range map[string]credentials.Bundle{ | ||||||
| 		"defaultCredsWithOptions": NewDefaultCredentialsWithOptions(DefaultCredentialsOptions{}), | 		"defaultCredsWithOptions": NewDefaultCredentialsWithOptions(DefaultCredentialsOptions{}), | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue