Commit cf8775b3 authored by Sonja Happ's avatar Sonja Happ
Browse files

connect to AMQP broker in IC tests

parent b07cd23a
...@@ -26,6 +26,7 @@ import ( ...@@ -26,6 +26,7 @@ import (
"git.rwth-aachen.de/acs/public/villas/web-backend-go/helper" "git.rwth-aachen.de/acs/public/villas/web-backend-go/helper"
"github.com/jinzhu/gorm/dialects/postgres" "github.com/jinzhu/gorm/dialects/postgres"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"log"
"os" "os"
"testing" "testing"
...@@ -70,6 +71,17 @@ func TestMain(m *testing.M) { ...@@ -70,6 +71,17 @@ func TestMain(m *testing.M) {
user.RegisterAuthenticate(api.Group("/authenticate")) user.RegisterAuthenticate(api.Group("/authenticate"))
api.Use(user.Authentication(true)) api.Use(user.Authentication(true))
RegisterICEndpoints(api.Group("/ic")) 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()) 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