Skip to content

Commit

Permalink
fixing tests
Browse files Browse the repository at this point in the history
Signed-off-by: Yanjun Xiang <[email protected]>
  • Loading branch information
yanjunxiang-google committed Jul 26, 2023
1 parent 6592b67 commit f55bbf8
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions test/extensions/filters/http/ext_proc/ext_proc_integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1038,9 +1038,9 @@ TEST_P(ExtProcIntegrationTest, GetAndSetBodyAndHeadersAndTrailersOnResponse) {
EXPECT_THAT(*(response->trailers()), SingleHeaderValueIs("x-modified-trailers", "xxx"));
}

// Test the filter using a configuration that processes response trailers, and process an upstream
// response that has no trailers.
TEST_P(ExtProcIntegrationTest, AddTrailersOnResponse) {
// Test the filter using a configuration that sends response headers and trailers,
// and process an upstream response that has no trailers.
TEST_P(ExtProcIntegrationTest, NoTrailersOnResponseWithModeSendHeaderTrailer) {
proto_config_.mutable_processing_mode()->set_response_trailer_mode(ProcessingMode::SEND);
initializeConfig();
HttpIntegrationTest::initialize();
Expand All @@ -1052,6 +1052,22 @@ TEST_P(ExtProcIntegrationTest, AddTrailersOnResponse) {
verifyDownstreamResponse(*response, 200);
}

// Test the filter using a configuration that sends response body and trailers, and process
// an upstream response that has no trailers.
TEST_P(ExtProcIntegrationTest, NoTrailersOnResponseWithModeSendBodyTrailer) {
proto_config_.mutable_processing_mode()->set_request_header_mode(ProcessingMode::SKIP);
proto_config_.mutable_processing_mode()->set_response_header_mode(ProcessingMode::SKIP);
proto_config_.mutable_processing_mode()->set_response_body_mode(ProcessingMode::BUFFERED);
proto_config_.mutable_processing_mode()->set_response_trailer_mode(ProcessingMode::SEND);
initializeConfig();
HttpIntegrationTest::initialize();
auto response = sendDownstreamRequest(absl::nullopt);
handleUpstreamRequest();
processResponseBodyMessage(*grpc_upstreams_[0], true, absl::nullopt);

verifyDownstreamResponse(*response, 200);
}

// Test the filter with a response body callback enabled using an
// an ext_proc server that responds to the response_body message
// by requesting to modify the response body and headers, using a response
Expand Down

0 comments on commit f55bbf8

Please sign in to comment.