TestMalformedStreamMethod starts a test server and sends an RPC with a malformed method name. The server should respond with an UNIMPLEMENTED status code in this case.
(t *testing.T)
| 5607 | // malformed method name. The server should respond with an UNIMPLEMENTED status |
| 5608 | // code in this case. |
| 5609 | func (s) TestMalformedStreamMethod(t *testing.T) { |
| 5610 | const testMethod = "a-method-name-without-any-slashes" |
| 5611 | te := newTest(t, tcpClearRREnv) |
| 5612 | te.startServer(nil) |
| 5613 | defer te.tearDown() |
| 5614 | |
| 5615 | ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) |
| 5616 | defer cancel() |
| 5617 | err := te.clientConn().Invoke(ctx, testMethod, nil, nil) |
| 5618 | if gotCode := status.Code(err); gotCode != codes.Unimplemented { |
| 5619 | t.Fatalf("Invoke with method %q, got code %s, want %s", testMethod, gotCode, codes.Unimplemented) |
| 5620 | } |
| 5621 | } |
| 5622 | |
| 5623 | func (s) TestMethodFromServerStream(t *testing.T) { |
| 5624 | const testMethod = "/package.service/method" |
nothing calls this directly
no test coverage detected