MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/cloud-spanner-emulator / TEST

Function TEST

frontend/server/handler_test.cc:43–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41REGISTER_GRPC_HANDLER(Spanner, CreateSession);
42
43TEST(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.
60template <class MessageT>

Callers

nothing calls this directly

Calls 3

GetHandlerFunction · 0.85
sizeMethod · 0.80
RunMethod · 0.45

Tested by

no test coverage detected