Add R5 content to master
[ric-plt/e2mgr.git] / E2Manager / tests / dataProvider.go
index 64d390e..0adf3f9 100644 (file)
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 // See the License for the specific language governing permissions and
 // limitations under the License.
-//
+
+//  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
@@ -46,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