From 73d02e85c40d78bf7cb05bddd510331b7240edfa Mon Sep 17 00:00:00 2001 From: Jonas Geiler Date: Mon, 27 May 2024 11:27:40 +0200 Subject: [PATCH] refactor(api): improved tests and test messages Co-authored-by: Julien Neuhart --- pkg/modules/api/api_test.go | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/pkg/modules/api/api_test.go b/pkg/modules/api/api_test.go index 6a6e90db..19a5c0ca 100644 --- a/pkg/modules/api/api_test.go +++ b/pkg/modules/api/api_test.go @@ -489,7 +489,7 @@ func TestApi_Validate(t *testing.T) { expectError: true, }, { - scenario: "invalid tls files: only cert file provided", + scenario: "invalid TLS files: only cert file provided", port: 10, tlsCertFile: "cert.pem", rootPath: "/foo/", @@ -499,7 +499,7 @@ func TestApi_Validate(t *testing.T) { expectError: true, }, { - scenario: "invalid tls files: only key file provided", + scenario: "invalid TLS files: only key file provided", port: 10, tlsKeyFile: "key.pem", rootPath: "/foo/", @@ -670,7 +670,7 @@ func TestApi_Validate(t *testing.T) { }, }, { - scenario: "success with tls", + scenario: "success with TLS", port: 10, tlsCertFile: "cert.pem", tlsKeyFile: "key.pem", @@ -689,18 +689,6 @@ func TestApi_Validate(t *testing.T) { IsMultipart: true, }, }, - middlewares: []Middleware{ - { - Priority: HighPriority, - Handler: func() echo.MiddlewareFunc { - return func(next echo.HandlerFunc) echo.HandlerFunc { - return func(c echo.Context) error { - return next(c) - } - } - }(), - }, - }, }, } { t.Run(tc.scenario, func(t *testing.T) { @@ -751,7 +739,7 @@ func TestApi_Start(t *testing.T) { expectError: false, }, { - scenario: "success with tls", + scenario: "success with TLS", readyFn: []func() error{ func() error { return nil }, func() error { return nil },