X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=cmd%2Fvespamgr%2Fvespamgr_test.go;h=9a9ca853838425198bc02a7f0870b0e8c6c1d48b;hb=5a801c62183640699f06f2885e81b10eca187e51;hp=2b84ef5f3fd74b8b18b15645f2b431852c00276e;hpb=81b41009137b3c248ce4141ae436a50750389713;p=ric-plt%2Fvespamgr.git diff --git a/cmd/vespamgr/vespamgr_test.go b/cmd/vespamgr/vespamgr_test.go index 2b84ef5..9a9ca85 100755 --- a/cmd/vespamgr/vespamgr_test.go +++ b/cmd/vespamgr/vespamgr_test.go @@ -163,3 +163,18 @@ func executeRequest(req *http.Request, handleR http.HandlerFunc) *httptest.Respo func TestVespaMgrTestSuite(t *testing.T) { suite.Run(t, new(VespaMgrTestSuite)) } + +func (suite *VespaMgrTestSuite) TestCreateConf() { + suite.vespaMgr.CreateConf("/unknown/text.txt", []byte{}) +} + +func (suite *VespaMgrTestSuite) TestHandleMeasurements() { + data, err := ioutil.ReadFile("../../test/xApp_config_test_output.json") + suite.Nil(err) + + pbodyEn, _ := json.Marshal(data) + req, _ := http.NewRequest("POST", "/ric/v1/measurements", bytes.NewBuffer(pbodyEn)) + handleFunc := http.HandlerFunc(suite.vespaMgr.HandleMeasurements) + response := executeRequest(req, handleFunc) + suite.Equal(http.StatusOK, response.Code) +}