- Split steps into domain-specific files: - greet_steps.go: Greet API steps - health_steps.go: Health check steps - auth_steps.go: Authentication steps with full JWT implementation - common_steps.go: Shared validation steps - Add comprehensive README.md for steps organization - Implement all TODO items in auth_steps: - JWT claims verification for admin - JWT token validation and parsing - User ID extraction from tokens - Token comparison for consecutive authentications - Update main steps.go to register all domain steps Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
25 lines
598 B
Go
25 lines
598 B
Go
package steps
|
|
|
|
import (
|
|
"dance-lessons-coach/pkg/bdd/testserver"
|
|
)
|
|
|
|
// HealthSteps holds health-related step definitions
|
|
type HealthSteps struct {
|
|
client *testserver.Client
|
|
}
|
|
|
|
func NewHealthSteps(client *testserver.Client) *HealthSteps {
|
|
return &HealthSteps{client: client}
|
|
}
|
|
|
|
// Health-related steps
|
|
func (s *HealthSteps) iRequestTheHealthEndpoint() error {
|
|
return s.client.Request("GET", "/api/health", nil)
|
|
}
|
|
|
|
func (s *HealthSteps) theServerIsRunning() error {
|
|
// Actually verify the server is running by checking the readiness endpoint
|
|
return s.client.Request("GET", "/api/ready", nil)
|
|
}
|