summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
a0369f7)
New appmgr wants a bit different post to the
notification subscribe API.
Change-Id: I5afc99e5d786e6b964325cba70922fd8c6e66011
Signed-off-by: Roni Riska <roni.riska@nokia.com>
var errWrongStatusCode = errors.New("Wrong subscriptions response StatusCode")
func subscribexAppNotifications(targetURL string, subscriptions chan subscriptionNotification, timeout time.Duration, subsURL string) {
var errWrongStatusCode = errors.New("Wrong subscriptions response StatusCode")
func subscribexAppNotifications(targetURL string, subscriptions chan subscriptionNotification, timeout time.Duration, subsURL string) {
- requestBody := []byte(fmt.Sprintf(`{"maxRetries": 5, "retryTimer": 5, "eventType":"all", "targetUrl": "%v"}`, targetURL))
+ requestBody := []byte(fmt.Sprintf(`{"Data": {"maxRetries": 5, "retryTimer": 5, "eventType":"all", "targetUrl": "%v"}}`, targetURL))
req, err := http.NewRequest("POST", subsURL, bytes.NewBuffer(requestBody))
if err != nil {
logger.Error("Setting NewRequest failed: %s", err)
req, err := http.NewRequest("POST", subsURL, bytes.NewBuffer(requestBody))
if err != nil {
logger.Error("Setting NewRequest failed: %s", err)
var result map[string]interface{}
err := json.Unmarshal([]byte(body), &result)
suite.Nil(err)
var result map[string]interface{}
err := json.Unmarshal([]byte(body), &result)
suite.Nil(err)
- suite.Equal(5, int(result["maxRetries"].(float64)))
- suite.Equal(5, int(result["retryTimer"].(float64)))
- suite.Equal("all", result["eventType"].(string))
+ data := result["Data"].(map[string]interface{})
+ suite.Equal(5, int(data["maxRetries"].(float64)))
+ suite.Equal(5, int(data["retryTimer"].(float64)))
+ suite.Equal("all", data["eventType"].(string))
suite.Equal("POST", req.Method)
res.Header().Add("Content-Type", "application/json")
res.WriteHeader(http.StatusCreated)
suite.Equal("POST", req.Method)
res.Header().Add("Content-Type", "application/json")
res.WriteHeader(http.StatusCreated)
# The Jenkins job uses this string for the tag in the image name
# for example nexus3.o-ran-sc.org:10004/my-image-name:0.0.1
---
# The Jenkins job uses this string for the tag in the image name
# for example nexus3.o-ran-sc.org:10004/my-image-name:0.0.1
---