From c1c28e7e1932510d76541de8b18c660e8e09c64b Mon Sep 17 00:00:00 2001 From: Sonja Happ Date: Mon, 12 Oct 2020 12:26:57 +0200 Subject: [PATCH] Re-activate AMQP related parts of healthz test --- routes/healthz/healthz_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/routes/healthz/healthz_test.go b/routes/healthz/healthz_test.go index a49a1e1..24e4a61 100644 --- a/routes/healthz/healthz_test.go +++ b/routes/healthz/healthz_test.go @@ -22,6 +22,7 @@ package healthz import ( + "git.rwth-aachen.de/acs/public/villas/web-backend-go/amqp" "git.rwth-aachen.de/acs/public/villas/web-backend-go/configuration" "git.rwth-aachen.de/acs/public/villas/web-backend-go/database" "git.rwth-aachen.de/acs/public/villas/web-backend-go/helper" @@ -77,12 +78,11 @@ func TestHealthz(t *testing.T) { amqpURI := "amqp://" + user + ":" + pass + "@" + host log.Println("AMQP URI is", amqpURI) - //TODO find a solution how testing can work here if receive loop of AMQP channel never exits - //err = amqp.ConnectAMQP(amqpURI) - //assert.NoError(t, err) + err = amqp.ConnectAMQP(amqpURI) + assert.NoError(t, err) // test healthz endpoint for connected DB and AMQP client - //code, resp, err = helper.TestEndpoint(router, "", "healthz", http.MethodGet, nil) - //assert.NoError(t, err) - //assert.Equalf(t, 200, code, "Response body: \n%v\n", resp) + code, resp, err = helper.TestEndpoint(router, "", "healthz", http.MethodGet, nil) + assert.NoError(t, err) + assert.Equalf(t, 200, code, "Response body: \n%v\n", resp) }