Commit 9543f041 authored by Sonja Happ's avatar Sonja Happ
Browse files

connect to AMQP broker in register endpoint tests

parent 03341dbe
......@@ -25,6 +25,7 @@ package routes
import (
"git.rwth-aachen.de/acs/public/villas/web-backend-go/configuration"
"git.rwth-aachen.de/acs/public/villas/web-backend-go/database"
infrastructure_component "git.rwth-aachen.de/acs/public/villas/web-backend-go/routes/infrastructure-component"
"github.com/gin-gonic/gin"
"github.com/stretchr/testify/assert"
"os"
......@@ -47,6 +48,15 @@ func TestMain(m *testing.M) {
router = gin.Default()
// 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
err = infrastructure_component.ConnectAMQP(amqpURI)
os.Exit(m.Run())
}
......
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