This commit is contained in:
2025-08-22 17:32:57 -04:00
parent 74fc72ef4a
commit d648a55c0c
18 changed files with 3687 additions and 308 deletions

View File

@ -29,6 +29,10 @@ func (c *TestConfig) GetBool(key string) bool {
return boolVal
}
}
// Special handling for cache enabled
if key == "CACHE_ENABLED" {
return c.values[key] == "true"
}
return false
}
@ -86,6 +90,10 @@ func (c *TestConfig) IsProduction() bool {
return c.GetString("APP_ENV") == "production"
}
func (c *TestConfig) GetJWTSecret() string {
return c.GetString("JWT_SECRET")
}
// NewTestConfig creates a test configuration with default values
func NewTestConfig() *TestConfig {
return &TestConfig{
@ -99,6 +107,12 @@ func NewTestConfig() *TestConfig {
"SERVER_HOST": "localhost",
"SERVER_PORT": "8080",
"APP_ENV": "test",
"JWT_SECRET": "test-jwt-secret-for-testing-only",
},
}
}
// NewMockConfig creates a mock configuration (alias for NewTestConfig for backward compatibility)
func NewMockConfig() *TestConfig {
return NewTestConfig()
}