aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/end2end
diff options
context:
space:
mode:
authorGravatar Yang Gao <yangg@google.com>2015-05-17 21:54:54 -0700
committerGravatar Yang Gao <yangg@google.com>2015-05-17 21:54:54 -0700
commitb57f72dbeeffee0bdb3f39f470f048a23bdb6a08 (patch)
tree68a24792c151d603e2f4d4703843d31e4846e019 /test/cpp/end2end
parent26a49125588108e18d12d6ed13ba65d7ef565a10 (diff)
resolve comments
Diffstat (limited to 'test/cpp/end2end')
-rw-r--r--test/cpp/end2end/end2end_test.cc19
1 files changed, 14 insertions, 5 deletions
diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc
index 9017641e30..76271c3e1d 100644
--- a/test/cpp/end2end/end2end_test.cc
+++ b/test/cpp/end2end/end2end_test.cc
@@ -191,7 +191,8 @@ class End2endTest : public ::testing::Test {
server_address_ << "localhost:" << port;
// Setup server
ServerBuilder builder;
- builder.AddListeningPort(server_address_.str(), FakeServerCredentials());
+ builder.AddListeningPort(server_address_.str(),
+ FakeTransportSecurityServerCredentials());
builder.RegisterService(&service_);
builder.SetMaxMessageSize(
kMaxMessageSize_); // For testing max message size.
@@ -203,8 +204,9 @@ class End2endTest : public ::testing::Test {
void TearDown() GRPC_OVERRIDE { server_->Shutdown(); }
void ResetStub() {
- std::shared_ptr<ChannelInterface> channel = CreateChannel(
- server_address_.str(), FakeCredentials(), ChannelArguments());
+ std::shared_ptr<ChannelInterface> channel =
+ CreateChannel(server_address_.str(), FakeTransportSecurityCredentials(),
+ ChannelArguments());
stub_ = std::move(grpc::cpp::test::util::TestService::NewStub(channel));
}
@@ -415,8 +417,9 @@ TEST_F(End2endTest, BidiStream) {
// Talk to the two services with the same name but different package names.
// The two stubs are created on the same channel.
TEST_F(End2endTest, DiffPackageServices) {
- std::shared_ptr<ChannelInterface> channel = CreateChannel(
- server_address_.str(), FakeCredentials(), ChannelArguments());
+ std::shared_ptr<ChannelInterface> channel =
+ CreateChannel(server_address_.str(), FakeTransportSecurityCredentials(),
+ ChannelArguments());
EchoRequest request;
EchoResponse response;
@@ -671,6 +674,12 @@ TEST_F(End2endTest, OverridePerCallCredentials) {
EXPECT_TRUE(MetadataContains(context.GetServerTrailingMetadata(),
GRPC_IAM_AUTHORITY_SELECTOR_METADATA_KEY,
"fake_selector2"));
+ EXPECT_FALSE(MetadataContains(context.GetServerTrailingMetadata(),
+ GRPC_IAM_AUTHORIZATION_TOKEN_METADATA_KEY,
+ "fake_token1"));
+ EXPECT_FALSE(MetadataContains(context.GetServerTrailingMetadata(),
+ GRPC_IAM_AUTHORITY_SELECTOR_METADATA_KEY,
+ "fake_selector1"));
EXPECT_EQ(request.message(), response.message());
EXPECT_TRUE(s.IsOk());
}