2 // Copyright 2019 AT&T Intellectual Property
3 // Copyright 2019 Nokia
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
17 package rmrmsghandlers
24 "github.com/stretchr/testify/assert"
29 func TestHandleSuccessEndcConfigUpdate(t *testing.T) {
30 /* log, err := logger.InitLogger(logger.InfoLevel)
32 t.Errorf("#endc_configuration_update_handler_test.TestHandleSuccessEndcConfigUpdate - failed to initialize logger, error: %s", err)
34 h := EndcConfigurationUpdateHandler{}
36 payload := tests.GetPackedPayload(t)
37 mBuf := rmrCgo.NewMBuf(10370, len(payload),"RanName", &payload, &tests.DummyXAction)
38 notificationRequest := models.NotificationRequest{RanName: mBuf.Meid, Len: mBuf.Len, Payload: *mBuf.Payload, StartTime: time.Now()}
39 messageChannel := make(chan *models.NotificationResponse)
41 go h.Handle(log, ¬ificationRequest, messageChannel)
43 response := <-messageChannel
45 assert.NotEmpty(t, response)
46 assert.EqualValues(t, 10371, response.MgsType)
47 assert.True(t, len(response.Payload) > 0)*/
50 func TestHandleFailureEndcConfigUpdate(t *testing.T) {
51 log, err := logger.InitLogger(logger.InfoLevel)
53 t.Errorf("#endc_configuration_update_handler_test.TestHandleFailureEndcConfigUpdate - failed to initialize logger, error: %s", err)
55 h := EndcConfigurationUpdateHandler{}
57 mBuf := rmrCgo.NewMBuf(tests.MessageType, 4, "RanName", &tests.DummyPayload, &tests.DummyXAction)
58 notificationRequest := models.NotificationRequest{RanName: mBuf.Meid, Len: mBuf.Len, Payload: *mBuf.Payload, StartTime: time.Now()}
59 messageChannel := make(chan *models.NotificationResponse)
61 go h.Handle(log, ¬ificationRequest, messageChannel)
63 response := <-messageChannel
65 assert.NotEmpty(t, response)
66 assert.EqualValues(t, 10372, response.MgsType)
67 assert.True(t, len(response.Payload) > 0)