Merge "Send notification for Connected status"
[ric-plt/e2mgr.git] / E2Manager / services / ran_alarm_service_test.go
1 package services
2
3 import (
4         "e2mgr/configuration"
5         "e2mgr/logger"
6         "gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities"
7         "testing"
8         "github.com/stretchr/testify/assert"
9 )
10
11
12 func RanAlarmServiceTest(t *testing.T) (RanAlarmService, *logger.Logger, *configuration.Configuration) {
13     DebugLevel := int8(4)
14     logger, err := logger.InitLogger(DebugLevel)
15         if err != nil {
16                 t.Errorf("#... - failed to initialize logger, error: %s", err)
17         }
18     config := &configuration.Configuration{RnibRetryIntervalMs: 10, MaxRnibConnectionAttempts: 3}
19     ranAlarmServiceInstance := NewRanAlarmService(logger , config)
20     return ranAlarmServiceInstance,logger, config
21 }
22
23
24 func TestSetConnectivityChangeAlarmTest(t *testing.T){
25      ranAlarmServiceInstance,_,_ := RanAlarmServiceTest(t)
26      nodebInfo := &entities.NodebInfo{}
27      err := ranAlarmServiceInstance.SetConnectivityChangeAlarm(nodebInfo)
28      assert.Nil(t,err)
29 }
30