Skip to content

Commit

Permalink
formatter: updated req_without_query tests
Browse files Browse the repository at this point in the history
Signed-off-by: Tero Saarni <[email protected]>
  • Loading branch information
tsaarni committed Jun 11, 2021
1 parent b16deb1 commit 708c346
Showing 1 changed file with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ TEST_F(ReqWithoutQueryTest, TestStripQueryString) {
TestUtility::loadFromYaml(yaml, config_);

auto formatter =
Envoy::Formatter::SubstitutionFormatStringUtils::fromProtoConfig(config_, context_.api());
Envoy::Formatter::SubstitutionFormatStringUtils::fromProtoConfig(config_, context_);
EXPECT_EQ("/request/path", formatter->format(request_headers_, response_headers_,
response_trailers_, stream_info_, body_));
}
Expand All @@ -59,7 +59,7 @@ TEST_F(ReqWithoutQueryTest, TestSelectMainHeader) {
TestUtility::loadFromYaml(yaml, config_);

auto formatter =
Envoy::Formatter::SubstitutionFormatStringUtils::fromProtoConfig(config_, context_.api());
Envoy::Formatter::SubstitutionFormatStringUtils::fromProtoConfig(config_, context_);
EXPECT_EQ("/original/path", formatter->format(request_headers_, response_headers_,
response_trailers_, stream_info_, body_));
}
Expand All @@ -77,7 +77,7 @@ TEST_F(ReqWithoutQueryTest, TestSelectAlternativeHeader) {
TestUtility::loadFromYaml(yaml, config_);

auto formatter =
Envoy::Formatter::SubstitutionFormatStringUtils::fromProtoConfig(config_, context_.api());
Envoy::Formatter::SubstitutionFormatStringUtils::fromProtoConfig(config_, context_);
EXPECT_EQ("/request/path", formatter->format(request_headers_, response_headers_,
response_trailers_, stream_info_, body_));
}
Expand All @@ -95,7 +95,7 @@ TEST_F(ReqWithoutQueryTest, TestTruncateHeader) {
TestUtility::loadFromYaml(yaml, config_);

auto formatter =
Envoy::Formatter::SubstitutionFormatStringUtils::fromProtoConfig(config_, context_.api());
Envoy::Formatter::SubstitutionFormatStringUtils::fromProtoConfig(config_, context_);
EXPECT_EQ("/requ", formatter->format(request_headers_, response_headers_, response_trailers_,
stream_info_, body_));
}
Expand All @@ -113,7 +113,7 @@ TEST_F(ReqWithoutQueryTest, TestNonExistingHeader) {
TestUtility::loadFromYaml(yaml, config_);

auto formatter =
Envoy::Formatter::SubstitutionFormatStringUtils::fromProtoConfig(config_, context_.api());
Envoy::Formatter::SubstitutionFormatStringUtils::fromProtoConfig(config_, context_);
EXPECT_EQ("-", formatter->format(request_headers_, response_headers_, response_trailers_,
stream_info_, body_));
}
Expand Down Expand Up @@ -141,7 +141,7 @@ TEST_F(ReqWithoutQueryTest, TestFormatJson) {

TestUtility::loadFromYaml(yaml, config_);
auto formatter =
Envoy::Formatter::SubstitutionFormatStringUtils::fromProtoConfig(config_, context_.api());
Envoy::Formatter::SubstitutionFormatStringUtils::fromProtoConfig(config_, context_);
const std::string actual = formatter->format(request_headers_, response_headers_,
response_trailers_, stream_info_, body_);
EXPECT_TRUE(TestUtility::jsonStringEqual(actual, expected));
Expand All @@ -159,9 +159,8 @@ TEST_F(ReqWithoutQueryTest, TestParserNotRecognizingCommand) {
)EOF";
TestUtility::loadFromYaml(yaml, config_);

EXPECT_THROW(
Envoy::Formatter::SubstitutionFormatStringUtils::fromProtoConfig(config_, context_.api()),
EnvoyException);
EXPECT_THROW(Envoy::Formatter::SubstitutionFormatStringUtils::fromProtoConfig(config_, context_),
EnvoyException);
}

} // namespace Formatter
Expand Down

0 comments on commit 708c346

Please sign in to comment.