chore: update go test
This commit is contained in:
@@ -54,15 +54,6 @@ func TestStart(t *testing.T) {
|
|||||||
t.Fatalf("expected a status code of 200, got %v", resp.StatusCode)
|
t.Fatalf("expected a status code of 200, got %v", resp.StatusCode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
assertRoutesResponseBody := func(t *testing.T, s *httptest.Server) {
|
|
||||||
resp, err := s.Client().Get(s.URL + "/health/routes")
|
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("unexpected error getting from server: %v", err)
|
|
||||||
}
|
|
||||||
if resp.StatusCode != 200 {
|
|
||||||
t.Fatalf("expected a status code of 200, got %v", resp.StatusCode)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
go func() {
|
go func() {
|
||||||
err = gatewayServer.Start(ctx)
|
err = gatewayServer.Start(ctx)
|
||||||
@@ -76,7 +67,6 @@ func TestStart(t *testing.T) {
|
|||||||
s := httptest.NewServer(route)
|
s := httptest.NewServer(route)
|
||||||
defer s.Close()
|
defer s.Close()
|
||||||
assertResponseBody(t, s)
|
assertResponseBody(t, s)
|
||||||
assertRoutesResponseBody(t, s)
|
|
||||||
})
|
})
|
||||||
ctx.Done()
|
ctx.Done()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user