Remove utils module
[ric-plt/alarm-go.git] / manager / cmd / restapi_test.go
index 90954af..bc3a79f 100755 (executable)
@@ -23,11 +23,12 @@ package main
 import (
        "bytes"
        "encoding/json"
-       "github.com/stretchr/testify/assert"
        "net/http"
        "net/http/httptest"
        "testing"
 
+       "github.com/stretchr/testify/assert"
+
        "gerrit.o-ran-sc.org/r/ric-plt/alarm-go/alarm"
 )
 
@@ -85,3 +86,17 @@ func TestClearAlarmRESTInterface(t *testing.T) {
        assert.Equal(t, true, rr != nil)
        assert.Equal(t, rr.Code, http.StatusOK)
 }
+
+func TestSymptomDataHandler(t *testing.T) {
+       req, err := http.NewRequest("POST", "/ric/v1/symptomdata", nil)
+       if err != nil {
+               t.Fatal(err)
+       }
+
+       rr := httptest.NewRecorder()
+       handler := http.HandlerFunc(alarmManager.SymptomDataHandler)
+       handler.ServeHTTP(rr, req)
+
+       assert.Equal(t, true, rr != nil)
+       assert.Equal(t, rr.Code, http.StatusOK)
+}