Skip to content

Commit

Permalink
fix: add unit test
Browse files Browse the repository at this point in the history
Signed-off-by: David van der Spek <vanderspek.david@gmail.com>
  • Loading branch information
davidspek committed Jun 26, 2023
1 parent 63db3f4 commit 206e1e1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pipeline/mutate/mutator_noop_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ func TestMutatorNoop(t *testing.T) {
assert.EqualValues(t, r.Header, s.Header)
})

t.Run("method=mutate/case=ensure authentication session headers are kept", func(t *testing.T) {
r := &http.Request{Header: http.Header{"foo": {"foo"}}}
s := &authn.AuthenticationSession{Header: http.Header{"bar": {"bar"}}}
combinedHeaders := http.Header{"foo": {"foo"}}
combinedHeaders.Set("bar", "bar")
err := a.Mutate(r, s, nil, nil)
require.NoError(t, err)
assert.EqualValues(t, r.Header, combinedHeaders)
})

t.Run("method=validate", func(t *testing.T) {
conf.SetForTest(t, configuration.MutatorNoopIsEnabled, true)
require.NoError(t, a.Validate(nil))
Expand Down

0 comments on commit 206e1e1

Please sign in to comment.