From 0fc8ee54295e156eb30abba5b6d21aefbc11a885 Mon Sep 17 00:00:00 2001 From: Auni Ahsan Date: Thu, 21 Jan 2021 03:53:58 +0000 Subject: [PATCH] Add PassThroughDecoderFilter Signed-off-by: Auni Ahsan --- test/server/BUILD | 1 + test/server/filter_config_test.cc | 21 ++------------------- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/test/server/BUILD b/test/server/BUILD index d43184a1636f..19f471982fc8 100644 --- a/test/server/BUILD +++ b/test/server/BUILD @@ -104,6 +104,7 @@ envoy_cc_test( name = "filter_config_test", srcs = ["filter_config_test.cc"], deps = [ + "//source/extensions/filters/http/common:pass_through_filter_lib", "//include/envoy/server:filter_config_interface", "//test/mocks/server:server_mocks", ], diff --git a/test/server/filter_config_test.cc b/test/server/filter_config_test.cc index 3831497d1cf4..9352b430b3e2 100644 --- a/test/server/filter_config_test.cc +++ b/test/server/filter_config_test.cc @@ -1,5 +1,6 @@ #include "envoy/server/filter_config.h" +#include "extensions/filters/http/common/pass_through_filter.h" #include "test/mocks/server/factory_context.h" #include "gmock/gmock.h" @@ -8,24 +9,6 @@ namespace Envoy { namespace { -class TestHttpFilter : public Http::StreamDecoderFilter { -public: - TestHttpFilter() = default; - - Http::FilterHeadersStatus decodeHeaders(Http::RequestHeaderMap&, bool) override { - return Envoy::Http::FilterHeadersStatus::Continue; - } - Http::FilterDataStatus decodeData(Buffer::Instance&, bool) override { - return Envoy::Http::FilterDataStatus::Continue; - } - Http::FilterTrailersStatus decodeTrailers(Http::RequestTrailerMap&) override { - return Envoy::Http::FilterTrailersStatus::Continue; - } - - void setDecoderFilterCallbacks(Http::StreamDecoderFilterCallbacks&) override {} - void onDestroy() override{}; -}; - class TestHttpFilterConfigFactory : public Server::Configuration::NamedHttpFilterConfigFactory { public: TestHttpFilterConfigFactory() = default; @@ -34,7 +17,7 @@ class TestHttpFilterConfigFactory : public Server::Configuration::NamedHttpFilte createFilterFactoryFromProto(const Protobuf::Message&, const std::string&, Server::Configuration::FactoryContext&) override { return [](Http::FilterChainFactoryCallbacks& callbacks) -> void { - callbacks.addStreamDecoderFilter(std::make_shared()); + callbacks.addStreamDecoderFilter(std::make_shared()); }; }