use of com.zimbra.soap.account.message.SubscribeDistributionListResponse 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);
}
Aggregations