From 554426994b9e1e840b8339b79e0bf97052811a58 Mon Sep 17 00:00:00 2001 From: Jose Ulises Nino Rivera Date: Wed, 7 Sep 2016 18:10:37 -0700 Subject: [PATCH] NETWORK-513 Fix warning, and clean up test (#57) --- test/common/http/async_client_impl_test.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/test/common/http/async_client_impl_test.cc b/test/common/http/async_client_impl_test.cc index 8a996b0ae899..392062fc2167 100644 --- a/test/common/http/async_client_impl_test.cc +++ b/test/common/http/async_client_impl_test.cc @@ -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) @@ -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) @@ -301,8 +299,9 @@ TEST_F(AsyncClientImplTestIsolatedStats, CanaryStatusCounterFalse) { client.send(std::move(message_), callbacks_, Optional()); 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); } + } // Http