21 #include <gmock/gmock.h>
22 #include <gtest/gtest.h>
35 class TestChannelCredsFactory :
public ChannelCredsFactory<> {
38 bool IsValidConfig(
const Json& )
const override {
return true; }
39 RefCountedPtr<grpc_channel_credentials> CreateChannelCreds(
40 const Json& )
const override {
41 return RefCountedPtr<grpc_channel_credentials>(
48 void SetUp()
override {
54 TEST_F(ChannelCredsRegistryTest, DefaultCreds) {
74 TEST_F(ChannelCredsRegistryTest, Register) {
87 builder->channel_creds_registry()->RegisterChannelCredsFactory(
88 absl::make_unique<TestChannelCredsFactory>());
91 RefCountedPtr<grpc_channel_credentials> test_cred(
103 int main(
int argc,
char** argv) {