(t *testing.T)
| 79 | } |
| 80 | |
| 81 | func TestHeaderHTTPHeader(t *testing.T) { |
| 82 | testcases := map[string]struct { |
| 83 | header ProxyHeader |
| 84 | expected http.Header |
| 85 | }{ |
| 86 | "basic": { |
| 87 | header: ProxyHeader{ |
| 88 | "single": []Secret{"v1"}, |
| 89 | "multi": []Secret{"v1", "v2"}, |
| 90 | "empty": []Secret{}, |
| 91 | "nil": nil, |
| 92 | }, |
| 93 | expected: http.Header{ |
| 94 | "single": []string{"v1"}, |
| 95 | "multi": []string{"v1", "v2"}, |
| 96 | "empty": []string{}, |
| 97 | "nil": nil, |
| 98 | }, |
| 99 | }, |
| 100 | "nil": { |
| 101 | header: nil, |
| 102 | expected: nil, |
| 103 | }, |
| 104 | } |
| 105 | |
| 106 | for name, tc := range testcases { |
| 107 | t.Run(name, func(t *testing.T) { |
| 108 | actual := tc.header.HTTPHeader() |
| 109 | require.Truef(t, reflect.DeepEqual(actual, tc.expected), "expecting: %#v, actual: %#v", tc.expected, actual) |
| 110 | }) |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | func TestHeaderYamlUnmarshal(t *testing.T) { |
| 115 | testcases := map[string]struct { |
nothing calls this directly
no test coverage detected