Co-authored-by: Gabriel Radureau <arcodange@gmail.com> Co-committed-by: Gabriel Radureau <arcodange@gmail.com>
47 lines
1.2 KiB
Go
47 lines
1.2 KiB
Go
package steps
|
|
|
|
import (
|
|
"dance-lessons-coach/pkg/bdd/testserver"
|
|
)
|
|
|
|
// HealthSteps holds health-related step definitions
|
|
type HealthSteps struct {
|
|
client *testserver.Client
|
|
scenarioKey string // Track current scenario for state isolation
|
|
}
|
|
|
|
func NewHealthSteps(client *testserver.Client) *HealthSteps {
|
|
return &HealthSteps{client: client}
|
|
}
|
|
|
|
// SetScenarioKey sets the current scenario key for state isolation
|
|
func (s *HealthSteps) SetScenarioKey(key string) {
|
|
s.scenarioKey = key
|
|
}
|
|
|
|
// Health-related steps
|
|
func (s *HealthSteps) iRequestTheHealthEndpoint() error {
|
|
return s.client.Request("GET", "/api/health", nil)
|
|
}
|
|
|
|
func (s *HealthSteps) iRequestTheHealthzEndpoint() error {
|
|
return s.client.Request("GET", "/api/healthz", nil)
|
|
}
|
|
|
|
func (s *HealthSteps) iRequestTheInfoEndpoint() error {
|
|
return s.client.Request("GET", "/api/info", nil)
|
|
}
|
|
|
|
func (s *HealthSteps) iRequestTheInfoEndpointAgain() error {
|
|
return s.client.Request("GET", "/api/info", 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)
|
|
}
|
|
|
|
func (s *HealthSteps) theServerIsRunningWithCacheEnabled() error {
|
|
return s.client.Request("GET", "/api/ready", nil)
|
|
}
|