diff options
Diffstat (limited to 'api/cmd/main_test.go')
-rw-r--r-- | api/cmd/main_test.go | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/api/cmd/main_test.go b/api/cmd/main_test.go index 049cf6e..a4db57a 100644 --- a/api/cmd/main_test.go +++ b/api/cmd/main_test.go | |||
@@ -8,15 +8,12 @@ import ( | |||
8 | "testing" | 8 | "testing" |
9 | "water/api/internal/router" | 9 | "water/api/internal/router" |
10 | 10 | ||
11 | "github.com/spf13/viper" | ||
12 | "github.com/stretchr/testify/assert" | 11 | "github.com/stretchr/testify/assert" |
12 | "water/api/internal/config" | ||
13 | ) | 13 | ) |
14 | 14 | ||
15 | func getTestUserCredentials() (string, string) { | 15 | func getTestUserCredentials() (string, string) { |
16 | viper.SetConfigFile("../.env") | 16 | viper, err := config.Load() |
17 | viper.AddConfigPath(".") | ||
18 | viper.AutomaticEnv() | ||
19 | err := viper.ReadInConfig() | ||
20 | if err != nil { | 17 | if err != nil { |
21 | log.Fatalf("Error while reading config file %s", err) | 18 | log.Fatalf("Error while reading config file %s", err) |
22 | } | 19 | } |
@@ -31,9 +28,6 @@ func TestAuthRoute(t *testing.T) { | |||
31 | 28 | ||
32 | username, password := getTestUserCredentials() | 29 | username, password := getTestUserCredentials() |
33 | 30 | ||
34 | log.Println("username", username) | ||
35 | log.Println("password", password) | ||
36 | |||
37 | w := httptest.NewRecorder() | 31 | w := httptest.NewRecorder() |
38 | req, err := http.NewRequest("POST", "/api/v1/auth", nil) | 32 | req, err := http.NewRequest("POST", "/api/v1/auth", nil) |
39 | if err != nil { | 33 | if err != nil { |