use of com.zimbra.soap.mail.type.MsgWithGroupInfo in project zm-mailbox by Zimbra.
the class TestExpandGroupInfo method getMsg.
@Test
public void getMsg() throws Exception {
String SUBJECT = getTestName();
String msgId = createAppt(acct, group.getName(), SUBJECT, "blah");
SoapTransport transport = authUser(acct.getName());
MsgSpec msgSpec = new MsgSpec(msgId);
msgSpec.setNeedCanExpand(Boolean.TRUE);
GetMsgRequest req = new GetMsgRequest(msgSpec);
GetMsgResponse resp = invokeJaxb(transport, req);
MsgWithGroupInfo msg = resp.getMsg();
InviteWithGroupInfo invite = msg.getInvite();
List<InviteComponentWithGroupInfo> invComps = invite.getInviteComponents();
for (InviteComponentWithGroupInfo invComp : invComps) {
List<CalendarAttendeeWithGroupInfo> attendees = invComp.getAttendees();
for (CalendarAttendeeWithGroupInfo attendee : attendees) {
Boolean isGroup = attendee.getGroup();
Boolean canExpandGroupMembers = attendee.getCanExpandGroupMembers();
assertTrue(isGroup);
assertTrue(canExpandGroupMembers);
}
}
}
use of com.zimbra.soap.mail.type.MsgWithGroupInfo in project zm-mailbox by Zimbra.
the class TestInvite method testBug86864DelegateInboxInviteLooksLikeInvite.
public void testBug86864DelegateInboxInviteLooksLikeInvite() throws Exception {
TestUtil.createAccount(ORGANIZER);
Account attendee = TestUtil.createAccount(ATTENDEE);
Account delegate = TestUtil.createAccount(DELEGATE);
ZMailbox mboxOrganizer = TestUtil.getZMailbox(ORGANIZER);
ZMailbox mboxAttendee = TestUtil.getZMailbox(ATTENDEE);
ZMailbox mboxDelegate = TestUtil.getZMailbox(DELEGATE);
String subject = NAME_PREFIX + " for testing treatment at delegate inbox";
Date startDate = new Date(System.currentTimeMillis() + Constants.MILLIS_PER_DAY);
Date endDate = new Date(startDate.getTime() + Constants.MILLIS_PER_HOUR);
String calendarId = Integer.valueOf(Mailbox.ID_FOLDER_CALENDAR).toString();
FolderActionSelector action = new FolderActionSelector(calendarId, /* id */
"grant");
ActionGrantSelector grant = new ActionGrantSelector("rwidxa", /* perm */
"usr");
grant.setDisplayName(delegate.getName());
grant.setPassword("");
action.setGrant(grant);
FolderActionRequest folderActionReq = new FolderActionRequest(action);
FolderActionResponse folderActionResp = mboxAttendee.invokeJaxb(folderActionReq);
assertNotNull("null FolderAction Response used to share folder", folderActionResp);
ModifyPrefsRequest modPrefsReq = new ModifyPrefsRequest();
Pref fwdInvitesPref = Pref.createPrefWithNameAndValue(ZAttrProvisioning.A_zimbraPrefCalendarForwardInvitesTo, delegate.getName());
modPrefsReq.addPref(fwdInvitesPref);
Pref noAutoAddPref = Pref.createPrefWithNameAndValue(ZAttrProvisioning.A_zimbraPrefCalendarAutoAddInvites, Boolean.FALSE.toString().toUpperCase());
modPrefsReq.addPref(noAutoAddPref);
ModifyPrefsResponse modPrefsResp = mboxAttendee.invokeJaxb(modPrefsReq);
assertNotNull("null ModifyPrefs Response for forwarding calendar invites/no auto-add", modPrefsResp);
NewMountpointSpec mpSpec = new NewMountpointSpec("Shared Calendar");
mpSpec.setFlags("#");
mpSpec.setRemoteId(Mailbox.ID_FOLDER_CALENDAR);
mpSpec.setColor((byte) 4);
mpSpec.setOwnerId(attendee.getId());
mpSpec.setFolderId(Integer.valueOf(Mailbox.ID_FOLDER_USER_ROOT).toString());
mpSpec.setDefaultView(MailItem.Type.APPOINTMENT.toString());
CreateMountpointRequest createMpReq = new CreateMountpointRequest(mpSpec);
CreateMountpointResponse createMpResp = mboxDelegate.invokeJaxb(createMpReq);
assertNotNull("null ModifyPrefs Response for forwarding calendar invites", createMpResp);
TestUtil.createAppointment(mboxOrganizer, subject, attendee.getName(), startDate, endDate);
ZMessage inviteMsg = TestUtil.waitForMessage(mboxDelegate, "in:inbox " + subject);
assertNotNull("null inviteMsg in delegate inbox", inviteMsg);
MsgSpec msgSpec = new MsgSpec(inviteMsg.getId());
msgSpec.setWantHtml(true);
msgSpec.setNeedCanExpand(true);
msgSpec.setMaxInlinedLength(250000);
GetMsgRequest getMsgReq = new GetMsgRequest(msgSpec);
GetMsgResponse getMsgResp = mboxDelegate.invokeJaxb(getMsgReq);
assertNotNull("null GetMsgResponse in delegate inbox", getMsgResp);
MsgWithGroupInfo msg = getMsgResp.getMsg();
assertNotNull("null message in GetMsgResponse in delegate inbox", msg);
InviteWithGroupInfo invite = msg.getInvite();
assertNotNull("null invite in message in GetMsgResponse in delegate inbox regression to Bug 86864?", invite);
}
Aggregations