From fb3ced428ff18164e2d63f867cfb58725b7605ef Mon Sep 17 00:00:00 2001 From: Guilherme Salazar Date: Wed, 13 Mar 2024 15:23:54 -0300 Subject: [PATCH] wip --- test/test_test.go | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/test/test_test.go b/test/test_test.go index fc52f86..c70c43e 100644 --- a/test/test_test.go +++ b/test/test_test.go @@ -18,15 +18,12 @@ type Config struct { shouldExit bool } -func MockNew() *Config { - return &Config{ - // manually change me to see both ways - shouldExit: true, - } -} - // Plugin used for tests func (conf *Config) Access(kong *pdk.PDK) { + if conf.shouldExit { + kong.Response.Exit(http.StatusInternalServerError, []byte(errors.New("exit").Error()), nil) + } + path, err := kong.Request.GetPath() if err != nil { kong.Response.Exit(http.StatusInternalServerError, []byte(err.Error()), nil) @@ -54,12 +51,6 @@ func (conf *Config) Access(kong *pdk.PDK) { } } -func (c *Config) Response(kong *pdk.PDK) { - if c.shouldExit { - kong.Response.Exit(http.StatusInternalServerError, []byte(errors.New("exit").Error()), nil) - } -} - func TestNoHangingChannel(t *testing.T) { t.Parallel()