TEST_P(DownstreamProtocolIntegrationTest, AddInvalidEncodedData) {
  EXPECT_ENVOY_BUG(
      {
        useAccessLog("%RESPONSE_CODE_DETAILS%");
        config_helper_.prependFilter(R"EOF(
  name: add-invalid-data-filter
  )EOF");
        initialize();
        codec_client_ = makeHttpConnection(lookupPort("http"));
        default_request_headers_.setCopy(Envoy::Http::LowerCaseString("invalid-encode"), "yes");
        auto response = std::move((codec_client_->startRequest(default_request_headers_)).second);
        ASSERT_TRUE(response->waitForEndStream());
        EXPECT_EQ("502", response->headers().getStatusValue());
        EXPECT_THAT(waitForAccessLog(access_log_name_),
                    HasSubstr("filter_added_invalid_response_data"));
      },
      "Invalid response data");
}
TEST_P(DownstreamProtocolIntegrationTest, AddInvalidEncodedData) {
  EXPECT_ENVOY_BUG(
      {
        useAccessLog("%RESPONSE_CODE_DETAILS%");
        config_helper_.prependFilter(R"EOF(
  name: add-invalid-data-filter
  )EOF");
        initialize();
        codec_client_ = makeHttpConnection(lookupPort("http"));
        default_request_headers_.setCopy(Envoy::Http::LowerCaseString("invalid-encode"), "yes");
        auto response = std::move((codec_client_->startRequest(default_request_headers_)).second);
        ASSERT_TRUE(response->waitForEndStream());
        EXPECT_EQ("502", response->headers().getStatusValue());
        EXPECT_THAT(waitForAccessLog(access_log_name_),
                    HasSubstr("filter_added_invalid_response_data"));
      },
      "Invalid response data");
}