Merge pull request #18630 from yashykt/lamechannelinterception

Make C++ Channel Interceptors work for lame channels
pull/18736/head
Yash Tibrewal 6 years ago committed by GitHub
commit 8e407f74b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/cpp/client/create_channel.cc
  2. 12
      test/cpp/end2end/client_interceptors_end2end_test.cc

@ -79,9 +79,7 @@ std::shared_ptr<grpc::Channel> CreateCustomChannelWithInterceptors(
grpc_lame_client_channel_create(
nullptr, GRPC_STATUS_INVALID_ARGUMENT,
"Invalid credentials."),
std::vector<std::unique_ptr<
grpc::experimental::
ClientInterceptorFactoryInterface>>());
std::move(interceptor_creators));
}
} // namespace experimental

@ -611,6 +611,18 @@ TEST_F(ClientInterceptorsEnd2endTest, ClientInterceptorLoggingTest) {
EXPECT_EQ(DummyInterceptor::GetNumTimesRun(), 20);
}
TEST_F(ClientInterceptorsEnd2endTest,
LameChannelClientInterceptorHijackingTest) {
ChannelArguments args;
std::vector<std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>
creators;
creators.push_back(std::unique_ptr<HijackingInterceptorFactory>(
new HijackingInterceptorFactory()));
auto channel = experimental::CreateCustomChannelWithInterceptors(
server_address_, nullptr, args, std::move(creators));
MakeCall(channel);
}
TEST_F(ClientInterceptorsEnd2endTest, ClientInterceptorHijackingTest) {
ChannelArguments args;
DummyInterceptor::Reset();

Loading…
Cancel
Save