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
cf8775b3
Commit
cf8775b3
authored
Oct 21, 2020
by
Sonja Happ
Browse files
connect to AMQP broker in IC tests
parent
b07cd23a
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
routes/infrastructure-component/ic_test.go
View file @
cf8775b3
...
...
@@ -26,6 +26,7 @@ import (
"git.rwth-aachen.de/acs/public/villas/web-backend-go/helper"
"github.com/jinzhu/gorm/dialects/postgres"
"github.com/stretchr/testify/assert"
"log"
"os"
"testing"
...
...
@@ -70,6 +71,17 @@ func TestMain(m *testing.M) {
user
.
RegisterAuthenticate
(
api
.
Group
(
"/authenticate"
))
api
.
Use
(
user
.
Authentication
(
true
))
RegisterICEndpoints
(
api
.
Group
(
"/ic"
))
RegisterAMQPEndpoint
(
api
.
Group
(
"/ic"
))
// 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"
)
user
,
err
:=
configuration
.
GolbalConfig
.
String
(
"amqp.user"
)
pass
,
err
:=
configuration
.
GolbalConfig
.
String
(
"amqp.pass"
)
amqpURI
:=
"amqp://"
+
user
+
":"
+
pass
+
"@"
+
host
log
.
Println
(
"AMQP URI is"
,
amqpURI
)
err
=
ConnectAMQP
(
amqpURI
)
os
.
Exit
(
m
.
Run
())
}
...
...
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