From c8d2f2120e7a7eef011ba63935b5ea15ebd89ab7 Mon Sep 17 00:00:00 2001 From: Nathan Coleman Date: Fri, 1 Sep 2023 15:19:11 -0400 Subject: [PATCH] Make existing unit tests more robust --- agent/consul/discoverychain/gateway_test.go | 28 ++++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/agent/consul/discoverychain/gateway_test.go b/agent/consul/discoverychain/gateway_test.go index cec49d435c9e1..641479fb58180 100644 --- a/agent/consul/discoverychain/gateway_test.go +++ b/agent/consul/discoverychain/gateway_test.go @@ -518,6 +518,24 @@ func TestGatewayChainSynthesizer_Synthesize(t *testing.T) { Kind: structs.HTTPRoute, Name: "http-route", Rules: []structs.HTTPRouteRule{{ + Filters: structs.HTTPFilters{ + Headers: []structs.HTTPHeaderFilter{ + { + Add: map[string]string{"add me on the request": "hello world"}, + Set: map[string]string{"set me on the request": "hello world"}, + Remove: []string{"remove me on the request"}, + }, + }, + }, + ResponseFilters: structs.HTTPResponseFilters{ + Headers: []structs.HTTPHeaderFilter{ + { + Add: map[string]string{"add me on the response": "hello world"}, + Set: map[string]string{"set me on the response": "hello world"}, + Remove: []string{"remove me on the response"}, + }, + }, + }, Services: []structs.HTTPService{{ Name: "foo", }}, @@ -557,12 +575,14 @@ func TestGatewayChainSynthesizer_Synthesize(t *testing.T) { Partition: "default", Namespace: "default", RequestHeaders: &structs.HTTPHeaderModifiers{ - Add: make(map[string]string), - Set: make(map[string]string), + Add: map[string]string{"add me on the request": "hello world"}, + Set: map[string]string{"set me on the request": "hello world"}, + Remove: []string{"remove me on the request"}, }, ResponseHeaders: &structs.HTTPHeaderModifiers{ - Add: make(map[string]string), - Set: make(map[string]string), + Add: map[string]string{"add me on the response": "hello world"}, + Set: map[string]string{"set me on the response": "hello world"}, + Remove: []string{"remove me on the response"}, }, }, },