-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ZCS-16428 added support for delivryReport in SaveDraft
added support for delivery report in scheduled messages Refatored condition to check delegator's LDAP attr Oprimized condition
- Loading branch information
1 parent
72c8e4e
commit 71f313a
Showing
6 changed files
with
88 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,4 +126,68 @@ protected Element generateResponse(ZimbraSoapContext zsc, ItemIdFormatter ifmt, | |
Assert.assertEquals("picked up modified content", MODIFIED_CONTENT, response.getElement(MailConstants.E_MSG).getElement(MailConstants.E_MIMEPART).getAttribute(MailConstants.E_CONTENT)); | ||
} | ||
|
||
@Test | ||
public void deliveryReportEnabled() throws Exception { | ||
Account acct = Provisioning.getInstance().getAccountByName("[email protected]"); | ||
|
||
// create a draft via SOAP | ||
Element request = new Element.JSONElement(MailConstants.SAVE_DRAFT_REQUEST); | ||
Element m = request.addNonUniqueElement(MailConstants.E_MSG).addAttribute(MailConstants.E_SUBJECT, "dinner appt"); | ||
m.addUniqueElement(MailConstants.E_MIMEPART).addAttribute(MailConstants.A_CONTENT_TYPE, "text/plain").addAttribute(MailConstants.E_CONTENT, ORIGINAL_CONTENT); | ||
m.addAttribute(MailConstants.A_DELIVERY_RECEIPT_NOTIFICATION, "1"); | ||
|
||
Element response = new SaveDraft() { | ||
@Override | ||
protected Element generateResponse(ZimbraSoapContext zsc, ItemIdFormatter ifmt, OperationContext octxt, | ||
Mailbox mbox, Message msg, boolean wantImapUid, boolean wantModSeq) { | ||
|
||
return super.generateResponse(zsc, ifmt, octxt, mbox, msg, wantImapUid, wantModSeq); | ||
} | ||
}.handle(request, ServiceTestUtil.getRequestContext(acct)); | ||
|
||
Assert.assertTrue(response.getElement(MailConstants.E_MSG).getAttributeBool(MailConstants.A_DELIVERY_RECEIPT_NOTIFICATION, false)); | ||
} | ||
|
||
@Test | ||
public void deliveryReportDisabled() throws Exception { | ||
Account acct = Provisioning.getInstance().getAccountByName("[email protected]"); | ||
|
||
// create a draft via SOAP | ||
Element request = new Element.JSONElement(MailConstants.SAVE_DRAFT_REQUEST); | ||
Element m = request.addNonUniqueElement(MailConstants.E_MSG).addAttribute(MailConstants.E_SUBJECT, "dinner appt"); | ||
m.addUniqueElement(MailConstants.E_MIMEPART).addAttribute(MailConstants.A_CONTENT_TYPE, "text/plain").addAttribute(MailConstants.E_CONTENT, ORIGINAL_CONTENT); | ||
m.addAttribute(MailConstants.A_DELIVERY_RECEIPT_NOTIFICATION, "0"); | ||
|
||
Element response = new SaveDraft() { | ||
@Override | ||
protected Element generateResponse(ZimbraSoapContext zsc, ItemIdFormatter ifmt, OperationContext octxt, | ||
Mailbox mbox, Message msg, boolean wantImapUid, boolean wantModSeq) { | ||
|
||
return super.generateResponse(zsc, ifmt, octxt, mbox, msg, wantImapUid, wantModSeq); | ||
} | ||
}.handle(request, ServiceTestUtil.getRequestContext(acct)); | ||
|
||
Assert.assertFalse(response.getElement(MailConstants.E_MSG).getAttributeBool(MailConstants.A_DELIVERY_RECEIPT_NOTIFICATION, false)); | ||
} | ||
|
||
@Test | ||
public void deliveryReportNotSet() throws Exception { | ||
Account acct = Provisioning.getInstance().getAccountByName("[email protected]"); | ||
|
||
// create a draft via SOAP | ||
Element request = new Element.JSONElement(MailConstants.SAVE_DRAFT_REQUEST); | ||
Element m = request.addNonUniqueElement(MailConstants.E_MSG).addAttribute(MailConstants.E_SUBJECT, "dinner appt"); | ||
m.addUniqueElement(MailConstants.E_MIMEPART).addAttribute(MailConstants.A_CONTENT_TYPE, "text/plain").addAttribute(MailConstants.E_CONTENT, ORIGINAL_CONTENT); | ||
|
||
Element response = new SaveDraft() { | ||
@Override | ||
protected Element generateResponse(ZimbraSoapContext zsc, ItemIdFormatter ifmt, OperationContext octxt, | ||
Mailbox mbox, Message msg, boolean wantImapUid, boolean wantModSeq) { | ||
|
||
return super.generateResponse(zsc, ifmt, octxt, mbox, msg, wantImapUid, wantModSeq); | ||
} | ||
}.handle(request, ServiceTestUtil.getRequestContext(acct)); | ||
|
||
Assert.assertFalse(response.getElement(MailConstants.E_MSG).getAttributeBool(MailConstants.A_DELIVERY_RECEIPT_NOTIFICATION, false)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters