Search in sources :

Example 1 with ZSearchGalResult

use of com.zimbra.client.ZMailbox.ZSearchGalResult in project zm-mailbox by Zimbra.

the class ZMailboxUtil method doAutoCompleteGal.

private void doAutoCompleteGal(String[] args) throws ServiceException {
    ZSearchGalResult result = mMbox.autoCompleteGal(args[0], GalEntryType.account, 20);
    dumpContacts(result.getContacts());
}
Also used : ZSearchGalResult(com.zimbra.client.ZMailbox.ZSearchGalResult)

Example 2 with ZSearchGalResult

use of com.zimbra.client.ZMailbox.ZSearchGalResult in project zm-mailbox by Zimbra.

the class TestZClient method testImapUIDForGalContact.

@Test
public void testImapUIDForGalContact() throws Exception {
    ZMailbox mbox = TestUtil.getZMailbox(USER_NAME);
    ZSearchGalResult zsgr = mbox.autoCompleteGal(USER_NAME, /* query */
    GalEntryType.all, 20);
    assertNotNull("ZSearchGalResult", zsgr);
    List<ZContact> contacts = zsgr.getContacts();
    assertNotNull("ZSearchGalResult.getContacts()", contacts);
    assertTrue(String.format("Contacts size %s should be greater than 0", contacts.size()), contacts.size() > 0);
    for (ZContact contact : contacts) {
        assertEquals("IMAP UID should be zero for Gal contact", 0, contact.getImapUid());
        assertEquals("ModifiedSequence should be zero for Gal contact", 0, contact.getModifiedSequence());
    }
}
Also used : ZMailbox(com.zimbra.client.ZMailbox) ZSearchGalResult(com.zimbra.client.ZMailbox.ZSearchGalResult) ZContact(com.zimbra.client.ZContact) Test(org.junit.Test)

Aggregations

ZSearchGalResult (com.zimbra.client.ZMailbox.ZSearchGalResult)2 ZContact (com.zimbra.client.ZContact)1 ZMailbox (com.zimbra.client.ZMailbox)1 Test (org.junit.Test)1