resolve comments

pull/1594/head
Yang Gao 10 years ago
parent a89389283f
commit 280ca17d79
  1. 3
      src/cpp/client/insecure_credentials.cc
  2. 6
      test/cpp/end2end/end2end_test.cc

@ -52,7 +52,8 @@ class InsecureCredentialsImpl GRPC_FINAL : public Credentials {
target, grpc_channel_create(target.c_str(), &channel_args)));
}
bool ApplyToCall(grpc_call* call) GRPC_OVERRIDE { return true; }
// InsecureCredentials should not be applied to a call.
bool ApplyToCall(grpc_call* call) GRPC_OVERRIDE { return false; }
SecureCredentials* AsSecureCredentials() GRPC_OVERRIDE { return nullptr; }
};

@ -614,8 +614,8 @@ TEST_F(End2endTest, InsecurePerCallCredentials) {
grpc::string msg("Hello");
Status s = stub_->Echo(&context, request, &response);
EXPECT_EQ(request.message(), response.message());
EXPECT_TRUE(s.IsOk());
EXPECT_EQ(StatusCode::CANCELLED, s.code());
EXPECT_EQ("Failed to set credentials to rpc.", s.details());
}
TEST_F(End2endTest, OverridePerCallCredentials) {
@ -623,7 +623,7 @@ TEST_F(End2endTest, OverridePerCallCredentials) {
EchoRequest request;
EchoResponse response;
ClientContext context;
std::shared_ptr<Credentials> creds1 = InsecureCredentials();
std::shared_ptr<Credentials> creds1 = SslCredentials(SslCredentialsOptions());
context.set_credentials(creds1);
std::shared_ptr<Credentials> creds2 =
IAMCredentials("fake_token", "fake_selector");

Loading…
Cancel
Save