(t *testing.T)
| 194 | func (m *methodTestCreds) RequireTransportSecurity() bool { return false } |
| 195 | |
| 196 | func (s) TestGRPCMethodAccessibleToCredsViaContextRequestInfo(t *testing.T) { |
| 197 | const wantMethod = "/grpc.testing.TestService/EmptyCall" |
| 198 | te := newTest(t, env{name: "context-request-info", network: "tcp"}) |
| 199 | te.userAgent = testAppUA |
| 200 | te.startServer(&testServer{security: te.e.security}) |
| 201 | defer te.tearDown() |
| 202 | |
| 203 | cc := te.clientConn(grpc.WithPerRPCCredentials(&methodTestCreds{})) |
| 204 | tc := testgrpc.NewTestServiceClient(cc) |
| 205 | |
| 206 | ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) |
| 207 | defer cancel() |
| 208 | if _, err := tc.EmptyCall(ctx, &testpb.Empty{}); status.Convert(err).Message() != wantMethod { |
| 209 | t.Fatalf("ss.client.EmptyCall(_, _) = _, %v; want _, _.Message()=%q", err, wantMethod) |
| 210 | } |
| 211 | |
| 212 | if _, err := tc.EmptyCall(ctx, &testpb.Empty{}, grpc.WaitForReady(true)); status.Convert(err).Message() != wantMethod { |
| 213 | t.Fatalf("ss.client.EmptyCall(_, _) = _, %v; want _, _.Message()=%q", err, wantMethod) |
| 214 | } |
| 215 | } |
| 216 | |
| 217 | const clientAlwaysFailCredErrorMsg = "clientAlwaysFailCred always fails" |
| 218 |
nothing calls this directly
no test coverage detected