Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ACS
Public
VILLASframework
VILLASweb-backend-go
Commits
c1c28e7e
Commit
c1c28e7e
authored
Oct 12, 2020
by
Sonja Happ
Browse files
Re-activate AMQP related parts of healthz test
parent
d7586a91
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
routes/healthz/healthz_test.go
View file @
c1c28e7e
...
...
@@ -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
)
}
Write
Preview
Supports
Markdown
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