🧪 test: implement comprehensive BDD test suite for JWT secret rotation
- Added JWT secret rotation feature tests - Implemented config management BDD steps - Created greet service BDD scenarios - Enhanced test server with JWT rotation support - Added comprehensive step definitions Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"dance-lessons-coach/pkg/bdd/testserver"
|
||||
|
||||
"github.com/cucumber/godog"
|
||||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
||||
// StepContext holds the test client and implements all step definitions
|
||||
@@ -30,6 +31,16 @@ func NewStepContext(client *testserver.Client) *StepContext {
|
||||
}
|
||||
}
|
||||
|
||||
// CleanupAllTestConfigFiles cleans up any test config files created during tests
|
||||
func CleanupAllTestConfigFiles() error {
|
||||
// Cleanup config hot reloading test file
|
||||
configSteps := &ConfigSteps{configFilePath: "test-config.yaml"}
|
||||
if err := configSteps.CleanupTestConfigFile(); err != nil {
|
||||
log.Warn().Err(err).Msg("Failed to cleanup config test file")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// InitializeAllSteps registers all step definitions for the BDD tests
|
||||
func InitializeAllSteps(ctx *godog.ScenarioContext, client *testserver.Client) {
|
||||
sc := NewStepContext(client)
|
||||
|
||||
Reference in New Issue
Block a user