diff options
author | 2015-02-21 22:45:35 -0800 | |
---|---|---|
committer | 2015-02-23 09:58:22 -0800 | |
commit | 47c83fdaf71ca5072d0ab37322b37586d23f5ceb (patch) | |
tree | 808ca8183045d5e770eebe4eee31ca907ead1f56 /test/cpp/end2end/end2end_test.cc | |
parent | 8b131922438d96579cb315777ca980e094883496 (diff) |
Credentials prototyping
- Remove CredentialsFactory as it's unnecessary
- Effectively make Credentials a channel factory, allowing different credential types to create different channel types - this gives us a hook so that InsecureCredentials can at runtime instantiate a different kind of channel as required - giving us a way of generating an openssl free version of grpc++.
- Server credentials not touched yet, but they'll need to be updated.
Diffstat (limited to 'test/cpp/end2end/end2end_test.cc')
-rw-r--r-- | test/cpp/end2end/end2end_test.cc | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc index d4ca3ef49e..f5ecd1a20c 100644 --- a/test/cpp/end2end/end2end_test.cc +++ b/test/cpp/end2end/end2end_test.cc @@ -160,8 +160,8 @@ class End2endTest : public ::testing::Test { void TearDown() override { server_->Shutdown(); } void ResetStub() { - std::shared_ptr<ChannelInterface> channel = - CreateChannel(server_address_.str(), ChannelArguments()); + std::shared_ptr<ChannelInterface> channel = CreateChannel( + server_address_.str(), InsecureCredentials(), ChannelArguments()); stub_.reset(grpc::cpp::test::util::TestService::NewStub(channel)); } @@ -328,8 +328,7 @@ TEST_F(End2endTest, ResponseStream) { ClientContext context; request.set_message("hello"); - ClientReader<EchoResponse>* stream = - stub_->ResponseStream(&context, request); + ClientReader<EchoResponse>* stream = stub_->ResponseStream(&context, request); EXPECT_TRUE(stream->Read(&response)); EXPECT_EQ(response.message(), request.message() + "0"); EXPECT_TRUE(stream->Read(&response)); @@ -381,8 +380,8 @@ 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(), ChannelArguments()); + std::shared_ptr<ChannelInterface> channel = CreateChannel( + server_address_.str(), InsecureCredentials(), ChannelArguments()); EchoRequest request; EchoResponse response; @@ -407,8 +406,7 @@ TEST_F(End2endTest, DiffPackageServices) { // rpc and stream should fail on bad credentials. TEST_F(End2endTest, BadCredentials) { std::unique_ptr<Credentials> bad_creds = - CredentialsFactory::ServiceAccountCredentials("", "", - std::chrono::seconds(1)); + ServiceAccountCredentials("", "", std::chrono::seconds(1)); EXPECT_EQ(nullptr, bad_creds.get()); std::shared_ptr<ChannelInterface> channel = CreateChannel(server_address_.str(), bad_creds, ChannelArguments()); |