21 #include <gtest/gtest.h>
31 #include "src/proto/grpc/testing/echo.grpc.pb.h"
36 using grpc::testing::EchoRequest;
37 using grpc::testing::EchoResponse;
42 class TestServiceImpl :
public grpc::testing::EchoTestService::Service {
46 if (!
context->client_metadata().empty()) {
47 for (std::multimap<grpc::string_ref, grpc::string_ref>::const_iterator
54 context->AddTrailingMetadata(
"trailing_key",
"trailing_value");
84 std::unique_ptr<grpc::testing::EchoTestService::Stub>
stub_;
104 const std::string kMethod(
"/grpc.testing.EchoTestService/Echo");
105 std::string request_bin, response_bin, expected_response_bin;
108 std::multimap<std::string, std::string> client_metadata;
109 std::multimap<grpc::string_ref, grpc::string_ref> server_initial_metadata,
110 server_trailing_metadata;
111 client_metadata.insert(std::pair<std::string, std::string>(
"key1",
"val1"));
113 Status s2 =
call.Call(request_bin, &response_bin, &server_initial_metadata,
114 &server_trailing_metadata);
117 EXPECT_EQ(expected_response_bin, response_bin);
125 int main(
int argc,
char** argv) {