Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NETWORK-513 Fix warning, and clean up test #57

Merged
merged 2 commits into from
Sep 8, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions test/common/http/async_client_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ TEST_F(AsyncClientImplTestMockStats, DisableTimer) {

TEST_F(AsyncClientImplTestIsolatedStats, CanaryStatusCounterTrue) {
message_->body(Buffer::InstancePtr{new Buffer::OwnedImpl("test body")});
Buffer::Instance& data = *message_->body();

EXPECT_CALL(conn_pool_, newStream(_, _))
.WillOnce(Invoke([&](StreamDecoder& decoder, ConnectionPool::Callbacks& callbacks)
Expand All @@ -281,14 +280,13 @@ TEST_F(AsyncClientImplTestIsolatedStats, CanaryStatusCounterTrue) {
HeaderMapPtr response_headers(
new HeaderMapImpl{{":status", "200"}, {"x-envoy-upstream-canary", "false"}});
ON_CALL(*conn_pool_.host_, canary()).WillByDefault(Return(true));
response_decoder_->decodeHeaders(std::move(response_headers), false);
EXPECT_CALL(callbacks_, onSuccess_(_));
response_decoder_->decodeHeaders(std::move(response_headers), true);
EXPECT_EQ(1U, stats_store_.counter("cluster.fake_cluster.canary.upstream_rq_200").value());
response_decoder_->decodeData(data, true);
}

TEST_F(AsyncClientImplTestIsolatedStats, CanaryStatusCounterFalse) {
message_->body(Buffer::InstancePtr{new Buffer::OwnedImpl("test body")});
Buffer::Instance& data = *message_->body();

EXPECT_CALL(conn_pool_, newStream(_, _))
.WillOnce(Invoke([&](StreamDecoder& decoder, ConnectionPool::Callbacks& callbacks)
Expand All @@ -301,8 +299,9 @@ TEST_F(AsyncClientImplTestIsolatedStats, CanaryStatusCounterFalse) {
client.send(std::move(message_), callbacks_, Optional<std::chrono::milliseconds>());
HeaderMapPtr response_headers(
new HeaderMapImpl{{":status", "200"}, {"x-envoy-upstream-canary", "false"}});
response_decoder_->decodeHeaders(std::move(response_headers), false);
EXPECT_CALL(callbacks_, onSuccess_(_));
response_decoder_->decodeHeaders(std::move(response_headers), true);
EXPECT_EQ(0U, stats_store_.counter("cluster.fake_cluster.canary.upstream_rq_200").value());
response_decoder_->decodeData(data, true);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: newline after this line (from previous change)


} // Http