18 lines
415 B
Go
18 lines
415 B
Go
package httpapi
|
|
|
|
import (
|
|
"net/http/httptest"
|
|
"testing"
|
|
)
|
|
|
|
func TestOperationalShellDoesNotClaimReadiness(t *testing.T) {
|
|
handler := New()
|
|
for path, want := range map[string]int{"/healthz": 200, "/readyz": 503, "/api/v1/session": 404} {
|
|
w := httptest.NewRecorder()
|
|
handler.ServeHTTP(w, httptest.NewRequest("GET", path, nil))
|
|
if w.Code != want {
|
|
t.Errorf("%s: %d, want %d", path, w.Code, want)
|
|
}
|
|
}
|
|
}
|