Commit 4fa30923 authored by Sonja Happ's avatar Sonja Happ
Browse files

fixes for healthz endpoint and testing

parent 5faa768b
......@@ -55,8 +55,8 @@ func getHealth(c *gin.Context) {
}
// check if connection to AMQP broker is alive if backend was started with AMQP client
url, err := configuration.GolbalConfig.String("amqp.url")
if err != nil && strings.Contains(err.Error(), "Required setting 'amqp.url' not set") {
url, err := configuration.GolbalConfig.String("amqp.host")
if err != nil && strings.Contains(err.Error(), "Required setting 'amqp.host' not set") {
c.JSON(http.StatusOK, gin.H{})
return
} else if err != nil {
......
......@@ -67,10 +67,10 @@ func TestHealthz(t *testing.T) {
assert.NoError(t, err)
assert.Equalf(t, 500, code, "Response body: \n%v\n", resp)
// connect AMQP client (make sure that AMQP_URL is set via command line parameter -amqp)
url, err := configuration.GolbalConfig.String("amqp.url")
// connect AMQP client (make sure that AMQP_HOST, AMQP_USER, AMQP_PASS are set via command line parameters)
host, err := configuration.GolbalConfig.String("amqp.host")
assert.NoError(t, err)
err = amqp.ConnectAMQP(url)
err = amqp.ConnectAMQP(host)
assert.NoError(t, err)
// test healthz endpoint for connected DB and AMQP client
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment