mirror of
https://git.rwth-aachen.de/acs/public/villas/web-backend-go/
synced 2025-03-30 00:00:12 +01:00
connect to AMQP broker in IC tests
This commit is contained in:
parent
b07cd23a70
commit
cf8775b39d
1 changed files with 12 additions and 0 deletions
|
@ -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) {
|
||||||
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())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue