Commit e6e86074 authored by Yann Garcia's avatar Yann Garcia
Browse files

Bug fiexed in MEC 011

parent d08e316d
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -6696,7 +6696,7 @@ func TestAppRegistrationPOST(t *testing.T) {
	 ******************************/

	// POST
	appInstanceId, _ := testAppRegistrationPOST(t, true)
	appInstanceId, _ = testAppRegistrationPOST(t, appInstanceId, true)

	// Delete
	testAppRegistrationDelete(t, appInstanceId, true)
@@ -6852,7 +6852,7 @@ func TestAppRegistrationGET(t *testing.T) {
	 ******************************/

	// POST
	appInstanceId, expectedGetResponse := testAppRegistrationPOST(t, true)
	appInstanceId, expectedGetResponse := testAppRegistrationPOST(t, appInstanceId, true)
	var expectedAppInfo as.AppInfo
	err = json.Unmarshal([]byte(expectedGetResponse), &expectedAppInfo)
	if err != nil {
@@ -6878,7 +6878,7 @@ func TestAppRegistrationGET(t *testing.T) {
	}

	// Delete
	testAppRegistrationDelete(t, appInstanceId, subscriptionId, true)
	testAppRegistrationDelete(t, appInstanceId, true)

	deleteApp(appInstanceId)

@@ -6984,7 +6984,7 @@ func TestFailAppRegistrationDelete(t *testing.T) {
	 ******************************/

	// Delete
	testAppRegistrationDelete(t, appInstanceId, "12345", false)
	testAppRegistrationDelete(t, appInstanceId, false)

	/******************************
	 * back to initial state section
@@ -7036,13 +7036,13 @@ func TestAppRegistrationPUT(t *testing.T) {
	 ******************************/

	// POST
	subscriptionId, _ := testAppRegistrationPOST(t, appInstanceId, true)
	appInstanceId, _ = testAppRegistrationPOST(t, appInstanceId, true)

	// PUT
	testAppRegistrationPUT(t, appInstanceId, true)

	// DELETE
	testAppRegistrationDelete(t, appInstanceId, subscriptionId, true)
	testAppRegistrationDelete(t, appInstanceId, true)

	/******************************
	 * back to initial state section
+8 −1
Original line number Diff line number Diff line
@@ -621,6 +621,8 @@ func servicesGET(w http.ResponseWriter, r *http.Request) {
}

func applicationsSubscriptionsPOST(w http.ResponseWriter, r *http.Request) {
	log.Info("applicationsSubscriptionsPOST")

	w.Header().Set("Content-Type", "application/json; charset=UTF-8")
	vars := mux.Vars(r)
	appId := vars["appInstanceId"]
@@ -737,6 +739,8 @@ func applicationsSubscriptionsPOST(w http.ResponseWriter, r *http.Request) {
}

func applicationsSubscriptionGET(w http.ResponseWriter, r *http.Request) {
	log.Info("applicationsSubscriptionGET")

	w.Header().Set("Content-Type", "application/json; charset=UTF-8")
	vars := mux.Vars(r)
	subId := vars["subscriptionId"]
@@ -773,6 +777,7 @@ func applicationsSubscriptionGET(w http.ResponseWriter, r *http.Request) {
		return
	}

	// Validate subscription
	// Validate subscription
	if sub.Cfg.AppId != appId || sub.Cfg.Type != SER_AVAILABILITY_NOTIF_SUB_TYPE {
		err = errors.New("Subscription not found")
@@ -787,6 +792,8 @@ func applicationsSubscriptionGET(w http.ResponseWriter, r *http.Request) {
}

func applicationsSubscriptionDELETE(w http.ResponseWriter, r *http.Request) {
	log.Info("applicationsSubscriptionDELETE")

	w.Header().Set("Content-Type", "application/json; charset=UTF-8")
	vars := mux.Vars(r)
	subId := vars["subscriptionId"]
@@ -893,7 +900,7 @@ func applicationsSubscriptionsGET(w http.ResponseWriter, r *http.Request) {
		// Create subscription reference & append it to link list
		subscription := SubscriptionLinkListLinksSubscriptions{
			// In v2.1.1 it should be SubscriptionType, but spec is expecting "rel" as per v1.1.1
			SubscriptionType: SER_AVAILABILITY_NOTIF_SUB_TYPE,
			SubscriptionType: sub.Cfg.Type,
			Href:             sub.Cfg.Self,
		}
		subscriptionLinkList.Links.Subscriptions = append(subscriptionLinkList.Links.Subscriptions, subscription)
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ require (
	github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-swagger-api-mgr v0.0.0
	github.com/gorilla/handlers v1.4.0
	github.com/gorilla/mux v1.8.0
	github.com/mitchellh/mapstructure v1.5.0 // indirect
	github.com/mitchellh/mapstructure v1.5.0
	github.com/prometheus/client_golang v1.9.0
)