1 /*
2 * Copyright (c) 2025 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15 #define private public
16 #define protected public
17 #include <gtest/gtest.h>
18
19 #include "core_manager_inner.h"
20 #include "mock_esim_manager.h"
21 #include "string_ex.h"
22
23 namespace OHOS {
24 namespace Telephony {
25 using namespace testing;
26 using namespace testing::ext;
27 class CoreManagerInnerTest : public testing::Test {
28 public:
29 static void SetUpTestCase();
30 static void TearDownTestCase();
31 void SetUp();
32 void TearDown();
33
34 CoreManagerInner mInner;
35 std::shared_ptr<MockEsimManager> mockesimManager = std::make_shared<MockEsimManager>();
36 };
37
SetUpTestCase()38 void CoreManagerInnerTest::SetUpTestCase() {}
39
TearDownTestCase()40 void CoreManagerInnerTest::TearDownTestCase() {}
41
SetUp()42 void CoreManagerInnerTest::SetUp() {}
43
TearDown()44 void CoreManagerInnerTest::TearDown() {}
45
46 HWTEST_F(CoreManagerInnerTest, GetEid_001, Function | MediumTest | Level1)
47 {
48 mInner.esimManager_ = nullptr;
49 int32_t slotId = 0;
50 std::u16string eId;
51 int32_t ret = mInner.GetEid(slotId, eId);
52 EXPECT_EQ(ret, TELEPHONY_ERR_LOCAL_PTR_NULL);
53
54 mInner.esimManager_ = mockesimManager;
55 EXPECT_CALL(*mockesimManager, GetEid(_, _)).WillOnce(Return(TELEPHONY_ERR_SUCCESS));
56 ret = mInner.GetEid(slotId, eId);
57 EXPECT_EQ(ret, TELEPHONY_ERR_SUCCESS);
58 }
59
60 HWTEST_F(CoreManagerInnerTest, GetEuiccProfileInfoList_001, Function | MediumTest | Level1)
61 {
62 mInner.esimManager_ = nullptr;
63 int32_t slotId = 0;
64 GetEuiccProfileInfoListInnerResult result;
65 int32_t ret = mInner.GetEuiccProfileInfoList(slotId, result);
66 EXPECT_EQ(ret, TELEPHONY_ERR_LOCAL_PTR_NULL);
67
68 mInner.esimManager_ = mockesimManager;
69 EXPECT_CALL(*mockesimManager, GetEuiccProfileInfoList(_, _)).WillOnce(Return(TELEPHONY_ERR_SUCCESS));
70 ret = mInner.GetEuiccProfileInfoList(slotId, result);
71 EXPECT_EQ(ret, TELEPHONY_ERR_SUCCESS);
72 }
73
74 HWTEST_F(CoreManagerInnerTest, GetEuiccInfo_001, Function | MediumTest | Level1)
75 {
76 mInner.esimManager_ = nullptr;
77 int32_t slotId = 0;
78 EuiccInfo result;
79 int32_t ret = mInner.GetEuiccInfo(slotId, result);
80 EXPECT_EQ(ret, TELEPHONY_ERR_LOCAL_PTR_NULL);
81
82 mInner.esimManager_ = mockesimManager;
83 EXPECT_CALL(*mockesimManager, GetEuiccInfo(_, _)).WillOnce(Return(TELEPHONY_ERR_SUCCESS));
84 ret = mInner.GetEuiccInfo(slotId, result);
85 EXPECT_EQ(ret, TELEPHONY_ERR_SUCCESS);
86 }
87
88 HWTEST_F(CoreManagerInnerTest, DisableProfile_001, Function | MediumTest | Level1)
89 {
90 mInner.esimManager_ = nullptr;
91 int32_t slotId = 0;
92 int32_t portIndex = 0;
93 std::u16string iccId = Str8ToStr16("98760000000000543210");
94 bool refresh = true;
95 int32_t enumResult;
96 int32_t ret = mInner.DisableProfile(slotId, portIndex, iccId, refresh, enumResult);
97 EXPECT_EQ(ret, TELEPHONY_ERR_LOCAL_PTR_NULL);
98
99 mInner.esimManager_ = mockesimManager;
100 EXPECT_CALL(*mockesimManager, DisableProfile(_, _, _, _, _)).WillOnce(Return(TELEPHONY_ERR_SUCCESS));
101 ret = mInner.DisableProfile(slotId, portIndex, iccId, refresh, enumResult);
102 EXPECT_EQ(ret, TELEPHONY_ERR_SUCCESS);
103 }
104
105 HWTEST_F(CoreManagerInnerTest, GetSmdsAddress_001, Function | MediumTest | Level1)
106 {
107 mInner.esimManager_ = nullptr;
108 int32_t slotId = 0;
109 int32_t portIndex = 0;
110 std::u16string smdsAddress;
111 int32_t ret = mInner.GetSmdsAddress(slotId, portIndex, smdsAddress);
112 EXPECT_EQ(ret, TELEPHONY_ERR_LOCAL_PTR_NULL);
113
114 mInner.esimManager_ = mockesimManager;
115 EXPECT_CALL(*mockesimManager, GetSmdsAddress(_, _, _)).WillOnce(Return(TELEPHONY_ERR_SUCCESS));
116 ret = mInner.GetSmdsAddress(slotId, portIndex, smdsAddress);
117 EXPECT_EQ(ret, TELEPHONY_ERR_SUCCESS);
118 }
119
120 HWTEST_F(CoreManagerInnerTest, GetRulesAuthTable_001, Function | MediumTest | Level1)
121 {
122 mInner.esimManager_ = nullptr;
123 int32_t slotId = 0;
124 int32_t portIndex = 0;
125 EuiccRulesAuthTable eUiccRulesAuthTable;
126 int32_t ret = mInner.GetRulesAuthTable(slotId, portIndex, eUiccRulesAuthTable);
127 EXPECT_EQ(ret, TELEPHONY_ERR_LOCAL_PTR_NULL);
128
129 mInner.esimManager_ = mockesimManager;
130 EXPECT_CALL(*mockesimManager, GetRulesAuthTable(_, _, _)).WillOnce(Return(TELEPHONY_ERR_SUCCESS));
131 ret = mInner.GetRulesAuthTable(slotId, portIndex, eUiccRulesAuthTable);
132 EXPECT_EQ(ret, TELEPHONY_ERR_SUCCESS);
133 }
134
135 HWTEST_F(CoreManagerInnerTest, GetEuiccChallenge_001, Function | MediumTest | Level1)
136 {
137 mInner.esimManager_ = nullptr;
138 int32_t slotId = 0;
139 int32_t portIndex = 0;
140 ResponseEsimInnerResult result;
141 int32_t ret = mInner.GetEuiccChallenge(slotId, portIndex, result);
142 EXPECT_EQ(ret, TELEPHONY_ERR_LOCAL_PTR_NULL);
143
144 mInner.esimManager_ = mockesimManager;
145 EXPECT_CALL(*mockesimManager, GetEuiccChallenge(_, _, _)).WillOnce(Return(TELEPHONY_ERR_SUCCESS));
146 ret = mInner.GetEuiccChallenge(slotId, portIndex, result);
147 EXPECT_EQ(ret, TELEPHONY_ERR_SUCCESS);
148 }
149
150 HWTEST_F(CoreManagerInnerTest, GetDefaultSmdpAddress_001, Function | MediumTest | Level1)
151 {
152 mInner.esimManager_ = nullptr;
153 int32_t slotId = 0;
154 std::u16string defaultSmdpAddress;
155 int32_t ret = mInner.GetDefaultSmdpAddress(slotId, defaultSmdpAddress);
156 EXPECT_EQ(ret, TELEPHONY_ERR_LOCAL_PTR_NULL);
157
158 mInner.esimManager_ = mockesimManager;
159 EXPECT_CALL(*mockesimManager, GetDefaultSmdpAddress(_, _)).WillOnce(Return(TELEPHONY_ERR_SUCCESS));
160 ret = mInner.GetDefaultSmdpAddress(slotId, defaultSmdpAddress);
161 EXPECT_EQ(ret, TELEPHONY_ERR_SUCCESS);
162 }
163
164 HWTEST_F(CoreManagerInnerTest, CancelSession_001, Function | MediumTest | Level1)
165 {
166 mInner.esimManager_ = nullptr;
167 int32_t slotId = 0;
168 std::u16string transactionId = Str8ToStr16("A1B2C3");
169 CancelReason cancelReason = CancelReason::CANCEL_REASON_POSTPONED;
170 ResponseEsimInnerResult responseResult;
171 int32_t ret = mInner.CancelSession(slotId, transactionId, cancelReason, responseResult);
172 EXPECT_EQ(ret, TELEPHONY_ERR_LOCAL_PTR_NULL);
173
174 mInner.esimManager_ = mockesimManager;
175 EXPECT_CALL(*mockesimManager, CancelSession(_, _, _, _)).WillOnce(Return(TELEPHONY_ERR_SUCCESS));
176 ret = mInner.CancelSession(slotId, transactionId, cancelReason, responseResult);
177 EXPECT_EQ(ret, TELEPHONY_ERR_SUCCESS);
178 }
179
180 HWTEST_F(CoreManagerInnerTest, GetProfile_001, Function | MediumTest | Level1)
181 {
182 mInner.esimManager_ = nullptr;
183 int32_t slotId = 0;
184 int32_t portIndex = 0;
185 std::u16string iccId = Str8ToStr16("5A0A89670000000000216954");
186 EuiccProfile eUiccProfile;
187 int32_t ret = mInner.GetProfile(slotId, portIndex, iccId, eUiccProfile);
188 EXPECT_EQ(ret, TELEPHONY_ERR_LOCAL_PTR_NULL);
189
190 mInner.esimManager_ = mockesimManager;
191 EXPECT_CALL(*mockesimManager, GetProfile(_, _, _, _)).WillOnce(Return(TELEPHONY_ERR_SUCCESS));
192 ret = mInner.GetProfile(slotId, portIndex, iccId, eUiccProfile);
193 EXPECT_EQ(ret, TELEPHONY_ERR_SUCCESS);
194 }
195
196 HWTEST_F(CoreManagerInnerTest, ResetMemory_001, Function | MediumTest | Level1)
197 {
198 mInner.esimManager_ = nullptr;
199 int32_t slotId = 0;
200 int32_t resetMemoryResult;
201 const ResetOption resetOption = ResetOption::DELETE_OPERATIONAL_PROFILES;
202 int32_t ret = mInner.ResetMemory(slotId, resetOption, resetMemoryResult);
203 EXPECT_EQ(ret, TELEPHONY_ERR_LOCAL_PTR_NULL);
204
205 mInner.esimManager_ = mockesimManager;
206 EXPECT_CALL(*mockesimManager, ResetMemory(_, _, _)).WillOnce(Return(TELEPHONY_ERR_SUCCESS));
207 ret = mInner.ResetMemory(slotId, resetOption, resetMemoryResult);
208 EXPECT_EQ(ret, TELEPHONY_ERR_SUCCESS);
209 }
210
211 HWTEST_F(CoreManagerInnerTest, SetDefaultSmdpAddress_001, Function | MediumTest | Level1)
212 {
213 mInner.esimManager_ = nullptr;
214 int32_t slotId = 0;
215 std::u16string defaultSmdpAddress = Str8ToStr16("test.com");
216 int32_t setAddressResult;
217 int32_t ret = mInner.SetDefaultSmdpAddress(slotId, defaultSmdpAddress, setAddressResult);
218 EXPECT_EQ(ret, TELEPHONY_ERR_LOCAL_PTR_NULL);
219
220 mInner.esimManager_ = mockesimManager;
221 EXPECT_CALL(*mockesimManager, SetDefaultSmdpAddress(_, _, _)).WillOnce(Return(TELEPHONY_ERR_SUCCESS));
222 ret = mInner.SetDefaultSmdpAddress(slotId, defaultSmdpAddress, setAddressResult);
223 EXPECT_EQ(ret, TELEPHONY_ERR_SUCCESS);
224 }
225
226 HWTEST_F(CoreManagerInnerTest, IsSupported_001, Function | MediumTest | Level1)
227 {
228 mInner.esimManager_ = nullptr;
229 int32_t slotId = 0;
230 bool ret = mInner.IsSupported(slotId);
231 EXPECT_EQ(ret, false);
232
233 mInner.esimManager_ = mockesimManager;
234 EXPECT_CALL(*mockesimManager, IsSupported(_)).WillOnce(Return(true));
235 ret = mInner.IsSupported(slotId);
236 EXPECT_EQ(ret, true);
237 }
238
239 HWTEST_F(CoreManagerInnerTest, SendApduData_001, Function | MediumTest | Level1)
240 {
241 mInner.esimManager_ = nullptr;
242 int32_t slotId = 0;
243 std::u16string aid = Str8ToStr16("aid test");
244 EsimApduData apduData;
245 ResponseEsimInnerResult responseResult;
246 int32_t ret = mInner.SendApduData(slotId, aid, apduData, responseResult);
247 EXPECT_EQ(ret, TELEPHONY_ERR_LOCAL_PTR_NULL);
248
249 mInner.esimManager_ = mockesimManager;
250 EXPECT_CALL(*mockesimManager, SendApduData(_, _, _, _)).WillOnce(Return(TELEPHONY_ERR_SUCCESS));
251 ret = mInner.SendApduData(slotId, aid, apduData, responseResult);
252 EXPECT_EQ(ret, TELEPHONY_ERR_SUCCESS);
253 }
254
255 HWTEST_F(CoreManagerInnerTest, PrepareDownload_001, Function | MediumTest | Level1)
256 {
257 mInner.esimManager_ = nullptr;
258 int32_t slotId = 0;
259 DownLoadConfigInfo downLoadConfigInfo;
260 downLoadConfigInfo.portIndex_ = 0;
261 downLoadConfigInfo.hashCc_ = Str8ToStr16("4131423243332D583459355A36");
262 ResponseEsimInnerResult responseResult;
263 int32_t ret = mInner.PrepareDownload(slotId, downLoadConfigInfo, responseResult);
264 EXPECT_EQ(ret, TELEPHONY_ERR_LOCAL_PTR_NULL);
265
266 mInner.esimManager_ = mockesimManager;
267 EXPECT_CALL(*mockesimManager, PrepareDownload(_, _, _)).WillOnce(Return(TELEPHONY_ERR_SUCCESS));
268 ret = mInner.PrepareDownload(slotId, downLoadConfigInfo, responseResult);
269 EXPECT_EQ(ret, TELEPHONY_ERR_SUCCESS);
270 }
271
272 HWTEST_F(CoreManagerInnerTest, LoadBoundProfilePackage_001, Function | MediumTest | Level1)
273 {
274 mInner.esimManager_ = nullptr;
275 int32_t slotId = 0;
276 int32_t portIndex = 0;
277 std::u16string boundProfilePackage;
278 ResponseEsimBppResult responseResult;
279 int32_t ret = mInner.LoadBoundProfilePackage(slotId, portIndex, boundProfilePackage, responseResult);
280 EXPECT_EQ(ret, TELEPHONY_ERR_LOCAL_PTR_NULL);
281
282 mInner.esimManager_ = mockesimManager;
283 EXPECT_CALL(*mockesimManager, LoadBoundProfilePackage(_, _, _, _)).WillOnce(Return(TELEPHONY_ERR_SUCCESS));
284 ret = mInner.LoadBoundProfilePackage(slotId, portIndex, boundProfilePackage, responseResult);
285 EXPECT_EQ(ret, TELEPHONY_ERR_SUCCESS);
286 }
287
288
289 HWTEST_F(CoreManagerInnerTest, ListNotifications_001, Function | MediumTest | Level1)
290 {
291 mInner.esimManager_ = nullptr;
292 int32_t slotId = 0;
293 int32_t portIndex = 0;
294 const EsimEvent events = EsimEvent::EVENT_DELETE;
295 EuiccNotificationList notificationList;
296 int32_t ret = mInner.ListNotifications(slotId, portIndex, events, notificationList);
297 EXPECT_EQ(ret, TELEPHONY_ERR_LOCAL_PTR_NULL);
298
299 mInner.esimManager_ = mockesimManager;
300 EXPECT_CALL(*mockesimManager, ListNotifications(_, _, _, _)).WillOnce(Return(TELEPHONY_ERR_SUCCESS));
301 ret = mInner.ListNotifications(slotId, portIndex, events, notificationList);
302 EXPECT_EQ(ret, TELEPHONY_ERR_SUCCESS);
303 }
304
305 HWTEST_F(CoreManagerInnerTest, RetrieveNotificationList_001, Function | MediumTest | Level1)
306 {
307 mInner.esimManager_ = nullptr;
308 int32_t slotId = 0;
309 int32_t portIndex = 0;
310 const EsimEvent events = EsimEvent::EVENT_DISABLE;
311 EuiccNotificationList notificationList;
312 int32_t ret = mInner.RetrieveNotificationList(slotId, portIndex, events, notificationList);
313 EXPECT_EQ(ret, TELEPHONY_ERR_LOCAL_PTR_NULL);
314
315 mInner.esimManager_ = mockesimManager;
316 EXPECT_CALL(*mockesimManager, RetrieveNotificationList(_, _, _, _)).WillOnce(Return(TELEPHONY_ERR_SUCCESS));
317 ret = mInner.RetrieveNotificationList(slotId, portIndex, events, notificationList);
318 EXPECT_EQ(ret, TELEPHONY_ERR_SUCCESS);
319 }
320
321 HWTEST_F(CoreManagerInnerTest, RetrieveNotification_001, Function | MediumTest | Level1)
322 {
323 mInner.esimManager_ = nullptr;
324 int32_t slotId = 0;
325 int32_t portIndex = 0;
326 int32_t seqNumber = 5;
327 EuiccNotification notification;
328 int32_t ret = mInner.RetrieveNotification(slotId, portIndex, seqNumber, notification);
329 EXPECT_EQ(ret, TELEPHONY_ERR_LOCAL_PTR_NULL);
330
331 mInner.esimManager_ = mockesimManager;
332 EXPECT_CALL(*mockesimManager, RetrieveNotification(_, _, _, _)).WillOnce(Return(TELEPHONY_ERR_SUCCESS));
333 ret = mInner.RetrieveNotification(slotId, portIndex, seqNumber, notification);
334 EXPECT_EQ(ret, TELEPHONY_ERR_SUCCESS);
335 }
336
337 HWTEST_F(CoreManagerInnerTest, RemoveNotificationFromList_001, Function | MediumTest | Level1)
338 {
339 mInner.esimManager_ = nullptr;
340 int32_t slotId = 0;
341 int32_t portIndex = 0;
342 int32_t seqNumber = 5;
343 int32_t enumResult;
344 int32_t ret = mInner.RemoveNotificationFromList(slotId, portIndex, seqNumber, enumResult);
345 EXPECT_EQ(ret, TELEPHONY_ERR_LOCAL_PTR_NULL);
346
347 mInner.esimManager_ = mockesimManager;
348 EXPECT_CALL(*mockesimManager, RemoveNotificationFromList(_, _, _, _)).WillOnce(Return(TELEPHONY_ERR_SUCCESS));
349 ret = mInner.RemoveNotificationFromList(slotId, portIndex, seqNumber, enumResult);
350 EXPECT_EQ(ret, TELEPHONY_ERR_SUCCESS);
351 }
352
353 HWTEST_F(CoreManagerInnerTest, DeleteProfile_001, Function | MediumTest | Level1)
354 {
355 mInner.esimManager_ = nullptr;
356 int32_t slotId = 0;
357 std::u16string iccId = Str8ToStr16("98760000000000543210");
358 int32_t deleteProfileResult;
359 int32_t ret = mInner.DeleteProfile(slotId, iccId, deleteProfileResult);
360 EXPECT_EQ(ret, TELEPHONY_ERR_LOCAL_PTR_NULL);
361
362 mInner.esimManager_ = mockesimManager;
363 EXPECT_CALL(*mockesimManager, DeleteProfile(_, _, _)).WillOnce(Return(TELEPHONY_ERR_SUCCESS));
364 ret = mInner.DeleteProfile(slotId, iccId, deleteProfileResult);
365 EXPECT_EQ(ret, TELEPHONY_ERR_SUCCESS);
366 }
367
368 HWTEST_F(CoreManagerInnerTest, SwitchToProfile_001, Function | MediumTest | Level1)
369 {
370 mInner.esimManager_ = nullptr;
371 int32_t slotId = 0;
372 int32_t portIndex = 1;
373 std::u16string iccId = Str8ToStr16("98760000000000543210");
374 bool forceDisableProfile = true;
375 int32_t switchProfileResult;
376 int32_t ret = mInner.SwitchToProfile(slotId, portIndex, iccId, forceDisableProfile, switchProfileResult);
377 EXPECT_EQ(ret, TELEPHONY_ERR_LOCAL_PTR_NULL);
378
379 mInner.esimManager_ = mockesimManager;
380 EXPECT_CALL(*mockesimManager, SwitchToProfile(_, _, _, _, _)).WillOnce(Return(TELEPHONY_ERR_SUCCESS));
381 ret = mInner.SwitchToProfile(slotId, portIndex, iccId, forceDisableProfile, switchProfileResult);
382 EXPECT_EQ(ret, TELEPHONY_ERR_SUCCESS);
383 }
384
385 HWTEST_F(CoreManagerInnerTest, SetProfileNickname_001, Function | MediumTest | Level1)
386 {
387 mInner.esimManager_ = nullptr;
388 int32_t slotId = 0;
389 std::u16string iccId = Str8ToStr16("98760000000000543210");
390 std::u16string nickname = Str8ToStr16("nick");
391 int32_t updateResult;
392 int32_t ret = mInner.SetProfileNickname(slotId, iccId, nickname, updateResult);
393 EXPECT_EQ(ret, TELEPHONY_ERR_LOCAL_PTR_NULL);
394
395 mInner.esimManager_ = mockesimManager;
396 EXPECT_CALL(*mockesimManager, SetProfileNickname(_, _, _, _)).WillOnce(Return(TELEPHONY_ERR_SUCCESS));
397 ret = mInner.SetProfileNickname(slotId, iccId, nickname, updateResult);
398 EXPECT_EQ(ret, TELEPHONY_ERR_SUCCESS);
399 }
400
401 HWTEST_F(CoreManagerInnerTest, GetEuiccInfo2_002, Function | MediumTest | Level1)
402 {
403 mInner.esimManager_ = nullptr;
404 int32_t slotId = 0;
405 int32_t portIndex = 0;
406 EuiccInfo2 euiccInfo2;
407 int32_t ret = mInner.GetEuiccInfo2(slotId, portIndex, euiccInfo2);
408 EXPECT_EQ(ret, TELEPHONY_ERR_LOCAL_PTR_NULL);
409
410 mInner.esimManager_ = mockesimManager;
411 EXPECT_CALL(*mockesimManager, GetEuiccInfo2(_, _, _)).WillOnce(Return(TELEPHONY_ERR_SUCCESS));
412 ret = mInner.GetEuiccInfo2(slotId, portIndex, euiccInfo2);
413 EXPECT_EQ(ret, TELEPHONY_ERR_SUCCESS);
414 }
415
416 HWTEST_F(CoreManagerInnerTest, AuthenticateServer_001, Function | MediumTest | Level1)
417 {
418 mInner.esimManager_ = nullptr;
419 int32_t slotId = 0;
420 AuthenticateConfigInfo authenticateConfigInfo;
421 authenticateConfigInfo.matchingId_ = Str8ToStr16("4131423243332D583459355A36");
422 ResponseEsimInnerResult responseResult;
423 int32_t ret = mInner.AuthenticateServer(slotId, authenticateConfigInfo, responseResult);
424 EXPECT_EQ(ret, TELEPHONY_ERR_LOCAL_PTR_NULL);
425
426 mInner.esimManager_ = mockesimManager;
427 EXPECT_CALL(*mockesimManager, AuthenticateServer(_, _, _)).WillOnce(Return(TELEPHONY_ERR_SUCCESS));
428 ret = mInner.AuthenticateServer(slotId, authenticateConfigInfo, responseResult);
429 EXPECT_EQ(ret, TELEPHONY_ERR_SUCCESS);
430 }
431
432 HWTEST_F(CoreManagerInnerTest, GetContractInfo_001, Function | MediumTest | Level1)
433 {
434 mInner.esimManager_ = nullptr;
435 int32_t slotId = 0;
436 GetContractInfoRequest request;
437 std::string response = "";
438 int32_t ret = mInner.GetContractInfo(slotId, request, response);
439 EXPECT_EQ(ret, TELEPHONY_ERR_LOCAL_PTR_NULL);
440
441 mInner.esimManager_ = mockesimManager;
442 EXPECT_CALL(*mockesimManager, GetContractInfo(_, _, _)).WillOnce(Return(TELEPHONY_ERR_SUCCESS));
443 ret = mInner.GetContractInfo(slotId, request, response);
444 EXPECT_EQ(ret, TELEPHONY_ERR_SUCCESS);
445 }
446 } // Telephony
447 } // OHOS
448