| 41 | REGISTER_GRPC_HANDLER(Spanner, CreateSession); |
| 42 | |
| 43 | TEST(HandlerRegisterer, RegistersUnaryGRPCHandler) { |
| 44 | // Check that we can get a handler. |
| 45 | auto handler = |
| 46 | dynamic_cast<UnaryGRPCHandler<google::spanner::v1::CreateSessionRequest, |
| 47 | google::spanner::v1::Session>*>( |
| 48 | GetHandler("Spanner", "CreateSession")); |
| 49 | ASSERT_NE(nullptr, handler); |
| 50 | |
| 51 | // Check that the handler is the one we registered. |
| 52 | RequestContext ctx(nullptr, nullptr); |
| 53 | google::spanner::v1::CreateSessionRequest request; |
| 54 | google::spanner::v1::Session response; |
| 55 | GOOGLESQL_EXPECT_OK(handler->Run(&ctx, &request, &response)); |
| 56 | EXPECT_EQ("Hello, World!", response.name()); |
| 57 | } |
| 58 | |
| 59 | // Test ServerWriter which just captures the sent messages. |
| 60 | template <class MessageT> |
nothing calls this directly
no test coverage detected