subhash kumar singh | 327d9db | 2021-09-30 19:07:18 +0000 | [diff] [blame] | 1 | /* |
| 2 | ================================================================================== |
| 3 | Copyright (c) 2021 Samsung |
| 4 | |
| 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 |
| 8 | |
| 9 | http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | |
| 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. |
| 16 | |
| 17 | This source code is part of the near-RT RIC (RAN Intelligent Controller) |
| 18 | platform project (RICP). |
| 19 | ================================================================================== |
| 20 | */ |
| 21 | package resthooks |
| 22 | |
| 23 | import ( |
naman.gupta | 3ad6de4 | 2022-04-26 21:59:05 +0530 | [diff] [blame] | 24 | "encoding/json" |
subhash kumar singh | 327d9db | 2021-09-30 19:07:18 +0000 | [diff] [blame] | 25 | "os" |
naman.gupta | d5aa5be | 2022-02-23 11:44:43 +0530 | [diff] [blame] | 26 | "strconv" |
subhash kumar singh | 327d9db | 2021-09-30 19:07:18 +0000 | [diff] [blame] | 27 | "testing" |
Naman Gupta/Single vRAN Call Control /SRI-Bangalore/Engineer/Samsung Electronics | 584d755 | 2022-09-27 10:32:15 +0530 | [diff] [blame] | 28 | "time" |
subhash kumar singh | 327d9db | 2021-09-30 19:07:18 +0000 | [diff] [blame] | 29 | |
naman.gupta | ab3e9ee | 2022-02-18 18:03:36 +0530 | [diff] [blame] | 30 | "gerrit.o-ran-sc.org/r/ric-plt/a1/pkg/a1" |
naman.gupta | d5aa5be | 2022-02-23 11:44:43 +0530 | [diff] [blame] | 31 | "gerrit.o-ran-sc.org/r/ric-plt/a1/pkg/models" |
subhash kumar singh | 327d9db | 2021-09-30 19:07:18 +0000 | [diff] [blame] | 32 | "github.com/stretchr/testify/assert" |
| 33 | "github.com/stretchr/testify/mock" |
| 34 | ) |
| 35 | |
naman.gupta | 1a41ce7 | 2022-10-18 00:14:49 +0530 | [diff] [blame] | 36 | type RmrSenderMock struct { |
| 37 | mock.Mock |
| 38 | } |
| 39 | |
subhash kumar singh | 327d9db | 2021-09-30 19:07:18 +0000 | [diff] [blame] | 40 | var rh *Resthook |
| 41 | var sdlInst *SdlMock |
naman.gupta | 1a41ce7 | 2022-10-18 00:14:49 +0530 | [diff] [blame] | 42 | var rmrSenderInst *RmrSenderMock |
subhash kumar singh | 327d9db | 2021-09-30 19:07:18 +0000 | [diff] [blame] | 43 | |
| 44 | func TestMain(m *testing.M) { |
| 45 | sdlInst = new(SdlMock) |
subhash kumar singh | 6017d6a | 2021-10-26 12:14:26 +0000 | [diff] [blame] | 46 | |
naman.gupta | ab3e9ee | 2022-02-18 18:03:36 +0530 | [diff] [blame] | 47 | sdlInst.On("GetAll", "A1m_ns").Return([]string{"a1.policy_instance.1006001.qos", |
naman.gupta | 05a0f58 | 2022-05-05 15:59:51 +0530 | [diff] [blame] | 48 | "a1.policy_instance.20005.123456", |
| 49 | "a1.policy_instance.20005.234567", |
naman.gupta | ab3e9ee | 2022-02-18 18:03:36 +0530 | [diff] [blame] | 50 | "a1.policy_type.1006001", |
| 51 | "a1.policy_type.20000", |
| 52 | "a1.policy_inst_metadata.1006001.qos", |
| 53 | }, nil) |
naman.gupta | 1a41ce7 | 2022-10-18 00:14:49 +0530 | [diff] [blame] | 54 | RMRclient = new(RMRClientMock) |
naman.gupta | ab3e9ee | 2022-02-18 18:03:36 +0530 | [diff] [blame] | 55 | a1.Init() |
naman.gupta | 1a41ce7 | 2022-10-18 00:14:49 +0530 | [diff] [blame] | 56 | rh = createResthook(sdlInst, RMRclient) |
subhash kumar singh | 327d9db | 2021-09-30 19:07:18 +0000 | [diff] [blame] | 57 | code := m.Run() |
| 58 | os.Exit(code) |
| 59 | } |
| 60 | |
| 61 | func TestGetAllPolicyType(t *testing.T) { |
| 62 | resp := rh.GetAllPolicyType() |
| 63 | assert.Equal(t, 2, len(resp)) |
| 64 | } |
| 65 | |
naman.gupta | b5c9dd5 | 2022-03-10 15:12:05 +0530 | [diff] [blame] | 66 | func TestGetPolicyType(t *testing.T) { |
| 67 | |
| 68 | policyTypeId := models.PolicyTypeID(20001) |
| 69 | |
naman.gupta | b5c9dd5 | 2022-03-10 15:12:05 +0530 | [diff] [blame] | 70 | var policyTypeSchema models.PolicyTypeSchema |
| 71 | name := "admission_control_policy_mine" |
| 72 | policyTypeSchema.Name = &name |
| 73 | policytypeid := int64(20001) |
| 74 | policyTypeSchema.PolicyTypeID = &policytypeid |
| 75 | description := "various parameters to control admission of dual connection" |
| 76 | policyTypeSchema.Description = &description |
| 77 | schema := `{"$schema": "http://json-schema.org/draft-07/schema#","type":"object","properties": {"enforce": {"type":"boolean","default":"true",},"window_length": {"type": "integer","default":1,"minimum":1,"maximum":60,"description": "Sliding window length (in minutes)",}, |
| 78 | "blocking_rate": {"type":"number","default":10,"minimum":1,"maximum":100,"description": "% Connections to block",},"additionalProperties": false,},}` |
| 79 | policyTypeSchema.CreateSchema = schema |
| 80 | key := a1PolicyPrefix + strconv.FormatInt((int64(policyTypeId)), 10) |
Naman Gupta/Single vRAN Call Control /SRI-Bangalore/Engineer/Samsung Electronics | 584d755 | 2022-09-27 10:32:15 +0530 | [diff] [blame] | 81 | var keys [1]string |
| 82 | keys[0] = key |
naman.gupta | b5c9dd5 | 2022-03-10 15:12:05 +0530 | [diff] [blame] | 83 | //Setup Expectations |
Naman Gupta/Single vRAN Call Control /SRI-Bangalore/Engineer/Samsung Electronics | 584d755 | 2022-09-27 10:32:15 +0530 | [diff] [blame] | 84 | sdlInst.On("Get", a1MediatorNs, keys[:]).Return(map[string]interface{}{key: policyTypeSchema}, nil) |
| 85 | resp := rh.GetPolicyType(policyTypeId) |
naman.gupta | b5c9dd5 | 2022-03-10 15:12:05 +0530 | [diff] [blame] | 86 | assert.NotNil(t, resp) |
| 87 | |
| 88 | sdlInst.AssertExpectations(t) |
| 89 | |
| 90 | } |
| 91 | |
naman.gupta | d5aa5be | 2022-02-23 11:44:43 +0530 | [diff] [blame] | 92 | func TestCreatePolicyType(t *testing.T) { |
| 93 | var policyTypeId models.PolicyTypeID |
| 94 | policyTypeId = 20001 |
| 95 | var policyTypeSchema models.PolicyTypeSchema |
| 96 | name := "admission_control_policy_mine" |
| 97 | policyTypeSchema.Name = &name |
| 98 | policytypeid := int64(20001) |
| 99 | policyTypeSchema.PolicyTypeID = &policytypeid |
| 100 | description := "various parameters to control admission of dual connection" |
| 101 | policyTypeSchema.Description = &description |
| 102 | policyTypeSchema.CreateSchema = `{"$schema": "http://json-schema.org/draft-07/schema#","type":"object","properties": {"enforce": {"type":"boolean","default":"true",},"window_length": {"type": "integer","default":1,"minimum":1,"maximum":60,"description": "Sliding window length (in minutes)",}, |
| 103 | "blocking_rate": {"type":"number","default":10,"minimum":1,"maximum":100,"description": "% Connections to block",},"additionalProperties": false,},}` |
| 104 | |
| 105 | data, err := policyTypeSchema.MarshalBinary() |
| 106 | a1.Logger.Debug("error : %+v ", err) |
| 107 | a1.Logger.Debug("data : %+v ", data) |
naman.gupta | b5c9dd5 | 2022-03-10 15:12:05 +0530 | [diff] [blame] | 108 | key := a1PolicyPrefix + strconv.FormatInt(20001, 10) |
naman.gupta | d5aa5be | 2022-02-23 11:44:43 +0530 | [diff] [blame] | 109 | a1.Logger.Debug("key : %+v ", key) |
| 110 | //Setup Expectations |
| 111 | sdlInst.On("SetIfNotExists", a1MediatorNs, key, string(data)).Return(true, nil) |
| 112 | |
| 113 | errresp := rh.CreatePolicyType(policyTypeId, policyTypeSchema) |
| 114 | //Data Assertion |
| 115 | assert.Nil(t, errresp) |
| 116 | //Mock Assertion :Behavioral |
| 117 | sdlInst.AssertExpectations(t) |
| 118 | } |
| 119 | |
naman.gupta | 3ad6de4 | 2022-04-26 21:59:05 +0530 | [diff] [blame] | 120 | func TestCreatePolicyTypeInstance(t *testing.T) { |
naman.gupta | 3ad6de4 | 2022-04-26 21:59:05 +0530 | [diff] [blame] | 121 | var policyInstanceID models.PolicyInstanceID |
| 122 | policyInstanceID = "123456" |
Naman Gupta/Single vRAN Call Control /SRI-Bangalore/Engineer/Samsung Electronics | 584d755 | 2022-09-27 10:32:15 +0530 | [diff] [blame] | 123 | var httpBody = `{"enforce":true,"window_length":20,"blocking_rate":20,"trigger_threshold":10}` |
| 124 | instancekey := a1InstancePrefix + strconv.FormatInt(20001, 10) + "." + string(policyInstanceID) |
| 125 | var policyTypeId models.PolicyTypeID |
| 126 | policyTypeId = 20001 |
naman.gupta | 3ad6de4 | 2022-04-26 21:59:05 +0530 | [diff] [blame] | 127 | |
Naman Gupta/Single vRAN Call Control /SRI-Bangalore/Engineer/Samsung Electronics | 584d755 | 2022-09-27 10:32:15 +0530 | [diff] [blame] | 128 | var instancedata map[string]interface{} |
| 129 | |
| 130 | json.Unmarshal([]byte(httpBody), &instancedata) |
| 131 | |
| 132 | data, _ := json.Marshal(instancedata) |
| 133 | a1.Logger.Debug("Marshaled data : %+v", string(data)) |
| 134 | a1.Logger.Debug("instancekey : %+v", instancekey) |
naman.gupta | 3ad6de4 | 2022-04-26 21:59:05 +0530 | [diff] [blame] | 135 | instancearr := []interface{}{instancekey, string(data)} |
Naman Gupta/Single vRAN Call Control /SRI-Bangalore/Engineer/Samsung Electronics | 584d755 | 2022-09-27 10:32:15 +0530 | [diff] [blame] | 136 | sdlInst.On("Set", "A1m_ns", instancearr).Return(nil) |
| 137 | |
| 138 | metadatainstancekey := a1InstanceMetadataPrefix + strconv.FormatInt(20001, 10) + "." + string(policyInstanceID) |
| 139 | creation_timestamp := time.Now() |
| 140 | var metadatajson []interface{} |
| 141 | metadatajson = append(metadatajson, map[string]string{"created_at": creation_timestamp.Format("2006-01-02 15:04:05"), "has_been_deleted": "False"}) |
| 142 | metadata, _ := json.Marshal(metadatajson) |
| 143 | a1.Logger.Debug("Marshaled Metadata : %+v", string(metadata)) |
| 144 | a1.Logger.Debug("metadatainstancekey : %+v", metadatainstancekey) |
| 145 | metadatainstancearr := []interface{}{metadatainstancekey, string(metadata)} |
| 146 | sdlInst.On("Set", "A1m_ns", metadatainstancearr).Return(nil) |
naman.gupta | 1a41ce7 | 2022-10-18 00:14:49 +0530 | [diff] [blame] | 147 | rmrSenderInst.On("RmrSendToXapp", "httpBodyString").Return(true) |
Naman Gupta/Single vRAN Call Control /SRI-Bangalore/Engineer/Samsung Electronics | 584d755 | 2022-09-27 10:32:15 +0530 | [diff] [blame] | 148 | |
| 149 | errresp := rh.CreatePolicyInstance(policyTypeId, policyInstanceID, instancedata) |
naman.gupta | 3ad6de4 | 2022-04-26 21:59:05 +0530 | [diff] [blame] | 150 | |
| 151 | assert.Nil(t, errresp) |
| 152 | sdlInst.AssertExpectations(t) |
| 153 | } |
| 154 | |
naman.gupta | 6579f78 | 2022-05-02 15:34:31 +0530 | [diff] [blame] | 155 | func TestGetPolicyInstance(t *testing.T) { |
| 156 | |
| 157 | var policyTypeId models.PolicyTypeID |
| 158 | policyTypeId = 20001 |
| 159 | var policyInstanceID models.PolicyInstanceID |
| 160 | policyInstanceID = "123456" |
| 161 | httpBody := `{ |
| 162 | "enforce":true, |
| 163 | "window_length":20, |
| 164 | "blocking_rate":20, |
| 165 | "trigger_threshold":10 |
| 166 | }` |
naman.gupta | 6242a3f | 2022-10-03 16:05:10 +0530 | [diff] [blame] | 167 | instancekey := a1InstancePrefix + strconv.FormatInt(20001, 10) + "." + string(policyInstanceID) |
naman.gupta | 6579f78 | 2022-05-02 15:34:31 +0530 | [diff] [blame] | 168 | a1.Logger.Debug("httpBody String : %+v", httpBody) |
| 169 | a1.Logger.Debug("key : %+v", instancekey) |
| 170 | var keys [1]string |
| 171 | keys[0] = instancekey |
| 172 | //Setup Expectations |
| 173 | sdlInst.On("Get", a1MediatorNs, keys[:]).Return(httpBody, nil) |
| 174 | |
Naman Gupta/Single vRAN Call Control /SRI-Bangalore/Engineer/Samsung Electronics | 584d755 | 2022-09-27 10:32:15 +0530 | [diff] [blame] | 175 | resp, err := rh.GetPolicyInstance(policyTypeId, policyInstanceID) |
| 176 | a1.Logger.Error("err : %+v", err) |
naman.gupta | 6579f78 | 2022-05-02 15:34:31 +0530 | [diff] [blame] | 177 | assert.NotNil(t, resp) |
| 178 | |
| 179 | sdlInst.AssertExpectations(t) |
| 180 | } |
| 181 | |
naman.gupta | 05a0f58 | 2022-05-05 15:59:51 +0530 | [diff] [blame] | 182 | func TestGetAllPolicyIntances(t *testing.T) { |
| 183 | var policyTypeId models.PolicyTypeID |
| 184 | policyTypeId = 20005 |
Naman Gupta/Single vRAN Call Control /SRI-Bangalore/Engineer/Samsung Electronics | 584d755 | 2022-09-27 10:32:15 +0530 | [diff] [blame] | 185 | resp, err := rh.GetAllPolicyInstance(policyTypeId) |
| 186 | a1.Logger.Error("err : %+v", err) |
naman.gupta | 05a0f58 | 2022-05-05 15:59:51 +0530 | [diff] [blame] | 187 | assert.Equal(t, 2, len(resp)) |
| 188 | } |
| 189 | |
naman.gupta | b513650 | 2022-10-18 00:25:14 +0530 | [diff] [blame] | 190 | func TestDeletePolicyType(t *testing.T) { |
| 191 | |
| 192 | policyTypeId := models.PolicyTypeID(20001) |
| 193 | key := a1PolicyPrefix + strconv.FormatInt((int64(policyTypeId)), 10) |
| 194 | var keys [1]string |
| 195 | keys[0] = key |
| 196 | |
| 197 | //Setup Expectations |
| 198 | sdlInst.On("Remove", a1MediatorNs, keys[:]).Return(nil) |
| 199 | |
| 200 | errresp := rh.DeletePolicyType(policyTypeId) |
| 201 | |
| 202 | assert.Nil(t, errresp) |
| 203 | sdlInst.AssertExpectations(t) |
| 204 | } |
| 205 | |
naman.gupta | dd7944b | 2022-10-26 14:38:04 +0530 | [diff] [blame^] | 206 | func TestGetPolicyInstanceStatus(t *testing.T) { |
| 207 | var policyTypeId models.PolicyTypeID |
| 208 | policyTypeId = 20001 |
| 209 | var policyInstanceID models.PolicyInstanceID |
| 210 | policyInstanceID = "123456" |
| 211 | httpBody := `{ |
| 212 | "created_at":"0001-01-01T00:00:00.000Z", |
| 213 | "instance_status":"NOT IN EFFECT" |
| 214 | }` |
| 215 | instancekey := a1InstanceMetadataPrefix + strconv.FormatInt(20001, 10) + "." + string(policyInstanceID) |
| 216 | a1.Logger.Debug("httpBody String : %+v", httpBody) |
| 217 | a1.Logger.Debug("key : %+v", instancekey) |
| 218 | var keys [1]string |
| 219 | keys[0] = instancekey |
| 220 | sdlInst.On("Get", a1MediatorNs, keys[:]).Return(httpBody) |
| 221 | |
| 222 | resp := rh.GetPolicyInstanceStatus(policyTypeId, policyInstanceID) |
| 223 | |
| 224 | assert.NotNil(t, resp) |
| 225 | sdlInst.AssertExpectations(t) |
| 226 | } |
| 227 | |
subhash kumar singh | 327d9db | 2021-09-30 19:07:18 +0000 | [diff] [blame] | 228 | type SdlMock struct { |
| 229 | mock.Mock |
| 230 | } |
| 231 | |
| 232 | func (s *SdlMock) GetAll(ns string) ([]string, error) { |
naman.gupta | ab3e9ee | 2022-02-18 18:03:36 +0530 | [diff] [blame] | 233 | args := s.MethodCalled("GetAll", ns) |
| 234 | return args.Get(0).([]string), nil |
| 235 | } |
| 236 | |
naman.gupta | 6864473 | 2022-02-24 14:41:55 +0530 | [diff] [blame] | 237 | func (s *SdlMock) Get(ns string, keys []string) (map[string]interface{}, error) { |
naman.gupta | b5c9dd5 | 2022-03-10 15:12:05 +0530 | [diff] [blame] | 238 | a1.Logger.Debug("Get Called ") |
| 239 | args := s.MethodCalled("Get", ns, keys) |
naman.gupta | dd7944b | 2022-10-26 14:38:04 +0530 | [diff] [blame^] | 240 | a1.Logger.Debug("ns :%+v", args.Get(0)) |
naman.gupta | b5c9dd5 | 2022-03-10 15:12:05 +0530 | [diff] [blame] | 241 | policytypeid := int64(20001) |
Naman Gupta/Single vRAN Call Control /SRI-Bangalore/Engineer/Samsung Electronics | 584d755 | 2022-09-27 10:32:15 +0530 | [diff] [blame] | 242 | policyInstanceID := "123456" |
| 243 | var policySchemaString string |
| 244 | var key string |
| 245 | if keys[0] == "a1.policy_instance.20001.123456" { |
| 246 | policySchemaString = `{ |
| 247 | "enforce":true, |
| 248 | "window_length":20, |
| 249 | "blocking_rate":20, |
| 250 | "trigger_threshold":10 |
| 251 | }` |
| 252 | key = a1InstancePrefix + strconv.FormatInt(policytypeid, 10) + "." + string(policyInstanceID) |
| 253 | } else if keys[0] == "a1.policy_type.20001" { |
naman.gupta | 6242a3f | 2022-10-03 16:05:10 +0530 | [diff] [blame] | 254 | policySchemaString = `{"create_schema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"additionalProperties":false,"blocking_rate":{"default":10,"description":"% Connections to block","maximum":1001,"minimum":1,"type":"number"},"enforce":{"default":"true","type":"boolean"},"window_length":{"default":1,"description":"Sliding window length (in minutes)","maximum":60,"minimum":1,"type":"integer"}},"type":"object"},"description":"various parameters to control admission of dual connection","name":"admission_control_policy_mine","policy_type_id":20001}` |
Naman Gupta/Single vRAN Call Control /SRI-Bangalore/Engineer/Samsung Electronics | 584d755 | 2022-09-27 10:32:15 +0530 | [diff] [blame] | 255 | key = a1PolicyPrefix + strconv.FormatInt((policytypeid), 10) |
naman.gupta | dd7944b | 2022-10-26 14:38:04 +0530 | [diff] [blame^] | 256 | } else if keys[0] == "a1.policy_inst_metadata.20001.123456" { |
| 257 | policySchemaString = `{ |
| 258 | "created_at":"0001-01-01T00:00:00.000Z", |
| 259 | "instance_status":"NOT IN EFFECT" |
| 260 | }` |
| 261 | key = a1InstanceMetadataPrefix + strconv.FormatInt(policytypeid, 10) + "." + string(policyInstanceID) |
Naman Gupta/Single vRAN Call Control /SRI-Bangalore/Engineer/Samsung Electronics | 584d755 | 2022-09-27 10:32:15 +0530 | [diff] [blame] | 262 | } |
naman.gupta | 1a41ce7 | 2022-10-18 00:14:49 +0530 | [diff] [blame] | 263 | a1.Logger.Debug(" policy SchemaString %+v", policySchemaString) |
Naman Gupta/Single vRAN Call Control /SRI-Bangalore/Engineer/Samsung Electronics | 584d755 | 2022-09-27 10:32:15 +0530 | [diff] [blame] | 264 | policyTypeSchema, _ := json.Marshal((policySchemaString)) |
naman.gupta | 1a41ce7 | 2022-10-18 00:14:49 +0530 | [diff] [blame] | 265 | a1.Logger.Debug(" policyTypeSchema %+v", string(policyTypeSchema)) |
naman.gupta | 6242a3f | 2022-10-03 16:05:10 +0530 | [diff] [blame] | 266 | |
naman.gupta | 1a41ce7 | 2022-10-18 00:14:49 +0530 | [diff] [blame] | 267 | a1.Logger.Debug(" key for policy type %+v", key) |
naman.gupta | 6242a3f | 2022-10-03 16:05:10 +0530 | [diff] [blame] | 268 | mp := map[string]interface{}{key: string(policySchemaString)} |
naman.gupta | 1a41ce7 | 2022-10-18 00:14:49 +0530 | [diff] [blame] | 269 | a1.Logger.Debug("Get Called and mp return %+v ", mp) |
naman.gupta | b5c9dd5 | 2022-03-10 15:12:05 +0530 | [diff] [blame] | 270 | return mp, nil |
naman.gupta | 6864473 | 2022-02-24 14:41:55 +0530 | [diff] [blame] | 271 | } |
naman.gupta | 3ad6de4 | 2022-04-26 21:59:05 +0530 | [diff] [blame] | 272 | func (s *SdlMock) SetIfNotExists(ns string, key string, data interface{}) (bool, error) { |
| 273 | args := s.MethodCalled("SetIfNotExists", ns, key, data) |
| 274 | return args.Bool(0), args.Error(1) |
| 275 | } |
| 276 | |
| 277 | func (s *SdlMock) Set(ns string, pairs ...interface{}) error { |
| 278 | args := s.MethodCalled("Set", ns, pairs) |
Naman Gupta/Single vRAN Call Control /SRI-Bangalore/Engineer/Samsung Electronics | 584d755 | 2022-09-27 10:32:15 +0530 | [diff] [blame] | 279 | return args.Error(0) |
naman.gupta | 3ad6de4 | 2022-04-26 21:59:05 +0530 | [diff] [blame] | 280 | } |
| 281 | func (s *SdlMock) SetIf(ns string, key string, oldData, newData interface{}) (bool, error) { |
| 282 | args := s.MethodCalled("SetIfNotExists", ns, key, oldData, newData) |
| 283 | return args.Bool(0), args.Error(1) |
| 284 | } |
naman.gupta | 1a41ce7 | 2022-10-18 00:14:49 +0530 | [diff] [blame] | 285 | |
| 286 | func (rmr *RmrSenderMock) RmrSendToXapp(httpBodyString string) bool { |
| 287 | args := rmr.MethodCalled("RmrSendToXapp", httpBodyString) |
| 288 | return args.Bool(0) |
| 289 | } |
naman.gupta | b513650 | 2022-10-18 00:25:14 +0530 | [diff] [blame] | 290 | |
| 291 | func (s *SdlMock) Remove(ns string, keys []string) error { |
| 292 | args := s.MethodCalled("Remove", ns, keys) |
| 293 | return args.Error(0) |
| 294 | } |