X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=E2Manager%2Ftests%2FdataProvider.go;h=0adf3f9c24dcd9acb4784b460bb8314d0d2dde62;hb=14eb5132c3dca8cdad98e7e5420701b04f452046;hp=82df174548388829e1b1c0c2ef1f0b37ed40183d;hpb=15d3982b5eda43a5b5b9054d7ecb026448c6ca16;p=ric-plt%2Fe2mgr.git diff --git a/E2Manager/tests/dataProvider.go b/E2Manager/tests/dataProvider.go index 82df174..0adf3f9 100644 --- a/E2Manager/tests/dataProvider.go +++ b/E2Manager/tests/dataProvider.go @@ -17,21 +17,18 @@ // 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 ( MaxMsgSize int = 4096 - Port int = 5555 + Port int = 3801 Flags int = 0 MessageType int = 1001 RanPort uint16 = 879 @@ -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