TestStreamingServerInterceptorGetsConnection tests whether the accepted conn on the server gets to any streaming interceptors on the server side.
(t *testing.T)
| 6678 | // TestStreamingServerInterceptorGetsConnection tests whether the accepted conn on |
| 6679 | // the server gets to any streaming interceptors on the server side. |
| 6680 | func (s) TestStreamingServerInterceptorGetsConnection(t *testing.T) { |
| 6681 | ss := &stubserver.StubServer{} |
| 6682 | if err := ss.Start([]grpc.ServerOption{grpc.StreamInterceptor(streamingInterceptorVerifyConn)}); err != nil { |
| 6683 | t.Fatalf("Error starting endpoint server: %v", err) |
| 6684 | } |
| 6685 | defer ss.Stop() |
| 6686 | |
| 6687 | ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) |
| 6688 | defer cancel() |
| 6689 | |
| 6690 | s, err := ss.Client.StreamingOutputCall(ctx, &testpb.StreamingOutputCallRequest{}) |
| 6691 | if err != nil { |
| 6692 | t.Fatalf("ss.Client.StreamingOutputCall(_) = _, %v, want _, <nil>", err) |
| 6693 | } |
| 6694 | if _, err := s.Recv(); err != io.EOF { |
| 6695 | t.Fatalf("ss.Client.StreamingInputCall(_) = _, %v, want _, %v", err, io.EOF) |
| 6696 | } |
| 6697 | } |
| 6698 | |
| 6699 | // unaryInterceptorVerifyAuthority verifies there is an unambiguous :authority |
| 6700 | // once the request gets to an interceptor. An unambiguous :authority is defined |
nothing calls this directly
no test coverage detected