Addressed format specifier, unused variable, etc, build warnings.
[platform/upstream/iotivity.git] / resource / unittests / OCAccountManagerTest.cpp
1 /* ****************************************************************
2  *
3  * Copyright 2016 Samsung Electronics All Rights Reserved.
4  *
5  *
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  ******************************************************************/
20
21 #include <OCPlatform.h>
22 #include <OCApi.h>
23 #include <gtest/gtest.h>
24
25 namespace OCAccountManagerTest
26 {
27     using namespace OC;
28
29     // Callbacks
30     void accountHandler(const HeaderOptions& /*headerOptions*/, const OCRepresentation& /*rep*/,
31             const int /*eCode*/)
32     {
33     }
34
35     void deleteHandler(const HeaderOptions& /*headerOptions*/, const int /*eCode*/)
36     {
37     }
38
39     void onObserve(const HeaderOptions /*headerOptions*/, const OCRepresentation& /*rep*/,
40                         const int& /*eCode*/, const int& /*sequenceNumber*/)
41     {
42     }
43
44     // Helper method
45     OCAccountManager::Ptr ConstructAccountManagerObject(std::string host)
46     {
47         auto ret = OCPlatform::constructAccountManagerObject(host, CT_DEFAULT);
48
49         if (!ret)
50         {
51             ADD_FAILURE() << "ConstructAccountManagerObject result was null";
52             throw std::runtime_error("ConstructAccountManagerObject result was null");
53         }
54
55         return ret;
56     }
57
58     // Host Test
59     TEST(HostTest, Host)
60     {
61         std::string host("coap://192.168.1.2:5000");
62         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
63         EXPECT_TRUE(NULL != accountManager);
64         EXPECT_TRUE(accountManager->host() == host);
65     }
66
67     // ConnectivityType Test
68     TEST(ConnectivityTypeTest, ConnectivityType)
69     {
70         std::string host("coap://192.168.1.2:5000");
71         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
72         EXPECT_TRUE(NULL != accountManager);
73         EXPECT_TRUE(accountManager->connectivityType() == CT_DEFAULT);
74     }
75
76     // SignUp Test
77     TEST(SignUpTest, DISABLED_SignUpWithoutOptionForValid)
78     {
79         std::string host("coap://192.168.1.2:5000");
80         std::string authProvider("AnyAuthProvider");
81         std::string authCode("AnyAuthCode");
82         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
83         EXPECT_TRUE(NULL != accountManager);
84         EXPECT_EQ(OC_STACK_OK, accountManager->signUp(authProvider, authCode, &accountHandler));
85     }
86
87     TEST(SignUpTest, DISABLED_SignUpForValid)
88     {
89         std::string host("coap://192.168.1.2:5000");
90         std::string authProvider("AnyAuthProvider");
91         std::string authCode("AnyAuthCode");
92         QueryParamsMap options = {};
93         options.insert(std::pair<std::string, std::string>("AnyOptionKey", "AnyOptionValue"));
94         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
95         EXPECT_TRUE(NULL != accountManager);
96         EXPECT_EQ(OC_STACK_OK, accountManager->signUp(authProvider, authCode, options,
97                                                       &accountHandler));
98     }
99
100     TEST(SignUpTest, SignUpWithNullCallback)
101     {
102         std::string host("coap://192.168.1.2:5000");
103         std::string authProvider("AnyAuthProvider");
104         std::string authCode("AnyAuthCode");
105         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
106         EXPECT_TRUE(NULL != accountManager);
107         EXPECT_ANY_THROW(accountManager->signUp(authProvider, authCode, nullptr));
108     }
109
110     // SignIn Test
111     TEST(SignInTest, DISABLED_SignInForValid)
112     {
113         std::string host("coap://192.168.1.2:5000");
114         std::string userId("AnyUserId");
115         std::string accessToken("AnyAccessToken");
116         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
117         EXPECT_TRUE(NULL != accountManager);
118         EXPECT_EQ(OC_STACK_OK, accountManager->signIn(userId, accessToken, &accountHandler));
119     }
120
121     TEST(SignInTest, SignInWithNullCallback)
122     {
123         std::string host("coap://192.168.1.2:5000");
124         std::string userId("AnyUserId");
125         std::string accessToken("AnyAccessToken");
126         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
127         EXPECT_TRUE(NULL != accountManager);
128         EXPECT_ANY_THROW(accountManager->signIn(userId, accessToken, nullptr));
129     }
130
131     // SignOut Test
132     TEST(SignOutTest, DISABLED_SignOutForValid)
133     {
134         std::string host("coap://192.168.1.2:5000");
135         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
136         EXPECT_TRUE(NULL != accountManager);
137         EXPECT_EQ(OC_STACK_OK, accountManager->signOut(&accountHandler));
138     }
139
140     TEST(SignOutTest, SignOutWithNullCallback)
141     {
142         std::string host("coap://192.168.1.2:5000");
143         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
144         EXPECT_TRUE(NULL != accountManager);
145         EXPECT_ANY_THROW(accountManager->signOut(nullptr));
146     }
147
148     // RefreshAccessToken Test
149     TEST(RefreshAccessTokenTest, DISABLED_RefreshAccessTokenForValid)
150     {
151         std::string host("coap://192.168.1.2:5000");
152         std::string userId("AnyUserId");
153         std::string refreshToken("AnyRefreshToken");
154         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
155         EXPECT_TRUE(NULL != accountManager);
156         EXPECT_EQ(OC_STACK_OK, accountManager->refreshAccessToken(userId, refreshToken,
157                                                                   &accountHandler));
158     }
159
160     TEST(RefreshAccessTokenTest, RefreshAccessTokenWithNullCallback)
161     {
162         std::string host("coap://192.168.1.2:5000");
163         std::string userId("AnyUserId");
164         std::string refreshToken("AnyRefreshToken");
165         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
166         EXPECT_TRUE(NULL != accountManager);
167         EXPECT_ANY_THROW(accountManager->refreshAccessToken(userId, refreshToken, nullptr));
168     }
169
170     // SearchUser Test
171     TEST(SearchUserTest, DISABLED_SearchUserWithUserUuidForValid)
172     {
173         std::string host("coap://192.168.1.2:5000");
174         std::string userId("AnyUserId");
175         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
176         EXPECT_TRUE(NULL != accountManager);
177         EXPECT_EQ(OC_STACK_OK, accountManager->searchUser(userId, &accountHandler));
178     }
179
180     TEST(SearchUserTest, DISABLED_SearchUserWithQueryForValid)
181     {
182         std::string host("coap://192.168.1.2:5000");
183         std::string key("AnyKey");
184         std::string value("AnyValue");
185         QueryParamsMap query = {};
186         query.insert(std::pair<std::string, std::string>(key, value));
187         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
188         EXPECT_TRUE(NULL != accountManager);
189         EXPECT_EQ(OC_STACK_OK, accountManager->searchUser(query, &accountHandler));
190     }
191
192     TEST(SearchUserTest, SearchUserWithNullCallback)
193     {
194         std::string host("coap://192.168.1.2:5000");
195         std::string userId("AnyUserId");
196         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
197         EXPECT_TRUE(NULL != accountManager);
198         EXPECT_ANY_THROW(accountManager->searchUser(userId, nullptr));
199     }
200
201     // DeleteDevice Test
202     TEST(DeleteDeviceTest, DISABLED_DeleteDeviceForValid)
203     {
204         std::string host("coap://192.168.1.2:5000");
205         std::string deviceId("AnyDeviceId");
206         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
207         EXPECT_TRUE(NULL != accountManager);
208         EXPECT_EQ(OC_STACK_OK, accountManager->deleteDevice(deviceId, &deleteHandler));
209     }
210
211     TEST(DeleteDeviceTest, DeleteDeviceWithNullCallback)
212     {
213         std::string host("coap://192.168.1.2:5000");
214         std::string deviceId("AnyDeviceId");
215         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
216         EXPECT_TRUE(NULL != accountManager);
217         EXPECT_ANY_THROW(accountManager->deleteDevice(deviceId, nullptr));
218     }
219
220     // CreateGroup Test
221     TEST(CreateGroupTest, DISABLED_CreateGroupForValid)
222     {
223         std::string host("coap://192.168.1.2:5000");
224         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
225         EXPECT_TRUE(NULL != accountManager);
226         EXPECT_EQ(OC_STACK_OK, accountManager->createGroup(AclGroupType::PUBLIC, &accountHandler));
227     }
228
229     TEST(CreateGroupTest, CreateGroupWithNullCallback)
230     {
231         std::string host("coap://192.168.1.2:5000");
232         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
233         EXPECT_TRUE(NULL != accountManager);
234         EXPECT_ANY_THROW(accountManager->createGroup(AclGroupType::PUBLIC, nullptr));
235     }
236
237     // GetGroupList Test
238     TEST(GetGroupListTest, DISABLED_GetGroupListForValid)
239     {
240         std::string host("coap://192.168.1.2:5000");
241         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
242         EXPECT_TRUE(NULL != accountManager);
243         EXPECT_EQ(OC_STACK_OK, accountManager->getGroupList(&accountHandler));
244     }
245
246     TEST(GetGroupListTest, GetGroupListWithNullCallback)
247     {
248         std::string host("coap://192.168.1.2:5000");
249         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
250         EXPECT_TRUE(NULL != accountManager);
251         EXPECT_ANY_THROW(accountManager->getGroupList(nullptr));
252     }
253
254     // DeleteGroup Test
255     TEST(DeleteGroupTest, DISABLED_DeleteGroupForValid)
256     {
257         std::string host("coap://192.168.1.2:5000");
258         std::string groupId("AnyGroupId");
259         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
260         EXPECT_TRUE(NULL != accountManager);
261         EXPECT_EQ(OC_STACK_OK, accountManager->deleteGroup(groupId, &deleteHandler));
262     }
263
264     TEST(DeleteGroupTest, DeleteGroupWithNullCallback)
265     {
266         std::string host("coap://192.168.1.2:5000");
267         std::string groupId("AnyGroupId");
268         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
269         EXPECT_TRUE(NULL != accountManager);
270         EXPECT_ANY_THROW(accountManager->deleteGroup(groupId, nullptr));
271     }
272
273     // JoinGroup Test
274     TEST(JoinGroupTest, DISABLED_JoinGroupForValid)
275     {
276         std::string host("coap://192.168.1.2:5000");
277         std::string groupId("AnyGroupId");
278         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
279         EXPECT_TRUE(NULL != accountManager);
280         EXPECT_EQ(OC_STACK_OK, accountManager->joinGroup(groupId, &accountHandler));
281     }
282
283     TEST(JoinGroupTest, JoinGroupWithNullCallback)
284     {
285         std::string host("coap://192.168.1.2:5000");
286         std::string groupId("AnyGroupId");
287         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
288         EXPECT_TRUE(NULL != accountManager);
289         EXPECT_ANY_THROW(accountManager->joinGroup(groupId, nullptr));
290     }
291
292     // AddDeviceToGroup Test
293     TEST(AddDeviceToGroupTest, DISABLED_AddDeviceToGroupForValid)
294     {
295         std::string host("coap://192.168.1.2:5000");
296         std::string groupId("AnyGroupId");
297         std::vector<std::string> deviceId = {"AnyDevideId"};
298         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
299         EXPECT_TRUE(NULL != accountManager);
300         EXPECT_EQ(OC_STACK_OK, accountManager->addDeviceToGroup(groupId, deviceId,
301                                                                 &accountHandler));
302     }
303
304     TEST(AddDeviceToGroupTest, AddDeviceToGroupWithNullCallback)
305     {
306         std::string host("coap://192.168.1.2:5000");
307         std::string groupId("AnyGroupId");
308         std::vector<std::string> deviceId = {"AnyDevideId"};
309         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
310         EXPECT_TRUE(NULL != accountManager);
311         EXPECT_ANY_THROW(accountManager->addDeviceToGroup(groupId, deviceId, nullptr));
312     }
313
314     TEST(AddDeviceToGroupTest, AddDeviceToGroupWithEmptyDeviceID)
315     {
316         std::string host("coap://192.168.1.2:5000");
317         std::string groupId("AnyGroupId");
318         std::vector<std::string> deviceId = {};
319         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
320         EXPECT_TRUE(NULL != accountManager);
321         EXPECT_ANY_THROW(accountManager->addDeviceToGroup(groupId, deviceId, &accountHandler));
322     }
323
324     // GetGroupInfo Test
325     TEST(GetGroupInfoTest, DISABLED_GetGroupInfoForValid)
326     {
327         std::string host("coap://192.168.1.2:5000");
328         std::string groupId("AnyGroupId");
329         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
330         EXPECT_TRUE(NULL != accountManager);
331         EXPECT_EQ(OC_STACK_OK, accountManager->getGroupInfo(groupId, &accountHandler));
332     }
333
334     TEST(GetGroupInfoTest, GetGroupInfoWithNullCallback)
335     {
336         std::string host("coap://192.168.1.2:5000");
337         std::string groupId("AnyGroupId");
338         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
339         EXPECT_TRUE(NULL != accountManager);
340         EXPECT_ANY_THROW(accountManager->getGroupInfo(groupId, nullptr));
341     }
342
343     // LeaveGroup Test
344     TEST(LeaveGroupTest, DISABLED_LeaveGroupForValid)
345     {
346         std::string host("coap://192.168.1.2:5000");
347         std::string groupId("AnyGroupId");
348         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
349         EXPECT_TRUE(NULL != accountManager);
350         EXPECT_EQ(OC_STACK_OK, accountManager->leaveGroup(groupId, &deleteHandler));
351     }
352
353     TEST(LeaveGroupTest, LeaveGroupWithNullCallback)
354     {
355         std::string host("coap://192.168.1.2:5000");
356         std::string groupId("AnyGroupId");
357         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
358         EXPECT_TRUE(NULL != accountManager);
359         EXPECT_ANY_THROW(accountManager->leaveGroup(groupId, nullptr));
360     }
361
362     // DeleteDeviceFromGroup Test
363     TEST(DeleteDeviceFromGroupTest, DISABLED_DeleteDeviceFromGroupForValid)
364     {
365         std::string host("coap://192.168.1.2:5000");
366         std::string groupId("AnyGroupId");
367         std::vector<std::string> deviceId = {"AnyDevideId"};
368         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
369         EXPECT_TRUE(NULL != accountManager);
370         EXPECT_EQ(OC_STACK_OK, accountManager->deleteDeviceFromGroup(groupId, deviceId,
371                                                                      &deleteHandler));
372     }
373
374     TEST(DeleteDeviceFromGroupTest, DeleteDeviceFromGroupWithNullCallback)
375     {
376         std::string host("coap://192.168.1.2:5000");
377         std::string groupId("AnyGroupId");
378         std::vector<std::string> deviceId = {"AnyDevideId"};
379         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
380         EXPECT_TRUE(NULL != accountManager);
381         EXPECT_ANY_THROW(accountManager->deleteDeviceFromGroup(groupId, deviceId, nullptr));
382     }
383
384     TEST(DeleteDeviceFromGroupTest, DeleteDeviceFromGroupEmptyDeviceID)
385     {
386         std::string host("coap://192.168.1.2:5000");
387         std::string groupId("AnyGroupId");
388         std::vector<std::string> deviceId = {};
389         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
390         EXPECT_TRUE(NULL != accountManager);
391         EXPECT_ANY_THROW(accountManager->deleteDeviceFromGroup(groupId, deviceId,
392                                                                &deleteHandler));
393     }
394
395     // ObserveGroup Test
396     TEST(ObserveGroupTest, DISABLED_ObserveGroupForValid)
397     {
398         std::string host("coap://192.168.1.2:5000");
399         std::string groupId("AnyGroupId");
400         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
401         EXPECT_TRUE(NULL != accountManager);
402         EXPECT_EQ(OC_STACK_OK, accountManager->observeGroup(groupId, &onObserve));
403     }
404
405     TEST(ObserveGroupTest, ObserveGroupWithNullCallback)
406     {
407         std::string host("coap://192.168.1.2:5000");
408         std::string groupId("AnyGroupId");
409         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
410         EXPECT_TRUE(NULL != accountManager);
411         EXPECT_ANY_THROW(accountManager->observeGroup(groupId, nullptr));
412     }
413
414     // CancelObserveGroup Test
415     TEST(CancelObserveGroupTest, DISABLED_CancelObserveGroupForValid)
416     {
417         std::string host("coap://192.168.1.2:5000");
418         std::string groupId("AnyGroupId");
419         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
420         EXPECT_TRUE(NULL != accountManager);
421         EXPECT_EQ(OC_STACK_OK, accountManager->observeGroup(groupId, &onObserve));
422         EXPECT_EQ(OC_STACK_OK, accountManager->cancelObserveGroup(groupId));
423     }
424
425     TEST(CancelObserveGroupTest, CancelObserveGroupWithoutObserve)
426     {
427         std::string host("coap://192.168.1.2:5000");
428         std::string groupId("AnyGroupId");
429         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
430         EXPECT_TRUE(NULL != accountManager);
431         EXPECT_ANY_THROW(accountManager->cancelObserveGroup(groupId));
432     }
433
434     // ObserveInvitation Test
435     TEST(ObserveInvitationTest, DISABLED_ObserveInvitationForValid)
436     {
437         std::string host("coap://192.168.1.2:5000");
438         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
439         EXPECT_TRUE(NULL != accountManager);
440         EXPECT_EQ(OC_STACK_OK, accountManager->observeInvitation(&onObserve));
441     }
442
443     TEST(ObserveInvitationTest, ObserveInvitationWithNullCallback)
444     {
445         std::string host("coap://192.168.1.2:5000");
446         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
447         EXPECT_TRUE(NULL != accountManager);
448         EXPECT_ANY_THROW(accountManager->observeInvitation(nullptr));
449     }
450
451     // CancelObserveInvitation Test
452     TEST(CancelObserveInvitationTest, DISABLED_CancelObserveInvitationForValid)
453     {
454         std::string host("coap://192.168.1.2:5000");
455         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
456         EXPECT_TRUE(NULL != accountManager);
457         EXPECT_EQ(OC_STACK_OK, accountManager->observeInvitation(&onObserve));
458         EXPECT_EQ(OC_STACK_OK, accountManager->cancelObserveInvitation());
459     }
460
461     TEST(CancelObserveInvitationTest, CancelObserveInvitationWithoutObserve)
462     {
463         std::string host("coap://192.168.1.2:5000");
464         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
465         EXPECT_TRUE(NULL != accountManager);
466         EXPECT_ANY_THROW(accountManager->cancelObserveInvitation());
467     }
468
469     // SendInvitation Test
470     TEST(SendInvitationTest, DISABLED_SendInvitationForValid)
471     {
472         std::string host("coap://192.168.1.2:5000");
473         std::string groupId("AnyGroupId");
474         std::string userId("AnyUserId");
475         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
476         EXPECT_TRUE(NULL != accountManager);
477         EXPECT_EQ(OC_STACK_OK, accountManager->sendInvitation(groupId, userId, &accountHandler));
478     }
479
480     TEST(SendInvitationTest, SendInvitationWithNullCallback)
481     {
482         std::string host("coap://192.168.1.2:5000");
483         std::string groupId("AnyGroupId");
484         std::string userId("AnyUserId");
485         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
486         EXPECT_TRUE(NULL != accountManager);
487         EXPECT_ANY_THROW(accountManager->sendInvitation(groupId, userId, nullptr));
488     }
489
490     // CancelInvitation Test
491     TEST(CancelInvitationTest, DISABLED_CancelInvitationForValid)
492     {
493         std::string host("coap://192.168.1.2:5000");
494         std::string groupId("AnyGroupId");
495         std::string userId("AnyUserId");
496         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
497         EXPECT_TRUE(NULL != accountManager);
498         EXPECT_EQ(OC_STACK_OK, accountManager->cancelInvitation(groupId, userId, &deleteHandler));
499     }
500
501     TEST(CancelInvitationTest, CancelInvitationWithNullCallback)
502     {
503         std::string host("coap://192.168.1.2:5000");
504         std::string groupId("AnyGroupId");
505         std::string userId("AnyUserId");
506         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
507         EXPECT_TRUE(NULL != accountManager);
508         EXPECT_ANY_THROW(accountManager->cancelInvitation(groupId, userId, nullptr));
509     }
510
511     // DeleteInvitation Test
512     TEST(DeleteInvitationTest, DISABLED_DeleteInvitationForValid)
513     {
514         std::string host("coap://192.168.1.2:5000");
515         std::string groupId("AnyGroupId");
516         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
517         EXPECT_TRUE(NULL != accountManager);
518         EXPECT_EQ(OC_STACK_OK, accountManager->deleteInvitation(groupId, &deleteHandler));
519     }
520
521     TEST(DeleteInvitationTest, DeleteInvitationWithNullCallback)
522     {
523         std::string host("coap://192.168.1.2:5000");
524         std::string groupId("AnyGroupId");
525         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
526         EXPECT_TRUE(NULL != accountManager);
527         EXPECT_ANY_THROW(accountManager->deleteInvitation(groupId, nullptr));
528     }
529 }