use of com.zimbra.soap.admin.message.CreateDistributionListRequest in project zm-mailbox by Zimbra.
the class TestDomainAdmin method testModifyDistributionListInDiffDomain.
@Test
public void testModifyDistributionListInDiffDomain() throws Exception {
String domAdminId = createAdminConsoleStyleDomainAdmin(DOMADMIN);
SoapProvisioning domAdminSoapProv = getSoapProvisioning(DOMADMIN, TestUtil.DEFAULT_PASSWORD);
List<Attr> attrs = Lists.newArrayList();
attrs.add(new Attr(Provisioning.A_displayName, "testGetDistributionListInDiffDomain Room 101"));
CreateDistributionListResponse caResp;
caResp = adminSoapProv.invokeJaxb(new CreateDistributionListRequest(DIFF_DL, attrs, false));
assertNotNull("CreateDistributionListResponse for " + DIFF_DL + " as FULL ADMIN", caResp);
String dlId = caResp.getDl().getId();
ModifyDistributionListRequest modAcctReq = new ModifyDistributionListRequest(dlId);
modAcctReq.addAttr(new Attr(Provisioning.A_description, "dummy description"));
try {
domAdminSoapProv.invokeJaxb(modAcctReq);
} catch (SoapFaultException sfe) {
checkSoapReason(sfe, "permission denied: can not access distribution list ");
}
DeleteDistributionListRequest delAcctReq = new DeleteDistributionListRequest(dlId);
DeleteDistributionListResponse delAcctResp = adminSoapProv.invokeJaxb(delAcctReq);
assertNotNull("DeleteDistributionListResponse for " + DIFF_DL + " as ADMIN", delAcctResp);
try {
domAdminSoapProv.invokeJaxb(modAcctReq);
fail("ModifyDistributionListRequest succeeded after delete!");
} catch (SoapFaultException sfe) {
// Get this instead of "no such distribution list" because modify by ID (not name) and for domain admin
// cannot know whether that ID was for a domain we administered or not.
checkSoapReason(sfe, "permission denied: can not access distribution list ");
}
}
Aggregations