From ad94a60eeb4ac1d88f27b42eac959c610b4010b2 Mon Sep 17 00:00:00 2001 From: Jose Nino Date: Tue, 6 Sep 2016 16:57:57 -0700 Subject: [PATCH 1/2] Fix warning, and clean up test --- test/common/http/async_client_impl_test.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/test/common/http/async_client_impl_test.cc b/test/common/http/async_client_impl_test.cc index 8a996b0ae8991..e1583d4fab131 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,8 @@ 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 From d9ddc4fcbd68243d04e271a295f46d54ad9277bb Mon Sep 17 00:00:00 2001 From: Jose Ulises Nino Rivera Date: Wed, 7 Sep 2016 17:43:42 -0700 Subject: [PATCH 2/2] Fix nit --- test/common/http/async_client_impl_test.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/test/common/http/async_client_impl_test.cc b/test/common/http/async_client_impl_test.cc index e1583d4fab131..392062fc21679 100644 --- a/test/common/http/async_client_impl_test.cc +++ b/test/common/http/async_client_impl_test.cc @@ -303,4 +303,5 @@ TEST_F(AsyncClientImplTestIsolatedStats, CanaryStatusCounterFalse) { response_decoder_->decodeHeaders(std::move(response_headers), true); EXPECT_EQ(0U, stats_store_.counter("cluster.fake_cluster.canary.upstream_rq_200").value()); } + } // Http