(t *testing.T)
| 5621 | } |
| 5622 | |
| 5623 | func (s) TestMethodFromServerStream(t *testing.T) { |
| 5624 | const testMethod = "/package.service/method" |
| 5625 | e := tcpClearRREnv |
| 5626 | te := newTest(t, e) |
| 5627 | var mu sync.Mutex |
| 5628 | var method string |
| 5629 | var ok bool |
| 5630 | te.unknownHandler = func(_ any, stream grpc.ServerStream) error { |
| 5631 | mu.Lock() |
| 5632 | defer mu.Unlock() |
| 5633 | method, ok = grpc.MethodFromServerStream(stream) |
| 5634 | return nil |
| 5635 | } |
| 5636 | |
| 5637 | te.startServer(nil) |
| 5638 | defer te.tearDown() |
| 5639 | ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) |
| 5640 | defer cancel() |
| 5641 | _ = te.clientConn().Invoke(ctx, testMethod, nil, nil) |
| 5642 | mu.Lock() |
| 5643 | defer mu.Unlock() |
| 5644 | if !ok || method != testMethod { |
| 5645 | t.Fatalf("Invoke with method %q, got %q, %v, want %q, true", testMethod, method, ok, testMethod) |
| 5646 | } |
| 5647 | } |
| 5648 | |
| 5649 | func (s) TestInterceptorCanAccessCallOptions(t *testing.T) { |
| 5650 | e := tcpClearRREnv |
nothing calls this directly
no test coverage detected