Files
miti99bot/internal/server/router_test.go
T
tiennm99 5bfee58964 refactor(server): drop HTTP /cron route; run crons in-process only
The in-process scheduler is the sole cron trigger on self-host, so the
/cron/{name} HTTP endpoint and its CRON_SHARED_SECRET are dead surface.
Reduce the HTTP server to GET / (health) and remove the cron secret config,
SSM binding, and now-unused timeout.
2026-06-28 22:15:04 +07:00

20 lines
423 B
Go

package server
import (
"net/http"
"net/http/httptest"
"strings"
"testing"
)
func TestHealthHandler_OK(t *testing.T) {
rec := httptest.NewRecorder()
HealthHandler()(rec, httptest.NewRequest(http.MethodGet, "/", nil))
if rec.Code != http.StatusOK {
t.Errorf("status = %d, want 200", rec.Code)
}
if !strings.Contains(rec.Body.String(), "ok") {
t.Errorf("body = %q, want contains 'ok'", rec.Body.String())
}
}