Skip to content

Commit

Permalink
forgot to change copy-pasted tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobm-splunk authored and daveshanley committed Mar 26, 2024
1 parent a69fe02 commit 8b09671
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions config/paths_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,26 +264,26 @@ func TestIgnoreRedirect_NoPathsRegistered(t *testing.T) {

func TestRedirectAllowList(t *testing.T) {

config := `ignoreRedirects:
config := `redirectAllowList:
- /pb33f/test/**
- /pb33f/cakes/123
- /*/test/123`

var c shared.WiretapConfiguration
_ = yaml.Unmarshal([]byte(config), &c)

c.CompileIgnoreRedirects()
c.CompileRedirectAllowList()

ignore := IgnoreRedirectOnPath("/pb33f/test/burgers/fries?1234=no", &c)
ignore := PathRedirectAllowListed("/pb33f/test/burgers/fries?1234=no", &c)
assert.True(t, ignore)

ignore = IgnoreRedirectOnPath("/pb33f/cakes/123", &c)
ignore = PathRedirectAllowListed("/pb33f/cakes/123", &c)
assert.True(t, ignore)

ignore = IgnoreRedirectOnPath("/roastbeef/test/123", &c)
ignore = PathRedirectAllowListed("/roastbeef/test/123", &c)
assert.True(t, ignore)

ignore = IgnoreRedirectOnPath("/not-registered", &c)
ignore = PathRedirectAllowListed("/not-registered", &c)
assert.False(t, ignore)

}
Expand All @@ -293,18 +293,18 @@ func TestRedirectAllowList_NoPathsRegistered(t *testing.T) {
var c shared.WiretapConfiguration
_ = yaml.Unmarshal([]byte(""), &c)

c.CompileIgnoreRedirects()
c.CompileRedirectAllowList()

ignore := IgnoreRedirectOnPath("/pb33f/test/burgers/fries?1234=no", &c)
ignore := PathRedirectAllowListed("/pb33f/test/burgers/fries?1234=no", &c)
assert.False(t, ignore)

ignore = IgnoreRedirectOnPath("/pb33f/cakes/123", &c)
ignore = PathRedirectAllowListed("/pb33f/cakes/123", &c)
assert.False(t, ignore)

ignore = IgnoreRedirectOnPath("/roastbeef/test/123", &c)
ignore = PathRedirectAllowListed("/roastbeef/test/123", &c)
assert.False(t, ignore)

ignore = IgnoreRedirectOnPath("/not-registered", &c)
ignore = PathRedirectAllowListed("/not-registered", &c)
assert.False(t, ignore)

}

0 comments on commit 8b09671

Please sign in to comment.