mirror of
https://git.rwth-aachen.de/acs/public/villas/web-backend-go/
synced 2025-03-30 00:00:12 +01:00
user test: set AMQP session in IC package to test scenario duplication (ping is sent from within IC package)
This commit is contained in:
parent
780334592f
commit
ae3e0374f1
1 changed files with 3 additions and 5 deletions
|
@ -864,6 +864,9 @@ func TestDuplicateScenarioForUser(t *testing.T) {
|
||||||
// AMQP Connection startup is tested here
|
// AMQP Connection startup is tested here
|
||||||
// Not repeated in other tests because it is only needed once
|
// Not repeated in other tests because it is only needed once
|
||||||
session = helper.NewAMQPSession("villas-test-session", amqpURI, "villas", infrastructure_component.ProcessMessage)
|
session = helper.NewAMQPSession("villas-test-session", amqpURI, "villas", infrastructure_component.ProcessMessage)
|
||||||
|
//session = helper.NewAMQPSession("villas-test-session", amqpURI, "villas", infrastructure_component.ProcessMessage)
|
||||||
|
SetAMQPSession(session)
|
||||||
|
infrastructure_component.SetAMQPSession(session)
|
||||||
|
|
||||||
// authenticate as admin (needed to create original IC)
|
// authenticate as admin (needed to create original IC)
|
||||||
token, err := helper.AuthenticateForTest(router, database.AdminCredentials)
|
token, err := helper.AuthenticateForTest(router, database.AdminCredentials)
|
||||||
|
@ -916,7 +919,6 @@ func TestDuplicateScenarioForUser(t *testing.T) {
|
||||||
err = addFakeIC(session, token)
|
err = addFakeIC(session, token)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
SetAMQPSession(session)
|
|
||||||
if err := <-duplicateScenarioForUser(originalSo, &myUser.User); err != nil {
|
if err := <-duplicateScenarioForUser(originalSo, &myUser.User); err != nil {
|
||||||
t.Fail()
|
t.Fail()
|
||||||
}
|
}
|
||||||
|
@ -1201,9 +1203,6 @@ func addIC(session *helper.AMQPsession, token string) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
//session = helper.NewAMQPSession("villas-test-session", amqpURI, "villas", infrastructure_component.ProcessMessage)
|
|
||||||
SetAMQPSession(session)
|
|
||||||
|
|
||||||
//time.Sleep(3 * time.Second)
|
//time.Sleep(3 * time.Second)
|
||||||
|
|
||||||
err = session.CheckConnection()
|
err = session.CheckConnection()
|
||||||
|
@ -1250,7 +1249,6 @@ func addFakeIC(session *helper.AMQPsession, token string) error {
|
||||||
|
|
||||||
//session = helper.NewAMQPSession("villas-test-session", amqpURI, "villas", infrastructure_component.ProcessMessage)
|
//session = helper.NewAMQPSession("villas-test-session", amqpURI, "villas", infrastructure_component.ProcessMessage)
|
||||||
log.Println(session)
|
log.Println(session)
|
||||||
SetAMQPSession(session)
|
|
||||||
|
|
||||||
//time.Sleep(3 * time.Second)
|
//time.Sleep(3 * time.Second)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue