+ if r.Method == "GET" && r.URL.String() == "/ric/v1/e2t/list" {
+ w.Header().Add("Content-Type", "application/json")
+ w.WriteHeader(http.StatusOK)
+ w.Write(t)
+ }
+
+ }))
+ ts.Listener.Close()
+ ts.Listener = l
+ return ts
+}
+
+func createMockSubmgrWithData(url string, t []byte) *httptest.Server {
+ l, err := net.Listen("tcp", url)
+ if err != nil {
+ fmt.Println("Failed to create listener: " + err.Error())
+ }
+ ts := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+
+ if r.Method == "GET" && r.URL.String() == "//ric/v1/subscriptions" {
+ w.Header().Add("Content-Type", "application/json")
+ w.WriteHeader(http.StatusOK)
+ w.Write(t)
+ }