Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dex
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
dex
Commits
aa83e7e5
Commit
aa83e7e5
authored
Oct 05, 2016
by
Eric Chiang
Committed by
GitHub
Oct 05, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #589 from ericchiang/dev-health-check-add-test
server: add a test for the health check handler
parents
e873a31b
9243a092
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
handlers_test.go
server/handlers_test.go
+18
-0
No files found.
server/handlers_test.go
View file @
aa83e7e5
package
server
package
server
import
(
"net/http"
"net/http/httptest"
"testing"
)
func
TestHandleHealth
(
t
*
testing
.
T
)
{
httpServer
,
server
:=
newTestServer
(
t
,
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
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment