Support for NOMA + some minor code refactoring
[ric-plt/alarm-go.git] / manager / cmd / manager_test.go
index a7274c2..2589a91 100755 (executable)
@@ -48,7 +48,7 @@ var eventChan chan string
 
 // Test cases
 func TestMain(M *testing.M) {
-       alarmManager = NewAlarmManager("localhost:9093", 500)
+       alarmManager = NewAlarmManager("localhost:9093", 500, false)
        alarmManager.alertInterval = 20000
        go alarmManager.Run(false)
        time.Sleep(time.Duration(10) * time.Second)
@@ -339,7 +339,7 @@ func TestGetPrometheusAlerts(t *testing.T) {
 
        commandReady := make(chan bool, 1)
        command := "cli/alarm-cli"
-       args := []string {"gapam", "--active", "true", "--inhibited", "true", "--silenced", "--unprocessed", "true", "true", "--host", "localhost", "--port", "9093", "flushall"}
+       args := []string{"gapam", "--active", "true", "--inhibited", "true", "--silenced", "--unprocessed", "true", "true", "--host", "localhost", "--port", "9093", "flushall"}
        ExecCLICommand(commandReady, command, args...)
        <-commandReady
 
@@ -398,8 +398,8 @@ func CreatePromAlertSimulator2(t *testing.T, method, url string) *httptest.Serve
                w.WriteHeader(200)
                // Read alerts from file
                payload, err := readJSONFromFile("../testresources/prometheus-alerts.json")
-                       if err != nil {
-                               t.Error("Failed to send response: ", err)
+               if err != nil {
+                       t.Error("Failed to send response: ", err)
                }
                _, err = w.Write(payload)
                if err != nil {