76e4f5790f
Health Endpoint * health
26 lines
464 B
Go
26 lines
464 B
Go
package queryapi_test
|
|
|
|
import (
|
|
"net/http"
|
|
"testing"
|
|
|
|
queryapi "queryorchestration/api/queryAPI"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestIsHealthy(t *testing.T) {
|
|
t.Parallel()
|
|
cfg := &ControllerConfig{}
|
|
|
|
svc := createControllerServices(cfg)
|
|
cons := queryapi.NewControllers(svc)
|
|
|
|
ctx, rec := createContext(t)
|
|
|
|
err := cons.IsHealthy(ctx)
|
|
require.NoError(t, err)
|
|
assert.Equal(t, http.StatusOK, rec.Code)
|
|
}
|