Skip to content

Commit

Permalink
NETWORK-513 Fix warning, and clean up test (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
junr03 authored Sep 8, 2016
1 parent cceaed4 commit 5544269
Showing 1 changed file with 5 additions and 6 deletions.
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);
}

} // Http

0 comments on commit 5544269

Please sign in to comment.