use of com.zimbra.soap.account.message.SubscribeDistributionListRequest in project zm-mailbox by Zimbra.
the class TestDelegatedDL method subscribeDistributionList.
@Test
public void subscribeDistributionList() throws Exception {
SoapTransport transport = authUser(USER_NOT_OWNER);
// subscribe
SubscribeDistributionListRequest req = new SubscribeDistributionListRequest(DistributionListSelector.fromName(DL_NAME), DistributionListSubscribeOp.subscribe);
SubscribeDistributionListResponse resp = invokeJaxb(transport, req);
assertEquals(DistributionListSubscribeStatus.subscribed, resp.getStatus());
// unsubscribe
req = new SubscribeDistributionListRequest(DistributionListSelector.fromName(DL_NAME), DistributionListSubscribeOp.unsubscribe);
boolean caughtPermDenied = false;
try {
resp = invokeJaxb(transport, req);
} catch (ServiceException e) {
String code = e.getCode();
if (ServiceException.PERM_DENIED.equals(code)) {
caughtPermDenied = true;
}
}
assertTrue(caughtPermDenied);
}
use of com.zimbra.soap.account.message.SubscribeDistributionListRequest in project zm-mailbox by Zimbra.
the class TestDelegatedDL method noHomeServerZimbraAccount.
/*
* Verify groups without a home server will get PROXY_ERROR for zimbraAccount
* SOAP calls.
*/
@Test
@Bug(bug = 66412)
public void noHomeServerZimbraAccount() throws Exception {
String groupName = TestUtil.getAddress(genGroupNameLocalPart(), DOMAIN_NAME);
Group group = provUtil.createGroup(groupName, DYNAMIC);
// remove zimbraMailHost
Map<String, Object> attrs = Maps.newHashMap();
attrs.put(Provisioning.A_zimbraMailHost, null);
prov.modifyAttrs(group, attrs);
SoapTransport transport = authUser(USER_OWNER);
/*
* GetDistributionList
*/
GetDistributionListRequest getDLreq = new GetDistributionListRequest(DistributionListSelector.fromName(groupName), Boolean.TRUE);
verifyCaughtProxyError(transport, getDLreq);
/*
* DistributionListAction
*/
DistributionListActionRequest DLActionReq = new DistributionListActionRequest(DistributionListSelector.fromName(groupName), new DistributionListAction(Operation.addMembers));
verifyCaughtProxyError(transport, DLActionReq);
/*
* SubscribeDistributionList
*/
SubscribeDistributionListRequest subsDLReq = new SubscribeDistributionListRequest(DistributionListSelector.fromName(groupName), DistributionListSubscribeOp.subscribe);
verifyCaughtProxyError(transport, subsDLReq);
provUtil.deleteGroup(group);
}
Aggregations