(t *testing.T)
| 85 | } |
| 86 | |
| 87 | func (s) TestGetServiceInfo(t *testing.T) { |
| 88 | testSd := ServiceDesc{ |
| 89 | ServiceName: "grpc.testing.EmptyService", |
| 90 | HandlerType: (*emptyServiceServer)(nil), |
| 91 | Methods: []MethodDesc{ |
| 92 | { |
| 93 | MethodName: "EmptyCall", |
| 94 | Handler: nil, |
| 95 | }, |
| 96 | }, |
| 97 | Streams: []StreamDesc{ |
| 98 | { |
| 99 | StreamName: "EmptyStream", |
| 100 | Handler: nil, |
| 101 | ServerStreams: false, |
| 102 | ClientStreams: true, |
| 103 | }, |
| 104 | }, |
| 105 | Metadata: []int{0, 2, 1, 3}, |
| 106 | } |
| 107 | |
| 108 | server := NewServer() |
| 109 | server.RegisterService(&testSd, &testServer{}) |
| 110 | |
| 111 | info := server.GetServiceInfo() |
| 112 | want := map[string]ServiceInfo{ |
| 113 | "grpc.testing.EmptyService": { |
| 114 | Methods: []MethodInfo{ |
| 115 | { |
| 116 | Name: "EmptyCall", |
| 117 | IsClientStream: false, |
| 118 | IsServerStream: false, |
| 119 | }, |
| 120 | { |
| 121 | Name: "EmptyStream", |
| 122 | IsClientStream: true, |
| 123 | IsServerStream: false, |
| 124 | }}, |
| 125 | Metadata: []int{0, 2, 1, 3}, |
| 126 | }, |
| 127 | } |
| 128 | |
| 129 | if !reflect.DeepEqual(info, want) { |
| 130 | t.Errorf("GetServiceInfo() = %+v, want %+v", info, want) |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | func (s) TestRetryChainedInterceptor(t *testing.T) { |
| 135 | var records []int |
nothing calls this directly
no test coverage detected