X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=E2Manager%2Ftests%2FdataProvider.go;h=0adf3f9c24dcd9acb4784b460bb8314d0d2dde62;hb=d2f1a29d3f1cc779045148a82729f644e6110776;hp=8095663bffc673682c6364fd98af10ac6aaee8c6;hpb=372a275602ae05da22130a4601709291c7fbbaa6;p=ric-plt%2Fe2mgr.git diff --git a/E2Manager/tests/dataProvider.go b/E2Manager/tests/dataProvider.go index 8095663..0adf3f9 100644 --- a/E2Manager/tests/dataProvider.go +++ b/E2Manager/tests/dataProvider.go @@ -17,16 +17,13 @@ // This source code is part of the near-RT RIC (RAN Intelligent Controller) // platform project (RICP). - package tests import ( "bytes" "encoding/json" - "fmt" "net/http" "strconv" - "testing" ) const ( @@ -49,38 +46,13 @@ func GetPort() string { } func GetHttpRequest() *http.Request { - data := map[string]interface{}{"ranIp": RanIp, - "ranPort": RanPort, "ranName": RanName} - b := new(bytes.Buffer) - _ = json.NewEncoder(b).Encode(data) - req, _ := http.NewRequest("POST", "https://localhost:3800/request", b) - return req -} - -func GetInvalidRequestDetails() *http.Request { - data := map[string]interface{}{"ranIp": "256.0.0.0", - "ranPort": RanPort, "ranName": RanName} - b := new(bytes.Buffer) - _ = json.NewEncoder(b).Encode(data) - req, _ := http.NewRequest("POST", "https://localhost:3800/request", b) - return req -} - -func GetInvalidMessageType() *http.Request { - data := map[string]interface{}{"ranIp": "1.2.3.4", - "ranPort": RanPort, "ranName": RanName} + data := map[string]interface{}{ + "ranIp": RanIp, + "ranPort": RanPort, + "ranName": RanName, + } b := new(bytes.Buffer) _ = json.NewEncoder(b).Encode(data) req, _ := http.NewRequest("POST", "https://localhost:3800/request", b) return req -} - -func GetPackedPayload(t *testing.T) []byte { - inputPayloadAsStr := "2006002a000002001500080002f82900007a8000140017000000630002f8290007ab50102002f829000001000133" - payload := make([]byte, len(inputPayloadAsStr)/2) - _, err := fmt.Sscanf(inputPayloadAsStr, "%x", &payload) - if err != nil { - t.Errorf("convert inputPayloadAsStr to payloadAsByte. Error: %v\n", err) - } - return payload -} +} \ No newline at end of file