Thread.sleep(500);
// Assert the list composition.
PrivacyList[] privacyLists = privacyManager.getPrivacyLists();
PrivacyList receivedList1 = null;
PrivacyList receivedList2 = null;
for (PrivacyList privacyList : privacyLists) {
if (listName1.equals(privacyList.toString())) {
receivedList1 = privacyList;
}
if (listName2.equals(privacyList.toString())) {
receivedList2 = privacyList;
}
}
PrivacyItem receivedItem;
// Assert on the list 1
assertNotNull(receivedList1);
assertEquals(1, receivedList1.getItems().size());
receivedItem = receivedList1.getItems().get(0);
assertEquals(1, receivedItem.getOrder());
assertEquals(PrivacyItem.Type.jid, receivedItem.getType());
assertEquals(true, receivedItem.isAllow());
assertEquals(getConnection(0).getUser(), receivedItem.getValue());
// Assert on the list 2
assertNotNull(receivedList2);
assertEquals(1, receivedList2.getItems().size());
receivedItem = receivedList2.getItems().get(0);
assertEquals(2, receivedItem.getOrder());
assertEquals(PrivacyItem.Type.group, receivedItem.getType());
assertEquals(groupName, receivedItem.getValue());
assertEquals(false, receivedItem.isAllow());
assertEquals(groupName, receivedItem.getValue());