mirror of https://github.com/dexidp/dex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
470 B
24 lines
470 B
package server |
|
|
|
import ( |
|
"net/http" |
|
"net/http/httptest" |
|
"testing" |
|
|
|
"golang.org/x/net/context" |
|
) |
|
|
|
func TestHandleHealth(t *testing.T) { |
|
ctx, cancel := context.WithCancel(context.Background()) |
|
defer cancel() |
|
|
|
httpServer, server := newTestServer(t, ctx, nil) |
|
defer httpServer.Close() |
|
|
|
rr := httptest.NewRecorder() |
|
server.handleHealth(rr, httptest.NewRequest("GET", "/healthz", nil)) |
|
if rr.Code != http.StatusOK { |
|
t.Errorf("expected 200 got %d", rr.Code) |
|
} |
|
|
|
}
|
|
|