1- package traefikiprules_test
1+ package TraefikIPRules_test
22
33import (
44 "context"
5- traefikiprules "github.com/sproutmaster/TraefikIPRules"
5+ "github.com/sproutmaster/TraefikIPRules"
66 "github.com/stretchr/testify/assert"
77 "github.com/stretchr/testify/require"
88 "net/http"
@@ -52,14 +52,14 @@ func TestNew(t *testing.T) {
5252 t .Run (test .desc , func (t * testing.T ) {
5353 t .Parallel ()
5454
55- cfg := traefikiprules .CreateConfig ()
55+ cfg := TraefikIPRules .CreateConfig ()
5656 cfg .DenyList = test .denyList
5757 cfg .AllowList = test .allowList
5858
5959 ctx := context .Background ()
6060 next := http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {})
6161
62- handler , err := traefikiprules .New (ctx , next , cfg , "ipRule plugin" )
62+ handler , err := TraefikIPRules .New (ctx , next , cfg , "ipRule plugin" )
6363
6464 if test .expectedError {
6565 assert .Error (t , err )
@@ -158,15 +158,15 @@ func TestServeHTTP(t *testing.T) {
158158 t .Run (test .desc , func (t * testing.T ) {
159159 t .Parallel ()
160160
161- cfg := traefikiprules .CreateConfig ()
161+ cfg := TraefikIPRules .CreateConfig ()
162162 cfg .DenyList = test .denyList
163163 cfg .AllowList = test .allowList
164164
165165 ctx := context .Background ()
166166 next := http .HandlerFunc (func (rw http.ResponseWriter , req * http.Request ) {})
167167 recorder := httptest .NewRecorder ()
168168
169- handler , err := traefikiprules .New (ctx , next , cfg , "ip-processor-plugin" )
169+ handler , err := TraefikIPRules .New (ctx , next , cfg , "ip-processor-plugin" )
170170 require .NoError (t , err )
171171
172172 req , err := http .NewRequestWithContext (ctx , http .MethodGet , "http://localhost" , nil )
@@ -186,7 +186,7 @@ func TestServeHTTP(t *testing.T) {
186186}
187187
188188func TestCreateConfig (t * testing.T ) {
189- cfg := traefikiprules .CreateConfig ()
189+ cfg := TraefikIPRules .CreateConfig ()
190190 assert .NotNil (t , cfg )
191191 assert .Empty (t , cfg .DenyList )
192192 assert .Empty (t , cfg .AllowList )
0 commit comments